用户角色回显有问题的bug

pull/2/head
dearlin 2023-11-09 09:42:11 +08:00
parent 38d63aae1d
commit c4a52b3bd2
1 changed files with 6 additions and 22 deletions

View File

@ -100,7 +100,7 @@
</div> </div>
</el-main> </el-main>
</el-container> </el-container>
<el-dialog :visible.sync="dialogFormEdit" :title="dialogType==='editUser'?'修改':'新增'" width="600px"> <el-dialog v-loading="editloading" :visible.sync="dialogFormEdit" :title="dialogType==='editUser'?'修改':'新增'" width="600px">
<el-form ref="form" :rules="rules" :model="pd" label-width="110px" style="width: 500px;"> <el-form ref="form" :rules="rules" :model="pd" label-width="110px" style="width: 500px;">
<el-form-item label="角色" prop="ROLE_ID"> <el-form-item label="角色" prop="ROLE_ID">
<el-select v-model="pd.ROLE_ID" multiple placeholder="请选择角色"> <el-select v-model="pd.ROLE_ID" multiple placeholder="请选择角色">
@ -246,6 +246,7 @@ export default {
keyDepeName: '', keyDepeName: '',
keyJobLeven: '', keyJobLeven: '',
dialogFormEdit: false, dialogFormEdit: false,
editloading: false,
dialogType: 'add', dialogType: 'add',
rules: { rules: {
EMAIL: [ EMAIL: [
@ -357,6 +358,7 @@ export default {
})) }))
resolve(nodes) // resolve resolve(nodes) // resolve
}).catch((e) => { }).catch((e) => {
this.editloading = false
this.listLoading = false this.listLoading = false
}) })
}, 500) }, 500)
@ -588,8 +590,6 @@ export default {
console.log(row) console.log(row)
this.dialogType = 'editUser' this.dialogType = 'editUser'
this.pd = JSON.parse(JSON.stringify(row)) this.pd = JSON.parse(JSON.stringify(row))
this.dialogFormEdit = true
await this.$nextTick()
const areaRefID = [] const areaRefID = []
if (this.pd.PROVINCE) { if (this.pd.PROVINCE) {
areaRefID.push(this.pd.PROVINCE) areaRefID.push(this.pd.PROVINCE)
@ -609,14 +609,6 @@ export default {
refDeptLevelVal.id = this.pd.deptLevenlID refDeptLevelVal.id = this.pd.deptLevenlID
const deptRefsValue = {} const deptRefsValue = {}
deptRefsValue.id = this.pd.DEPARTMENT_ID deptRefsValue.id = this.pd.DEPARTMENT_ID
// this.$nextTick(() => { // 使
// if (this.$refs.refFromDeptTypeID) {
// this.$refs.refFromDeptTypeID.handleNodeClick(refDeptLevelVal)
// }
// if (this.$refs.deptTree) {
// this.$refs.deptTree.handleNodeClick(deptRefsValue)
// }
// }
var arrString = [] var arrString = []
if (this.pd.ROLE_ID != null && this.pd.ROLE_ID != '') { if (this.pd.ROLE_ID != null && this.pd.ROLE_ID != '') {
arrString.push(this.pd.ROLE_ID) arrString.push(this.pd.ROLE_ID)
@ -631,17 +623,9 @@ export default {
} }
} }
this.pd.ROLE_ID = arrString this.pd.ROLE_ID = arrString
// var roleIds = [] this.dialogFormEdit = true
// if (this.pd.ROLE_ID) { await this.$nextTick()
// roleIds.push(this.pd.ROLE_ID)
// if (this.pd.ROLE_IDS) {
// var roleIDS = this.pd.ROLE_IDS.split(',')
// roleIDS.forEach((item) => {
// roleIds.push(item)
// })
// }
// }
// this.pd.ROLE_ID = roleIds
}, },
handleEditStatus(row, type) { handleEditStatus(row, type) {
const typeName = type == '1' ? '禁用' : '启用' const typeName = type == '1' ? '禁用' : '启用'