From a6097bfc05b7fc5a5f23cabacec262b4ef2e48f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Mon, 11 Aug 2025 15:07:49 +0800 Subject: [PATCH] =?UTF-8?q?refactor(shopAdmin):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 SuperAdmin 和 Admin 组件 - 优化管理员列表展示逻辑 - 添加超级管理员单独展示区域 -调整新建按钮文字为"添加" - 移除不必要的注释代码 --- src/api/system/user/model/index.ts | 1 + src/views/shop/shopAdmin/components/admin.vue | 382 ++---------------- .../shop/shopAdmin/components/super-admin.vue | 41 ++ src/views/shop/shopAdmin/index.vue | 18 +- .../shopCoupon/components/shopCouponEdit.vue | 3 - 5 files changed, 75 insertions(+), 370 deletions(-) create mode 100644 src/views/shop/shopAdmin/components/super-admin.vue diff --git a/src/api/system/user/model/index.ts b/src/api/system/user/model/index.ts index e7a09a6..8323dc1 100644 --- a/src/api/system/user/model/index.ts +++ b/src/api/system/user/model/index.ts @@ -152,6 +152,7 @@ export interface UserParam extends PageParam { sexName?: string; roleId?: string; isAdmin?: number; + isSuperAdmin?: boolean; showProfile?: boolean; isStaff?: boolean; templateId?: number; diff --git a/src/views/shop/shopAdmin/components/admin.vue b/src/views/shop/shopAdmin/components/admin.vue index 2ec8ef1..add1bba 100644 --- a/src/views/shop/shopAdmin/components/admin.vue +++ b/src/views/shop/shopAdmin/components/admin.vue @@ -1,368 +1,42 @@ - - - - - - - - - - - - - {{ record.nickname }} - - - {{ record.phone }} - {{ record.mobile }} - - - - {{ item.roleName }} - - - - - - - - - - ¥{{ formatNumber(record.balance) }} - - - - - ¥{{ formatNumber(record.expendMoney) }} - - - - 是 - 否 - - - - - - - - 修改 - - - - - 删除 - - - + + + + 编辑 + 添加 + - + + + + + {{ item.nickname }} + {{ item.createTime }} + + + + diff --git a/src/views/shop/shopAdmin/components/super-admin.vue b/src/views/shop/shopAdmin/components/super-admin.vue new file mode 100644 index 0000000..b856ea7 --- /dev/null +++ b/src/views/shop/shopAdmin/components/super-admin.vue @@ -0,0 +1,41 @@ + + + + 系统所有者,拥有全部权限 + + + + + + {{ item.nickname }} + {{ item.createTime }} + + + 更换 + + + + + diff --git a/src/views/shop/shopAdmin/index.vue b/src/views/shop/shopAdmin/index.vue index bb9f204..37fa459 100644 --- a/src/views/shop/shopAdmin/index.vue +++ b/src/views/shop/shopAdmin/index.vue @@ -1,16 +1,6 @@ $router.go(-1)"> - - - - - - - - - - - + - 新建 + 添加 { const query = async () => { const info = await listRoles({}) - if(info){ + if (info) { roles.value = info } } diff --git a/src/views/shop/shopCoupon/components/shopCouponEdit.vue b/src/views/shop/shopCoupon/components/shopCouponEdit.vue index 661ae56..1315a2b 100644 --- a/src/views/shop/shopCoupon/components/shopCouponEdit.vue +++ b/src/views/shop/shopCoupon/components/shopCouponEdit.vue @@ -308,10 +308,7 @@ const form = reactive({ sortNumber: 100, status: 0, // 默认显示 deleted: 0, - userId: undefined, tenantId: undefined, - createTime: undefined, - updateTime: undefined, totalCount: -1, // 默认无限制 issuedCount: 0, limitPerUser: -1, // 默认无限制