From bc0e46319119c4d42a8540f26b6cb66c01c74d66 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Mon, 8 Jul 2024 11:25:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=A8=E6=88=B7=E5=B2=97=E4=BD=8D?= =?UTF-8?q?=E5=92=8C=E8=A7=92=E8=89=B2=E6=8C=87=E5=AE=9A=E5=8F=AA=E8=83=BD?= =?UTF-8?q?=E9=80=89=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/user/index.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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')" >