|
|
@ -35,6 +35,28 @@ |
|
|
|
:readonly="true" |
|
|
|
:placeholder="$t('user.deptName')"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="relationDeptName" |
|
|
|
label="关联部门" |
|
|
|
class="dept-list"> |
|
|
|
<el-popover v-model="relationDeptListVisible" |
|
|
|
ref="relationDeptListPopover" |
|
|
|
placement="bottom-start" |
|
|
|
trigger="click"> |
|
|
|
<el-tree :data="relationDeptList" |
|
|
|
:props="{ label: 'name', children: 'children' }" |
|
|
|
node-key="id" |
|
|
|
ref="relationDeptListTree" |
|
|
|
:highlight-current="true" |
|
|
|
:expand-on-click-node="false" |
|
|
|
accordion |
|
|
|
@current-change="relationDeptListTreeCurrentChangeHandle"> |
|
|
|
</el-tree> |
|
|
|
</el-popover> |
|
|
|
<el-input v-model="dataForm.relationDeptName" |
|
|
|
v-popover:relationDeptListPopover |
|
|
|
:readonly="true" |
|
|
|
placeholder="关联部门"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="用户类型" |
|
|
|
prop="userTagKey"> |
|
|
|
<el-select v-model="dataForm.userTagKey" |
|
|
@ -120,7 +142,9 @@ export default { |
|
|
|
return { |
|
|
|
visible: false, |
|
|
|
deptList: [], |
|
|
|
relationDeptList: [], |
|
|
|
deptListVisible: false, |
|
|
|
relationDeptListVisible: false, |
|
|
|
roleList: [], |
|
|
|
roleIdListDefault: [], |
|
|
|
dataForm: { |
|
|
@ -128,6 +152,8 @@ export default { |
|
|
|
username: '', |
|
|
|
deptId: '0', |
|
|
|
deptName: '', |
|
|
|
relationDeptId: '', |
|
|
|
relationDeptName: '', |
|
|
|
password: '', |
|
|
|
comfirmPassword: '', |
|
|
|
realName: '', |
|
|
@ -224,6 +250,7 @@ export default { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.deptList = res.data |
|
|
|
this.relationDeptList = res.data |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
// 获取角色列表 |
|
|
@ -256,6 +283,7 @@ export default { |
|
|
|
roleIdList: [] |
|
|
|
} |
|
|
|
this.$refs.deptListTree.setCurrentKey(this.dataForm.deptId) |
|
|
|
this.$refs.relationDeptListTree.setCurrentKey(this.dataForm.relationDeptId) |
|
|
|
// 角色配置, 区分是否为默认角色 |
|
|
|
for (var i = 0; i < res.data.roleIdList.length; i++) { |
|
|
|
if (this.roleList.filter(item => item.id === res.data.roleIdList[i])[0]) { |
|
|
@ -272,6 +300,12 @@ export default { |
|
|
|
this.dataForm.deptName = data.name |
|
|
|
this.deptListVisible = false |
|
|
|
}, |
|
|
|
// 关联部门树, 选中 |
|
|
|
relationDeptListTreeCurrentChangeHandle (data, node) { |
|
|
|
this.dataForm.relationDeptId = data.id |
|
|
|
this.dataForm.relationDeptName = data.name |
|
|
|
this.relationDeptListVisible = false |
|
|
|
}, |
|
|
|
// 表单提交 |
|
|
|
dataFormSubmitHandle: debounce(function () { |
|
|
|
this.$refs['dataForm'].validate((valid) => { |
|
|
|