From 312f727e9ae0da52847e306098c7f5930cb718c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=B0=8F=E7=8E=8B=E5=AD=90?= Date: Wed, 7 Feb 2024 14:23:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=81=E6=AD=A2=E4=BF=AE=E6=94=B9=E3=80=81?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=BB=98=E8=AE=A4=E7=A7=9F=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/tenant/types.ts | 2 +- src/views/system/tenant/index.vue | 27 +++++++++++++++++++++++---- src/views/system/user/index.vue | 2 +- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/api/system/tenant/types.ts b/src/api/system/tenant/types.ts index a310aa8..7dce2b3 100644 --- a/src/api/system/tenant/types.ts +++ b/src/api/system/tenant/types.ts @@ -1,5 +1,5 @@ export interface TenantVO extends BaseEntity { - tenantId: number | string; + tenantId: number; username: string; contactUserName: string; contactPhone: string; diff --git a/src/views/system/tenant/index.vue b/src/views/system/tenant/index.vue index 185046d..543889b 100644 --- a/src/views/system/tenant/index.vue +++ b/src/views/system/tenant/index.vue @@ -62,19 +62,25 @@ @@ -272,6 +278,19 @@ const handleSelectionChange = (selection: TenantVO[]) => { ids.value = selection.map((item) => item.tenantId); single.value = selection.length != 1; multiple.value = !selection.length; + + let defaultTenantCheched = false; + for (let id of ids.value) { + if (id === 1) { + defaultTenantCheched = true; + } + } + + if (defaultTenantCheched) { + //包含超级管理员,禁用修改、删除按钮 + single.value = true; + multiple.value = true; + } }; /** 新增按钮操作 */ diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 0cff2ae..c2e7d54 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -558,7 +558,7 @@ const handleSelectionChange = (selection: UserVO[]) => { single.value = selection.length != 1; multiple.value = !selection.length; - var superAdminCheched = false; + let superAdminCheched = false; for (let id of ids.value) { if (id === 1) { superAdminCheched = true;