Merge branch 'feature/sso_function_v1205' of http://121.40.234.130:8899/root/lanzhouhailiang_one into feature/sso_function_v1205
This commit is contained in:
@@ -77,7 +77,8 @@
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="form.email" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门" prop="depts" :rules="[{ required: true, message: '请选择部门', trigger: 'change' }]">
|
||||
<br v-if="!crud.status.edit">
|
||||
<el-form-item v-if="crud.status.add" label="部门" prop="depts" :rules="[{ required: true, message: '请选择部门', trigger: 'change' }]">
|
||||
<treeselect
|
||||
v-model="form.depts"
|
||||
:load-options="loadDepts"
|
||||
@@ -108,7 +109,8 @@
|
||||
inactive-value="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-bottom: 0;" label="角色" prop="roles">
|
||||
<br v-if="!crud.status.edit">
|
||||
<el-form-item v-if="crud.status.add" style="margin-bottom: 0;" label="角色" prop="roles">
|
||||
<el-select
|
||||
v-model="roleDatas"
|
||||
style="width: 512px"
|
||||
@@ -168,8 +170,8 @@
|
||||
width="200"
|
||||
>
|
||||
<template v-if="scope.row.userId !== 1" slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="crud.toEdit(scope.row)(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handdeleted(scope.row)">删除</el-button>
|
||||
<el-dropdown v-hasPermi="['system:user:resetPwd', 'system:user:edit']" size="mini" @command="(command) => handleCommand(command, scope.row)">
|
||||
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
@@ -241,7 +243,7 @@ const defaultForm = {
|
||||
person_name: null,
|
||||
gender: '男',
|
||||
email: null,
|
||||
enabled: 'true',
|
||||
is_used: '1',
|
||||
roles: [],
|
||||
phone: null,
|
||||
password: null
|
||||
@@ -316,6 +318,17 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
handdeleted(datas) {
|
||||
this.$confirm(`确认删除选中的1条数据?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.crud.delAllLoading = true
|
||||
this.crud.doDelete(datas)
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
// 新增与编辑前做的操作
|
||||
[CRUD.HOOK.afterToCU](crud, form) {
|
||||
this.getRoles()
|
||||
@@ -324,7 +337,7 @@ export default {
|
||||
} else {
|
||||
this.getSupDepts(form.dept_id)
|
||||
}
|
||||
this.getRoleLevel()
|
||||
// this.getRoleLevel() 暂时不用
|
||||
form.is_used = form.enabled.toString()
|
||||
},
|
||||
// 新增前将多选的值设置为空
|
||||
@@ -334,15 +347,17 @@ export default {
|
||||
},
|
||||
// 初始化编辑时候的角色与岗位
|
||||
[CRUD.HOOK.beforeToEdit](crud, form) {
|
||||
crud.status.edit
|
||||
this.roleDatas = []
|
||||
userRoles = []
|
||||
const _this = this
|
||||
const arr = form.roles.split(',')
|
||||
arr.forEach(function(role, index) {
|
||||
_this.roleDatas.push(role.id)
|
||||
const rol = { id: role.id }
|
||||
userRoles.push(rol)
|
||||
})
|
||||
if (form.roles !== null && form.roles.length > 0) {
|
||||
form.roles.forEach(function(role, index) {
|
||||
_this.roleDatas.push(role)
|
||||
const rol = { id: role }
|
||||
userRoles.push(rol)
|
||||
})
|
||||
}
|
||||
},
|
||||
// 提交前做的操作
|
||||
[CRUD.HOOK.afterValidateCU](crud) {
|
||||
@@ -363,8 +378,7 @@ export default {
|
||||
userRoles.forEach(function(data, index) {
|
||||
roles.push(data.id)
|
||||
})
|
||||
crud.form.roles = roles.toString()
|
||||
crud.form.depts = crud.form.depts.toString()
|
||||
crud.form.roles = roles
|
||||
return true
|
||||
},
|
||||
// 获取左侧部门数据
|
||||
@@ -477,7 +491,8 @@ export default {
|
||||
})
|
||||
},
|
||||
checkboxT(row, rowIndex) {
|
||||
return row.id !== this.user.id
|
||||
// return row.id !== this.user.id
|
||||
return true
|
||||
},
|
||||
resetPassword(row) {
|
||||
row.password = null
|
||||
|
||||
Reference in New Issue
Block a user