From c1902f978a2b011edabbf2090d0a0b554fb33346 Mon Sep 17 00:00:00 2001 From: lai <371757574@qq.com> Date: Fri, 5 Jul 2024 15:39:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E6=8B=A9=E8=A7=92=E8=89=B2=E4=B8=BAte?= =?UTF-8?q?nant=E6=89=8D=E6=98=BE=E7=A4=BA=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/user/index.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 6d360e36..d6abf927 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -18,7 +18,7 @@ import { updateUser, addUser, } from '@/api/system/user'; -import { listDept } from '@/api/system/tenant'; +import { listTenant } from '@/api/system/tenant'; import { saveAs } from 'file-saver'; import useI18n from '@/hooks/useI18n'; @@ -238,6 +238,8 @@ type ModalStateType = { visibleByResetPwd: boolean; /**标题 */ title: string; + /**是否展示tenant框 */ + showTenant: boolean; /**表单数据 */ from: Record; /**确定按钮 loading */ @@ -252,6 +254,7 @@ let modalState: ModalStateType = reactive({ visibleByEdit: false, visibleByResetPwd: false, title: '用户', + showTenant: false, from: { userId: undefined, userName: '', @@ -673,6 +676,12 @@ let uploadImportState: ModalUploadImportStateType = reactive({ templateDownload: false, }); +function showTenant(value: any, option: any) { + modalState.showTenant = option.some( + (option: any) => option.roleKey === 'tenant' + ); +} + /**对话框表格信息导入弹出窗口 */ function fnModalUploadImportOpen() { uploadImportState.updateSupport = false; @@ -770,7 +779,7 @@ let deptTreeData = ref([]); /**查询部门下拉树结构 */ function fnGetDeptTree() { if (deptTreeData.value.length > 0) return; - listDept({ parentId: 0 }).then(res => { + listTenant({ parentId: 0 }).then(res => { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { res.data.forEach((item: any) => { if (item.parentId === '0') { @@ -1462,6 +1471,7 @@ onMounted(() => { :options="modalState.options.roles" :field-names="{ label: 'roleName', value: 'roleId' }" :placeholder="t('common.selectPlease')" + @change="showTenant" > @@ -1470,6 +1480,7 @@ onMounted(() => { :label="t('views.system.user.fromTenant')" name="tenantId" :label-col="{ span: 3 }" + v-show="modalState.showTenant" >