From 7beca3f985306eee35b39b3471f0876506f5292f Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Wed, 12 Aug 2026 20:36:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/DomesticOutboundListStates.test.ts | 3 --- src/app/router/index.test.ts | 10 ++++++---- src/app/router/index.ts | 6 ------ src/core/navigation/adminNavigation.test.ts | 22 +++++++-------------- src/core/navigation/adminNavigation.ts | 15 ++------------ 5 files changed, 15 insertions(+), 41 deletions(-) diff --git a/src/app/DomesticOutboundListStates.test.ts b/src/app/DomesticOutboundListStates.test.ts index 8710e804..cebc2df3 100644 --- a/src/app/DomesticOutboundListStates.test.ts +++ b/src/app/DomesticOutboundListStates.test.ts @@ -6,10 +6,7 @@ const pages = [ ['src/modules/container-loading/pages/ContainersView.vue', ':loading="loading"', 'LoadErrorState', 'empty-text="暂无货柜"', 'statusText(row.planStatus)', 'platform:firstleg:container:view', '@retry="loadRows"'], ['src/modules/loading-lists/components/LoadingListsView.vue', ':loading="loading"', 'LoadErrorState', ':empty-text="`暂无符合筛选条件的${title}`"', 'loadingListStatusLabel(row.status)', 'canView', '@retry="load"'], ['src/modules/ocean-bookings/pages/OceanBookingsView.vue', ':loading="loading"', 'LoadErrorState', 'empty-text="暂无符合筛选条件的订舱"', 'oceanBookingStatusLabel(row.status)', 'platform:firstleg:ocean-booking:view', '@retry="load"'], - ['src/modules/port-schedules/pages/PortSchedulesView.vue', ':loading="loading"', 'LoadErrorState', 'empty-text="暂无符合条件的船期"', "row.expired ? '已过期' : '有效'", 'platform:firstleg:port-schedule:view', '@retry="load"'], ['src/modules/trucking/pages/TruckAppointmentsView.vue', ':loading="loading"', 'LoadErrorState', 'empty-text="暂无符合筛选条件的拖车预约"', 'statusLabel(row.status)', 'platform:firstleg:truck-appointment:view', '@retry="load"'], - ['src/modules/customs/pages/CustomsCasesView.vue', ':loading="loading"', 'LoadErrorState', 'empty-text="暂无报关协同记录"', 'customsStatusLabel(row.status)', 'platform:firstleg:customs:view', '@retry="load"'], - ['src/modules/outbound-dispatch/pages/OutboundDispatchesView.vue', ':loading="loading"', 'LoadErrorState', 'empty-text="暂无符合条件的出仓记录"', 'outboundDispatchStatusLabel(row.dispatchStatus)', 'platform:firstleg:outbound-dispatch:view', '@retry="load"'], ] as const function source(path: string) { diff --git a/src/app/router/index.test.ts b/src/app/router/index.test.ts index 60ae20d2..b44cfd1a 100644 --- a/src/app/router/index.test.ts +++ b/src/app/router/index.test.ts @@ -63,11 +63,10 @@ describe('admin router access metadata', () => { expect(detailIndex).toBeGreaterThan(globalIndex) }) - it('registers phase-three service center routes with their stable permissions', () => { + it('registers the retained phase-three service center routes with stable permissions', () => { const expected = [ - ['port-schedules', '/port-schedules', 'platform:firstleg:port-schedule:list'], - ['customs-cases', '/customs', 'platform:firstleg:customs:list'], - ['outbound-dispatches', '/outbound-dispatches', 'platform:firstleg:outbound-dispatch:list'], + ['ocean-bookings', '/ocean-bookings', 'platform:firstleg:ocean-booking:list'], + ['trucking', '/trucking', 'platform:firstleg:truck-appointment:list'], ] for (const [name, path, permission] of expected) { @@ -75,6 +74,9 @@ describe('admin router access metadata', () => { expect(route?.path).toBe(path) expect(route?.meta.permission).toBe(permission) } + + expect(router.getRoutes().find((item) => item.name === 'port-schedules')).toBeUndefined() + expect(router.getRoutes().find((item) => item.name === 'outbound-dispatches')).toBeUndefined() }) it('protects counterparty records with a stable master-data permission', () => { diff --git a/src/app/router/index.ts b/src/app/router/index.ts index 44b4a7cd..5ab92102 100644 --- a/src/app/router/index.ts +++ b/src/app/router/index.ts @@ -21,9 +21,6 @@ import { warehouseRoutes } from '@/modules/warehouses/routes' import { prototypeModuleRoutes } from '@/prototype/routes' import { oceanBookingRoutes } from '@/modules/ocean-bookings/routes' import { truckingRoutes } from '@/modules/trucking/routes' -import { portScheduleRoutes } from '@/modules/port-schedules/routes' -import { customsRoutes } from '@/modules/customs/routes' -import { outboundDispatchRoutes } from '@/modules/outbound-dispatch/routes' import { feeItemRoutes } from '@/modules/fee-items/routes' import { containerLoadingRoutes } from '@/modules/container-loading/routes' import { loadingListRoutes } from '@/modules/loading-lists/routes' @@ -53,10 +50,7 @@ const router = createRouter({ ...dashboardRoutes, ...prototypeModuleRoutes, ...oceanBookingRoutes, - ...portScheduleRoutes, ...truckingRoutes, - ...customsRoutes, - ...outboundDispatchRoutes, ...containerLoadingRoutes, ...loadingListRoutes, ...financeRoutes, diff --git a/src/core/navigation/adminNavigation.test.ts b/src/core/navigation/adminNavigation.test.ts index 701e6ab2..f2c4b8f0 100644 --- a/src/core/navigation/adminNavigation.test.ts +++ b/src/core/navigation/adminNavigation.test.ts @@ -14,7 +14,6 @@ describe('adminNavigation', () => { '客户管理', '国内仓', '海外派送', - '服务中心', '供应商中心', '货柜管理', '海外业务', @@ -36,19 +35,15 @@ describe('adminNavigation', () => { '库位管理', '托盘管理', ]) - expect(adminNavigation.find((item) => item.key === 'service-center')?.children?.map((item) => item.title)).toEqual([ - '订舱列表', - '船期信息', - '拖车列表', - '报关协同', - '国内出仓', - ]) + expect(adminNavigation.find((item) => item.key === 'service-center')).toBeUndefined() expect(adminNavigation.find((item) => item.key === 'supplier-center')?.children?.map((item) => item.title)).toEqual([ '供应商列表', '快递公司', '往来单位', ]) expect(adminNavigation.find((item) => item.key === 'container-management')?.children?.map((item) => item.title)).toEqual([ + '订舱列表', + '拖车列表', '货柜列表', '智能装柜', '预装清单', @@ -103,9 +98,9 @@ describe('adminNavigation', () => { expect(paths).toContain('/container-loading/smart-loading') expect(paths).toContain('/loading-plans') expect(paths).toContain('/loading-lists') - expect(paths).toContain('/port-schedules') - expect(paths).toContain('/customs') - expect(paths).toContain('/outbound-dispatches') + expect(paths).not.toContain('/port-schedules') + expect(paths).not.toContain('/customs') + expect(paths).not.toContain('/outbound-dispatches') expect(paths).not.toContain('/prototype/container-management/container-list') expect(paths).not.toContain('/prototype/container-management/preload-list') expect(paths).not.toContain('/prototype/container-management/manifest') @@ -209,7 +204,7 @@ describe('adminNavigation', () => { ]) }) - it('shows each phase-three service center entry only with its matching permission', () => { + it('shows only the prototype-backed phase-three service center entries', () => { const filtered = filterAdminNavigation(adminNavigation, new Set([ 'platform:firstleg:ocean-booking:list', 'platform:firstleg:port-schedule:list', @@ -221,10 +216,7 @@ describe('adminNavigation', () => { expect(getNavigationLeaves(filtered).map((item) => item.path)).toEqual([ '/dashboard', '/ocean-bookings', - '/port-schedules', '/trucking', - '/customs', - '/outbound-dispatches', ]) }) diff --git a/src/core/navigation/adminNavigation.ts b/src/core/navigation/adminNavigation.ts index 47486e3f..b95abccd 100644 --- a/src/core/navigation/adminNavigation.ts +++ b/src/core/navigation/adminNavigation.ts @@ -26,7 +26,6 @@ import { PrototypeOverseasBusinessIcon, PrototypeOverseasWarehouseIcon, PrototypeSalesIcon, - PrototypeServiceIcon, PrototypeSupplierIcon, PrototypeSystemIcon, } from './prototypeMenuIcons' @@ -85,18 +84,6 @@ export const adminNavigation: AdminNavigationNode[] = [ { key: 'outbound-selfpick', title: '自提单', icon: ClipboardList, path: '/prototype/overseas-delivery/self-pickup' }, ], }, - { - key: 'service-center', - title: '服务中心', - icon: PrototypeServiceIcon, - children: [ - { key: 'booking-list', title: '订舱列表', icon: ClipboardList, path: '/ocean-bookings', permission: 'platform:firstleg:ocean-booking:list' }, - { key: 'port-schedules', title: '船期信息', icon: ClipboardList, path: '/port-schedules', permission: 'platform:firstleg:port-schedule:list' }, - { key: 'truck-list', title: '拖车列表', icon: Truck, path: '/trucking', permission: 'platform:firstleg:truck-appointment:list' }, - { key: 'customs-cases', title: '报关协同', icon: FileCheck2, path: '/customs', permission: 'platform:firstleg:customs:list' }, - { key: 'outbound-dispatches', title: '国内出仓', icon: Truck, path: '/outbound-dispatches', permission: 'platform:firstleg:outbound-dispatch:list' }, - ], - }, { key: 'supplier-center', title: '供应商中心', @@ -112,6 +99,8 @@ export const adminNavigation: AdminNavigationNode[] = [ title: '货柜管理', icon: PrototypeContainerIcon, children: [ + { key: 'booking-list', title: '订舱列表', icon: ClipboardList, path: '/ocean-bookings', permission: 'platform:firstleg:ocean-booking:list' }, + { key: 'truck-list', title: '拖车列表', icon: Truck, path: '/trucking', permission: 'platform:firstleg:truck-appointment:list' }, { key: 'container-list', title: '货柜列表', icon: WarehouseIcon, path: '/container-loading', permission: 'platform:firstleg:container:list' }, { key: 'container-smart-loading', title: '智能装柜', icon: ClipboardList, path: '/container-loading/smart-loading', permission: 'platform:firstleg:smart-loading:list' }, { key: 'container-preload', title: '预装清单', icon: ClipboardList, path: '/loading-plans', permission: 'platform:firstleg:preload:list' },