From db9c4da279cb84c8e8b9c0b2ed692c557449aae3 Mon Sep 17 00:00:00 2001 From: huangzhenbao <17818024429@163.com> Date: Wed, 11 Feb 2026 20:16:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layouts/admin/components/AdminSubsider.uvue | 16 +- layouts/admin/router/adminComponentMap.uts | 1 + layouts/admin/router/adminRoutes.uts | 211 ++-------------- layouts/admin/router/settingSubSiderMenu.uts | 2 +- pages.json | 49 ++++ pages/mall/admin/setting/auth/admin.uvue | 172 ++++++++++++- pages/mall/admin/setting/auth/permission.uvue | 183 +++++++++++++- pages/mall/admin/setting/auth/role.uvue | 169 ++++++++++++- pages/mall/admin/setting/delivery/staff.uvue | 157 +++++++++++- .../mall/admin/setting/delivery/station.uvue | 225 +++++++++++++++++- .../mall/admin/setting/delivery/template.uvue | 182 +++++++++++++- .../mall/admin/setting/delivery/verifier.uvue | 207 ++++++++++++++++ 12 files changed, 1326 insertions(+), 248 deletions(-) create mode 100644 pages/mall/admin/setting/delivery/verifier.uvue diff --git a/layouts/admin/components/AdminSubsider.uvue b/layouts/admin/components/AdminSubsider.uvue index 968671b4..e447e3a3 100644 --- a/layouts/admin/components/AdminSubsider.uvue +++ b/layouts/admin/components/AdminSubsider.uvue @@ -92,8 +92,20 @@ function isActive(node: MenuNode): boolean { // 只有非分组项才能被视为“激活”变色 (1:1 复刻 screenshot 效果) if (node.type === 'group') return false - if (props.activeId != '' && node.id === props.activeId) return true - if (props.currentPath != '' && node.path === props.currentPath) return true + // 核心逻辑:优先匹配 ID,ID 是唯一的 + // 如果当前选中的 ID 就是这个节点的 ID,那它肯定是激活的 + if (props.activeId != '' && node.id === props.activeId) { + return true + } + + // 如果 ID 没匹配上,但路径匹配上了,且当前没有 activeId (例如首次进入或刷新) + // 或者当前 ID 对应的路径跟这个路径一样 + // 但为了防止 Path 相同导致多选,我们加一个额外判断: + // 如果 activeId 已经指向了一个有效的路由,我们通常不再通过 Path 来高亮其他项 + if (props.activeId === '' && props.currentPath != '' && node.path === props.currentPath) { + return true + } + return false } diff --git a/layouts/admin/router/adminComponentMap.uts b/layouts/admin/router/adminComponentMap.uts index a5797d06..f5eca71c 100644 --- a/layouts/admin/router/adminComponentMap.uts +++ b/layouts/admin/router/adminComponentMap.uts @@ -133,6 +133,7 @@ export const componentMap: Map = new Map([ ['SettingAuthPermission', defineAsyncComponent(() => import('@/pages/mall/admin/setting/auth/permission.uvue'))], ['SettingDeliveryStaff', defineAsyncComponent(() => import('@/pages/mall/admin/setting/delivery/staff.uvue'))], ['SettingDeliveryStation', defineAsyncComponent(() => import('@/pages/mall/admin/setting/delivery/station.uvue'))], + ['SettingDeliveryVerifier', defineAsyncComponent(() => import('@/pages/mall/admin/setting/delivery/verifier.uvue'))], ['SettingDeliveryTemplate', defineAsyncComponent(() => import('@/pages/mall/admin/setting/delivery/template.uvue'))], ['SettingInterfaceOnepassConfig', defineAsyncComponent(() => import('@/pages/mall/admin/setting/interface/onepass/config.uvue'))], ['SettingInterfaceOnepassIndex', defineAsyncComponent(() => import('@/pages/mall/admin/setting/interface/onepass/index.uvue'))], diff --git a/layouts/admin/router/adminRoutes.uts b/layouts/admin/router/adminRoutes.uts index a4cdd426..a2c9ece4 100644 --- a/layouts/admin/router/adminRoutes.uts +++ b/layouts/admin/router/adminRoutes.uts @@ -894,180 +894,6 @@ export const routes: RouteRecord[] = [ order: 1 }, - // ========== 设置模块 ========== - // 1. 系统设置 - { - id: 'setting_systemConfig', - title: '系统设置', - path: '/pages/mall/admin/setting/system/config', - componentKey: 'SettingSystemConfig', - parentId: 'setting', - groupId: 'setting-system', - auth: ['admin-setting-system-config'], - order: 1 - }, - - // 2. 通知管理 - { - id: 'setting_message', - title: '消息管理', - path: '/pages/mall/admin/setting/message', - componentKey: 'SettingMessage', - parentId: 'setting', - groupId: 'setting-message', - order: 1 - }, - { - id: 'setting_agreement', - title: '协议管理', - path: '/pages/mall/admin/setting/agreement', - componentKey: 'SettingAgreement', - parentId: 'setting', - groupId: 'setting-message', - order: 2 - }, - { - id: 'setting_ticket', - title: '客服设置', - path: '/pages/mall/admin/setting/ticket', - componentKey: 'SettingTicket', - parentId: 'setting', - groupId: 'setting-message', - order: 3 - }, - - // 3. 权限管理 - { - id: 'setting_auth_role', - title: '角色管理', - path: '/pages/mall/admin/setting/auth/role', - componentKey: 'SettingAuthRole', - parentId: 'setting', - groupId: 'setting-auth', - order: 1 - }, - { - id: 'setting_auth_admin', - title: '管理员管理', - path: '/pages/mall/admin/setting/auth/admin', - componentKey: 'SettingAuthAdmin', - parentId: 'setting', - groupId: 'setting-auth', - order: 2 - }, - { - id: 'setting_auth_permission', - title: '权限管理', - path: '/pages/mall/admin/setting/auth/permission', - componentKey: 'SettingAuthPermission', - parentId: 'setting', - groupId: 'setting-auth', - order: 3 - }, - - // 4. 物流设置 - { - id: 'setting_delivery_staff', - title: '配送员管理', - path: '/pages/mall/admin/setting/delivery/staff', - componentKey: 'SettingDeliveryStaff', - parentId: 'setting', - groupId: 'setting-delivery', - order: 1 - }, - { - id: 'setting_delivery_station', - title: '提货点管理', - path: '/pages/mall/admin/setting/delivery/station', - componentKey: 'SettingDeliveryStation', - parentId: 'setting', - groupId: 'setting-delivery', - order: 2 - }, - { - id: 'setting_delivery_template', - title: '运费模板', - path: '/pages/mall/admin/setting/delivery/template', - componentKey: 'SettingDeliveryTemplate', - parentId: 'setting', - groupId: 'setting-delivery', - order: 3 - }, - - // 5. 接口设置 - { - id: 'setting_interface_onepass_config', - title: '总平台配置', - path: '/pages/mall/admin/setting/interface/onepass/config', - componentKey: 'SettingInterfaceOnepassConfig', - parentId: 'setting', - groupId: 'setting-interface', - order: 1 - }, - { - id: 'setting_interface_onepass_index', - title: '账号列表', - path: '/pages/mall/admin/setting/interface/onepass/index', - componentKey: 'SettingInterfaceOnepassIndex', - parentId: 'setting', - groupId: 'setting-interface', - order: 2 - }, - { - id: 'setting_interface_storage', - title: '存储配置', - path: '/pages/mall/admin/setting/interface/storage', - componentKey: 'SettingInterfaceStorage', - parentId: 'setting', - groupId: 'setting-interface', - order: 3 - }, - { - id: 'setting_interface_collect', - title: '商品采集', - path: '/pages/mall/admin/setting/interface/collect', - componentKey: 'SettingInterfaceCollect', - parentId: 'setting', - groupId: 'setting-interface', - order: 4 - }, - { - id: 'setting_interface_logistics', - title: '物流查询', - path: '/pages/mall/admin/setting/interface/logistics', - componentKey: 'SettingInterfaceLogistics', - parentId: 'setting', - groupId: 'setting-interface', - order: 5 - }, - { - id: 'setting_interface_esheet', - title: '电子面单', - path: '/pages/mall/admin/setting/interface/e-sheet', - componentKey: 'SettingInterfaceESheet', - parentId: 'setting', - groupId: 'setting-interface', - order: 6 - }, - { - id: 'setting_interface_sms', - title: '短信接口', - path: '/pages/mall/admin/setting/interface/sms', - componentKey: 'SettingInterfaceSms', - parentId: 'setting', - groupId: 'setting-interface', - order: 7 - }, - { - id: 'setting_interface_payment', - title: '商城支付', - path: '/pages/mall/admin/setting/interface/payment', - componentKey: 'SettingInterfacePayment', - parentId: 'setting', - groupId: 'setting-interface', - order: 8 - }, - // ========== 分销模块 ========== { id: 'distribution_statistic', @@ -1246,31 +1072,34 @@ export const routes: RouteRecord[] = [ }, // ========== 设置模块 (1:1 复刻 CRMEB 路由结构) ========== - // 通知管理 + // 1. 系统设置 + { id: 'setting_system_config', title: '系统配置', path: '/pages/mall/admin/setting/system/config', componentKey: 'SettingSystemConfig', parentId: 'setting', groupId: 'setting-system', order: 1 }, + + // 2. 通知管理 { id: 'setting_message_index', title: '消息管理', path: '/pages/mall/admin/setting/message', componentKey: 'SettingMessageIndex', parentId: 'setting', groupId: 'setting-message', order: 1 }, { id: 'setting_protocol_index', title: '协议设置', path: '/pages/mall/admin/setting/agreement', componentKey: 'SettingProtocolIndex', parentId: 'setting', groupId: 'setting-message', order: 2 }, { id: 'setting_ticket_index', title: '小票配置', path: '/pages/mall/admin/setting/ticket', componentKey: 'SettingTicketIndex', parentId: 'setting', groupId: 'setting-message', order: 3 }, - // 权限管理 + // 3. 权限管理 { id: 'setting_auth_admin', title: '管理员管理', path: '/pages/mall/admin/setting/auth/admin', componentKey: 'SettingAuthAdmin', parentId: 'setting', groupId: 'setting-auth', order: 1 }, { id: 'setting_auth_role', title: '角色管理', path: '/pages/mall/admin/setting/auth/role', componentKey: 'SettingAuthRole', parentId: 'setting', groupId: 'setting-auth', order: 2 }, - { id: 'setting_auth_menu', title: '菜单管理', path: '/pages/mall/admin/setting/auth/permission', componentKey: 'SettingAuthMenu', parentId: 'setting', groupId: 'setting-auth', order: 3 }, + { id: 'setting_auth_menu', title: '菜单管理', path: '/pages/mall/admin/setting/auth/permission', componentKey: 'SettingAuthPermission', parentId: 'setting', groupId: 'setting-auth', order: 3 }, - // 物流设置 - { id: 'setting_delivery_courier', title: '配送员管理', path: '/pages/mall/admin/setting/delivery/staff', componentKey: 'SettingDeliveryCourier', parentId: 'setting', groupId: 'setting-delivery', order: 1 }, - { id: 'setting_delivery_pickup_list', title: '提货点', path: '/pages/mall/admin/setting/delivery/station', componentKey: 'SettingDeliveryPickupList', parentId: 'setting', groupId: 'setting-delivery', order: 2 }, - { id: 'setting_delivery_verifier', title: '核销员', path: '/pages/mall/admin/setting/delivery/station', componentKey: 'SettingDeliveryVerifier', parentId: 'setting', groupId: 'setting-delivery', order: 3 }, - { id: 'setting_delivery_freight', title: '运费模板', path: '/pages/mall/admin/setting/delivery/template', componentKey: 'SettingDeliveryFreight', parentId: 'setting', groupId: 'setting-delivery', order: 4 }, + // 4. 物流设置 + { id: 'setting_delivery_courier', title: '配送员管理', path: '/pages/mall/admin/setting/delivery/staff', componentKey: 'SettingDeliveryStaff', parentId: 'setting', groupId: 'setting-delivery', order: 1 }, + { id: 'setting_delivery_pickup_list', title: '提货点', path: '/pages/mall/admin/setting/delivery/station', componentKey: 'SettingDeliveryStation', parentId: 'setting', groupId: 'setting-delivery', order: 2 }, + { id: 'setting_delivery_verifier', title: '核销员', path: '/pages/mall/admin/setting/delivery/verifier', componentKey: 'SettingDeliveryVerifier', parentId: 'setting', groupId: 'setting-delivery', order: 3 }, + { id: 'setting_delivery_freight', title: '运费模板', path: '/pages/mall/admin/setting/delivery/template', componentKey: 'SettingDeliveryTemplate', parentId: 'setting', groupId: 'setting-delivery', order: 4 }, - // 接口设置 - { id: 'setting_api_yht_page', title: '一号通页面', path: '/pages/mall/admin/setting/interface/onepass/index', componentKey: 'SettingApiYhtPage', parentId: 'setting', groupId: 'setting-interface', order: 1 }, - { id: 'setting_api_yht_config', title: '一号通配置', path: '/pages/mall/admin/setting/interface/onepass/config', componentKey: 'SettingApiYhtConfig', parentId: 'setting', groupId: 'setting-interface', order: 2 }, - { id: 'setting_api_storage', title: '系统存储配置', path: '/pages/mall/admin/setting/interface/storage', componentKey: 'SettingApiStorage', parentId: 'setting', groupId: 'setting-interface', order: 3 }, - { id: 'setting_api_collect', title: '商品采集配置', path: '/pages/mall/admin/setting/interface/collect', componentKey: 'SettingApiCollect', parentId: 'setting', groupId: 'setting-interface', order: 4 }, - { id: 'setting_api_logistics', title: '物流查询配置', path: '/pages/mall/admin/setting/interface/logistics', componentKey: 'SettingApiLogistics', parentId: 'setting', groupId: 'setting-interface', order: 5 }, - { id: 'setting_api_waybill', title: '电子面单配置', path: '/pages/mall/admin/setting/interface/e-sheet', componentKey: 'SettingApiWaybill', parentId: 'setting', groupId: 'setting-interface', order: 6 }, - { id: 'setting_api_sms', title: '短信接口配置', path: '/pages/mall/admin/setting/interface/sms', componentKey: 'SettingApiSms', parentId: 'setting', groupId: 'setting-interface', order: 7 }, - { id: 'setting_api_pay', title: '商城支付配置', path: '/pages/mall/admin/setting/interface/payment', componentKey: 'SettingApiPay', parentId: 'setting', groupId: 'setting-interface', order: 8 }, + // 5. 接口设置 + { id: 'setting_api_yht_page', title: '一号通页面', path: '/pages/mall/admin/setting/interface/onepass/index', componentKey: 'SettingInterfaceOnepassIndex', parentId: 'setting', groupId: 'setting-interface', order: 1 }, + { id: 'setting_api_yht_config', title: '一号通配置', path: '/pages/mall/admin/setting/interface/onepass/config', componentKey: 'SettingInterfaceOnepassConfig', parentId: 'setting', groupId: 'setting-interface', order: 2 }, + { id: 'setting_api_storage', title: '系统存储配置', path: '/pages/mall/admin/setting/interface/storage', componentKey: 'SettingInterfaceStorage', parentId: 'setting', groupId: 'setting-interface', order: 3 }, + { id: 'setting_api_collect', title: '商品采集配置', path: '/pages/mall/admin/setting/interface/collect', componentKey: 'SettingInterfaceCollect', parentId: 'setting', groupId: 'setting-interface', order: 4 }, + { id: 'setting_api_logistics', title: '物流查询配置', path: '/pages/mall/admin/setting/interface/logistics', componentKey: 'SettingInterfaceLogistics', parentId: 'setting', groupId: 'setting-interface', order: 5 }, + { id: 'setting_api_waybill', title: '电子面单配置', path: '/pages/mall/admin/setting/interface/e-sheet', componentKey: 'SettingInterfaceESheet', parentId: 'setting', groupId: 'setting-interface', order: 6 }, + { id: 'setting_api_sms', title: '短信接口配置', path: '/pages/mall/admin/setting/interface/sms', componentKey: 'SettingInterfaceSms', parentId: 'setting', groupId: 'setting-interface', order: 7 }, + { id: 'setting_api_pay', title: '商城支付配置', path: '/pages/mall/admin/setting/interface/payment', componentKey: 'SettingInterfacePayment', parentId: 'setting', groupId: 'setting-interface', order: 8 }, // ========== 应用模块 ========== { diff --git a/layouts/admin/router/settingSubSiderMenu.uts b/layouts/admin/router/settingSubSiderMenu.uts index b26a8313..0f298de4 100644 --- a/layouts/admin/router/settingSubSiderMenu.uts +++ b/layouts/admin/router/settingSubSiderMenu.uts @@ -20,7 +20,7 @@ export const settingSubSiderMenu: MenuNode[] = [ { id: 'setting_delivery_courier', title: '配送员管理', type: 'page', path: '/pages/mall/admin/setting/delivery/staff' }, { id: 'pickup_order_group', title: '提货点设置', type: 'group', children: [ { id: 'setting_delivery_pickup_list', title: '提货点', type: 'page', path: '/pages/mall/admin/setting/delivery/station' }, - { id: 'setting_delivery_verifier', title: '核销员', type: 'page', path: '/pages/mall/admin/setting/delivery/station' }, + { id: 'setting_delivery_verifier', title: '核销员', type: 'page', path: '/pages/mall/admin/setting/delivery/verifier' }, { id: 'setting_delivery_freight', title: '运费模板', type: 'page', path: '/pages/mall/admin/setting/delivery/template' } ]} ] diff --git a/pages.json b/pages.json index be86e519..b91da982 100644 --- a/pages.json +++ b/pages.json @@ -654,6 +654,55 @@ "navigationBarTitleText": "小票配置", "navigationStyle": "custom" } + }, + { + "path": "setting/auth/admin", + "style": { + "navigationBarTitleText": "管理员管理", + "navigationStyle": "custom" + } + }, + { + "path": "setting/auth/role", + "style": { + "navigationBarTitleText": "角色管理", + "navigationStyle": "custom" + } + }, + { + "path": "setting/auth/permission", + "style": { + "navigationBarTitleText": "权限规则", + "navigationStyle": "custom" + } + }, + { + "path": "setting/delivery/staff", + "style": { + "navigationBarTitleText": "配送员管理", + "navigationStyle": "custom" + } + }, + { + "path": "setting/delivery/station", + "style": { + "navigationBarTitleText": "提货点", + "navigationStyle": "custom" + } + }, + { + "path": "setting/delivery/verifier", + "style": { + "navigationBarTitleText": "核销员", + "navigationStyle": "custom" + } + }, + { + "path": "setting/delivery/template", + "style": { + "navigationBarTitleText": "运费模板", + "navigationStyle": "custom" + } } ] }, diff --git a/pages/mall/admin/setting/auth/admin.uvue b/pages/mall/admin/setting/auth/admin.uvue index a3fe4068..893a3025 100644 --- a/pages/mall/admin/setting/auth/admin.uvue +++ b/pages/mall/admin/setting/auth/admin.uvue @@ -1,23 +1,177 @@ diff --git a/pages/mall/admin/setting/auth/permission.uvue b/pages/mall/admin/setting/auth/permission.uvue index cb9c5c56..3403bab8 100644 --- a/pages/mall/admin/setting/auth/permission.uvue +++ b/pages/mall/admin/setting/auth/permission.uvue @@ -1,23 +1,188 @@ diff --git a/pages/mall/admin/setting/auth/role.uvue b/pages/mall/admin/setting/auth/role.uvue index 9ebc8c82..ef9abf5c 100644 --- a/pages/mall/admin/setting/auth/role.uvue +++ b/pages/mall/admin/setting/auth/role.uvue @@ -1,23 +1,174 @@ diff --git a/pages/mall/admin/setting/delivery/staff.uvue b/pages/mall/admin/setting/delivery/staff.uvue index a0dc1ded..906f93c5 100644 --- a/pages/mall/admin/setting/delivery/staff.uvue +++ b/pages/mall/admin/setting/delivery/staff.uvue @@ -1,23 +1,162 @@ diff --git a/pages/mall/admin/setting/delivery/station.uvue b/pages/mall/admin/setting/delivery/station.uvue index cb848d40..eb412d80 100644 --- a/pages/mall/admin/setting/delivery/station.uvue +++ b/pages/mall/admin/setting/delivery/station.uvue @@ -1,23 +1,230 @@ diff --git a/pages/mall/admin/setting/delivery/template.uvue b/pages/mall/admin/setting/delivery/template.uvue index 55733264..f3d8952b 100644 --- a/pages/mall/admin/setting/delivery/template.uvue +++ b/pages/mall/admin/setting/delivery/template.uvue @@ -1,23 +1,187 @@ diff --git a/pages/mall/admin/setting/delivery/verifier.uvue b/pages/mall/admin/setting/delivery/verifier.uvue new file mode 100644 index 00000000..a9d5d4c1 --- /dev/null +++ b/pages/mall/admin/setting/delivery/verifier.uvue @@ -0,0 +1,207 @@ + + + + +