This commit is contained in:
=
2026-05-16 17:20:17 +08:00
parent a1f8502a5f
commit 3e520a68b8
7 changed files with 151 additions and 22 deletions
@@ -36,15 +36,17 @@ const UNIT_LEADER_MANAGE_TEMPLATE = {
<el-dialog title="添加" :visible.sync="dialogFormVisible" width="600px" :close-on-click-modal="false">
<el-form :model="formData" ref="form" size="small" label-width="60px">
<el-form-item prop="roleCode" label="角色">
<dict-select placeholder="请选择角色" v-model="formData.roleCode" code="UNIT_ROLES"></dict-select>
<!-- <dict-select placeholder="请选择角色" v-model="formData.roleCode" code="UNIT_ROLES"></dict-select> -->
<dict-select placeholder="请选择角色" v-model="formData.roleCode" code="UNIT_ROLES" @change="onRoleChange"></dict-select>
</el-form-item>
<el-form-item prop="userId" label="人员">
<!-- 原人员查询范围只传当前单位::api_params="{ unitId: currentData?.id }" -->
<user-select
placeholder="请选择人员"
style="width: 100%"
v-model="formData.userId"
api="/platform/sys/unit/listUserSelect"
:api_params="{ unitId: currentData?.id }"
:api_params="{ unitId: currentData?.id, roleCode: formData.roleCode }"
:option_label_func="
(item) => {
return item.username + item.loginname + '(' + item.unitName + ')'
@@ -86,6 +88,10 @@ const UNIT_LEADER_MANAGE_TEMPLATE = {
},
computed: {},
methods: {
onRoleChange() {
// 切换角色后人员查询范围可能变化,清空已选人员避免保存到旧范围里的人员。
this.$set(this.formData, "userId", "")
},
doDelete({ userId, roleCode }) {
this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",