diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index aa2315b5..2a76d838 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -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(() => { // 初始字典数据 Promise.allSettled([ @@ -1355,6 +1365,7 @@ onMounted(() => { :options="modalState.options.posts" :field-names="{ label: 'postName', value: 'postId' }" :placeholder="t('common.selectPlease')" + @select="(value:any) => fnSelectOne(value, 'postId')" > @@ -1441,6 +1452,7 @@ onMounted(() => { :options="modalState.options.roles" :field-names="{ label: 'roleName', value: 'roleId' }" :placeholder="t('common.selectPlease')" + @select="(value:any) => fnSelectOne(value, 'roleId')" >