|
|
|
@ -9,6 +9,9 @@ |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="dataForm.userName" placeholder="用户账号" clearable></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="dataForm.userDisplay" placeholder="用户名" clearable></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button @click="getDataList" type="primary">{{ buttons.search || '查询' }}</el-button> |
|
|
|
<el-button v-if="isAuth('sys:user:save')" type="primary" @click="addOrUpdateHandle()">{{ buttons.add || '新增' }}</el-button> |
|
|
|
@ -74,8 +77,12 @@ |
|
|
|
width="150" |
|
|
|
:label="buttons.cz||'操作'"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a v-if="isAuth('sys:user:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.userId)">{{ buttons.edit || '修改' }}</a> |
|
|
|
<a v-if="isAuth('sys:user:delete')" type="text" size="small" @click="deleteHandle(scope.row.userId)">{{ buttons.delete || '删除' }}</a> |
|
|
|
<a v-if="!adminUser && scope.row.userId === 1" type="text" size="small" style="pointer-events:none;color: #8a979e">{{ buttons.edit || '修改' }}</a> |
|
|
|
<a v-if="!adminUser && scope.row.userId !== 1" type="text" size="small" @click="addOrUpdateHandle(scope.row.userId)">{{ buttons.edit || '修改' }}</a> |
|
|
|
<a v-if="adminUser" type="text" size="small" @click="addOrUpdateHandle(scope.row.userId)">{{ buttons.edit || '修改' }}</a> |
|
|
|
<a v-if="!adminUser && scope.row.userId === 1" type="text" size="small" style="pointer-events:none;color: #8a979e">{{ buttons.delete || '删除' }}</a> |
|
|
|
<a v-if="!adminUser && scope.row.userId !== 1" type="text" size="small" @click="deleteHandle(scope.row.userId)">{{ buttons.delete || '删除' }}</a> |
|
|
|
<a v-if="adminUser" type="text" size="small" @click="deleteHandle(scope.row.userId)">{{ buttons.delete || '删除' }}</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
@ -542,7 +549,8 @@ export default { |
|
|
|
saveButton: false, |
|
|
|
}, |
|
|
|
dataForm: { |
|
|
|
userName: '' |
|
|
|
userName: '', |
|
|
|
userDisplay:'' |
|
|
|
}, |
|
|
|
columnList: [ |
|
|
|
{ |
|
|
|
@ -684,6 +692,11 @@ export default { |
|
|
|
this.height = window.innerHeight - 200; |
|
|
|
}) |
|
|
|
}, |
|
|
|
computed:{ |
|
|
|
adminUser(){ |
|
|
|
return this.$store.state.user.id === 1 || this.$store.state.role.name |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 校验用户是否收藏 |
|
|
|
favoriteIsOk () { |
|
|
|
@ -1243,7 +1256,8 @@ export default { |
|
|
|
params: this.$http.adornParams({ |
|
|
|
'page': this.pageIndex, |
|
|
|
'limit': this.pageSize, |
|
|
|
'username': this.dataForm.userName |
|
|
|
'username': this.dataForm.userName, |
|
|
|
'userDisplay': this.dataForm.userDisplay |
|
|
|
}) |
|
|
|
}).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
|