fix: 用户岗位和角色指定只能选一个
This commit is contained in:
@@ -767,6 +767,16 @@ function fnGetDeptTree() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**选择指定只能一个 */
|
||||||
|
function fnSelectOne(v: string, type: string) {
|
||||||
|
if (type === 'postId') {
|
||||||
|
modalState.from.postIds = [v];
|
||||||
|
}
|
||||||
|
if (type === 'roleId') {
|
||||||
|
modalState.from.roleIds = [v];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 初始字典数据
|
// 初始字典数据
|
||||||
Promise.allSettled([
|
Promise.allSettled([
|
||||||
@@ -1355,6 +1365,7 @@ onMounted(() => {
|
|||||||
:options="modalState.options.posts"
|
:options="modalState.options.posts"
|
||||||
:field-names="{ label: 'postName', value: 'postId' }"
|
:field-names="{ label: 'postName', value: 'postId' }"
|
||||||
:placeholder="t('common.selectPlease')"
|
:placeholder="t('common.selectPlease')"
|
||||||
|
@select="(value:any) => fnSelectOne(value, 'postId')"
|
||||||
>
|
>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -1441,6 +1452,7 @@ onMounted(() => {
|
|||||||
:options="modalState.options.roles"
|
:options="modalState.options.roles"
|
||||||
:field-names="{ label: 'roleName', value: 'roleId' }"
|
:field-names="{ label: 'roleName', value: 'roleId' }"
|
||||||
:placeholder="t('common.selectPlease')"
|
:placeholder="t('common.selectPlease')"
|
||||||
|
@select="(value:any) => fnSelectOne(value, 'roleId')"
|
||||||
>
|
>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|||||||
Reference in New Issue
Block a user