From 4edc2c1907978210e5503ec3103a730b10a2c00b Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Mon, 3 Aug 2026 11:44:50 +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/components/ClientSidebarMenuNode.vue | 7 +- src/layouts/AppLayout.test.mjs | 18 +- src/layouts/AppLayout.vue | 16 +- src/navigation/clientNavigation.test.mjs | 158 +++++++++++------- src/navigation/clientNavigation.ts | 64 ++++++- src/router/index.ts | 13 ++ src/styles/index.css | 11 +- src/styles/navigationStyles.test.mjs | 32 ++-- src/styles/shell.css | 45 +++-- .../cross-border/DomesticTruckingView.vue | 5 + src/views/cross-border/PalletShippingView.vue | 5 + src/views/cross-border/ProcurementView.vue | 5 + src/views/finance/PayableBillsView.vue | 5 + src/views/first-leg/BatchImportView.vue | 5 + src/views/first-leg/QuickOrderView.vue | 5 + .../order-management/DeliveryOrdersView.vue | 5 + .../order-management/InboundOrdersView.vue | 5 + src/views/order-management/MyOrdersView.vue | 5 + src/views/overseas-warehouse/LabelingView.vue | 5 + .../overseas-warehouse/ReturnInboundView.vue | 5 + .../overseas-warehouse/ReturnOutboundView.vue | 5 + .../overseas-warehouse/ReturnRelabelView.vue | 5 + src/views/prototype/PrototypeFeatureView.vue | 28 ++++ 23 files changed, 339 insertions(+), 118 deletions(-) create mode 100644 src/views/cross-border/DomesticTruckingView.vue create mode 100644 src/views/cross-border/PalletShippingView.vue create mode 100644 src/views/cross-border/ProcurementView.vue create mode 100644 src/views/finance/PayableBillsView.vue create mode 100644 src/views/first-leg/BatchImportView.vue create mode 100644 src/views/first-leg/QuickOrderView.vue create mode 100644 src/views/order-management/DeliveryOrdersView.vue create mode 100644 src/views/order-management/InboundOrdersView.vue create mode 100644 src/views/order-management/MyOrdersView.vue create mode 100644 src/views/overseas-warehouse/LabelingView.vue create mode 100644 src/views/overseas-warehouse/ReturnInboundView.vue create mode 100644 src/views/overseas-warehouse/ReturnOutboundView.vue create mode 100644 src/views/overseas-warehouse/ReturnRelabelView.vue create mode 100644 src/views/prototype/PrototypeFeatureView.vue diff --git a/src/components/ClientSidebarMenuNode.vue b/src/components/ClientSidebarMenuNode.vue index c75272c..08f2338 100644 --- a/src/components/ClientSidebarMenuNode.vue +++ b/src/components/ClientSidebarMenuNode.vue @@ -22,7 +22,10 @@ const groupId = computed(() => `client-nav-group-${props.node.key}`)
  • -
  • +
  • /) assert.doesNotMatch(layoutSource, /]*aria-label=/) assert.match(layoutSource, / -
    { +test('keeps the confirmed top-level sequence from the client workbench prototype', () => { assert.deepEqual( clientNavigation.filter((node) => node.path).map(({ title, path, permission }) => ({ title, @@ -50,101 +45,119 @@ test('keeps the confirmed navigation groups and leaf order', () => { assert.deepEqual( clientNavigation.map((node) => ({ title: node.title, - children: node.children?.map(({ title, path, permission }) => ({ - title, - path, - permission, - })), + children: node.children?.map(({ title }) => title), })), [ { title: '业务总览', children: undefined }, - { title: '我的信息', children: undefined }, { - title: '头程业务', - children: [ - { - title: '头程订单', - path: '/orders/first-leg', - permission: 'order:first-leg:list', - }, - ], + title: '头程物流', + children: ['头程下单', '一键导入', '快速下单'], + }, + { + title: '出海下单', + children: ['海外采购', '美国本土卡', '美本土散板'], + }, + { + title: '海外仓', + children: ['贴标申请', '退货入库', '退货换标', '退货出库'], + }, + { + title: '订单管理', + children: ['我的订单', '入库订单列表', '派送订单列表'], + }, + { + title: '财务结算', + children: ['应付账单'], }, { title: '企业管理', - children: [ - { - title: '企业资料', - path: '/company/profile', - permission: 'company:profile:view', - }, - { - title: '企业成员', - path: '/organization/members', - permission: 'company:member:list', - }, - { - title: '角色管理', - path: '/organization/roles', - permission: 'company:role:list', - }, - { - title: '菜单权限', - path: '/organization/permissions', - permission: 'company:permission:list', - }, - ], + children: ['企业资料', '企业成员', '角色管理', '菜单权限'], }, + { title: '我的信息', children: undefined }, ], ) }) -test('provides confirmed icons and unique keys recursively', () => { - const expectedIcons = new Map([ - ['dashboard', LayoutGrid], - ['account-profile', CircleUserRound], - ['first-leg', Truck], - ['first-leg-orders', ClipboardList], - ['company', Settings], - ['company-profile', Building2], - ['company-members', Users], - ['company-roles', ShieldCheck], - ['company-permissions', KeyRound], - ]) +test('provides icons and unique keys recursively for every prototype item', () => { const nodes = collectNavigationNodes(clientNavigation) for (const node of nodes) { - assert.equal(node.icon, expectedIcons.get(node.key), `${node.key} has the confirmed icon`) + assert.ok(node.icon, `${node.key} has an icon`) } assert.equal(new Set(nodes.map((node) => node.key)).size, nodes.length) }) -test('flattens leaves with unique paths and non-empty permissions', () => { +test('flattens the complete prototype tree with unique paths', () => { const leaves = getNavigationLeaves(clientNavigation) const paths = leaves.map((leaf) => leaf.path) assert.deepEqual(paths, [ '/', - '/account/profile', '/orders/first-leg', + '/first-leg/import', + '/first-leg/quick-order', + '/cross-border/procurement', + '/cross-border/domestic-trucking', + '/cross-border/pallet-shipping', + '/overseas-warehouse/labeling', + '/overseas-warehouse/return-inbound', + '/overseas-warehouse/return-relabel', + '/overseas-warehouse/return-outbound', + '/orders/my', + '/orders/inbound', + '/orders/delivery', + '/finance/payables', '/company/profile', '/organization/members', '/organization/roles', '/organization/permissions', + '/account/profile', ]) assert.equal(new Set(paths).size, paths.length) - assert.ok(leaves.every((leaf) => leaf.permission.trim().length > 0)) - assert.equal(new Set(leaves.map((leaf) => leaf.permission)).size, leaves.length) + assert.ok(leaves.filter((leaf) => leaf.permission).every((leaf) => leaf.permission?.trim().length > 0)) }) test('filters inaccessible leaves and empty navigation groups', () => { const visible = filterNavigationByPermissions(clientNavigation, ['account:profile:view', 'order:first-leg:list']) - assert.deepEqual(getNavigationLeaves(visible).map((item) => item.path), ['/account/profile', '/orders/first-leg']) - assert.deepEqual(visible.map((item) => item.title), ['我的信息', '头程业务']) + assert.deepEqual(getNavigationLeaves(visible).map((item) => item.path), [ + '/orders/first-leg', + '/first-leg/import', + '/first-leg/quick-order', + '/cross-border/procurement', + '/cross-border/domestic-trucking', + '/cross-border/pallet-shipping', + '/overseas-warehouse/labeling', + '/overseas-warehouse/return-inbound', + '/overseas-warehouse/return-relabel', + '/overseas-warehouse/return-outbound', + '/orders/my', + '/orders/inbound', + '/orders/delivery', + '/finance/payables', + '/account/profile', + ]) + assert.deepEqual(visible.map((item) => item.title), ['头程物流', '出海下单', '海外仓', '订单管理', '财务结算', '我的信息']) assert.equal(getFirstAccessiblePath(['account:profile:view']), '/account/profile') assert.equal(getFirstAccessiblePath([]), '/forbidden') }) +test('excludes entries marked for manual hiding without affecting other visible items', () => { + const visible = filterNavigationByPermissions([ + { key: 'shown', title: '显示入口', icon: LayoutGrid, path: '/shown' }, + { key: 'hidden', title: '隐藏入口', icon: LayoutGrid, path: '/hidden', hidden: true }, + ], []) + + assert.deepEqual(getNavigationLeaves(visible).map((item) => item.path), ['/shown']) +}) + +test('puts enterprise management behind the prototype settings divider', () => { + const company = clientNavigation.find((node) => node.key === 'company') + + assert.ok(company) + assert.equal(company.dividerBefore, true) +}) + test('flattens a synthetic three-level navigation tree recursively', () => { const nestedLeaf = { key: 'nested-leaf', @@ -324,3 +337,26 @@ test('keeps the dashboard route permission synchronized with navigation', () => assert.ok(dashboardRoute) assert.match(dashboardRoute, /permission: 'dashboard:view'/) }) + +test('registers every prototype-only view through its corresponding business directory', () => { + const routerSource = readFileSync(new URL('../router/index.ts', import.meta.url), 'utf8') + const routes = [ + ['first-leg/import', 'first-leg/BatchImportView.vue'], + ['first-leg/quick-order', 'first-leg/QuickOrderView.vue'], + ['cross-border/procurement', 'cross-border/ProcurementView.vue'], + ['cross-border/domestic-trucking', 'cross-border/DomesticTruckingView.vue'], + ['cross-border/pallet-shipping', 'cross-border/PalletShippingView.vue'], + ['overseas-warehouse/labeling', 'overseas-warehouse/LabelingView.vue'], + ['overseas-warehouse/return-inbound', 'overseas-warehouse/ReturnInboundView.vue'], + ['overseas-warehouse/return-relabel', 'overseas-warehouse/ReturnRelabelView.vue'], + ['overseas-warehouse/return-outbound', 'overseas-warehouse/ReturnOutboundView.vue'], + ['orders/my', 'order-management/MyOrdersView.vue'], + ['orders/inbound', 'order-management/InboundOrdersView.vue'], + ['orders/delivery', 'order-management/DeliveryOrdersView.vue'], + ['finance/payables', 'finance/PayableBillsView.vue'], + ] + + for (const [path, view] of routes) { + assert.match(routerSource, new RegExp(`path: '${path}'.*?@/views/${view.replace('.', '\\.')}`)) + } +}) diff --git a/src/navigation/clientNavigation.ts b/src/navigation/clientNavigation.ts index 6045f97..ddf14a9 100644 --- a/src/navigation/clientNavigation.ts +++ b/src/navigation/clientNavigation.ts @@ -5,21 +5,30 @@ import { ClipboardList, KeyRound, LayoutGrid, + Package, + PlaneTakeoff, + ReceiptText, Settings, + Ship, ShieldCheck, + Tags, Truck, Users, + Warehouse, + Zap, } from '@lucide/vue' export interface ClientNavigationBaseNode { key: string title: string icon: Component + dividerBefore?: boolean + hidden?: boolean } export interface ClientNavigationLeaf extends ClientNavigationBaseNode { path: string - permission: string + permission?: string children?: never } @@ -33,19 +42,60 @@ export type ClientNavigationNode = ClientNavigationLeaf | ClientNavigationGroup export const clientNavigation: ClientNavigationNode[] = [ { key: 'dashboard', title: '业务总览', icon: LayoutGrid, path: '/', permission: 'dashboard:view' }, - { key: 'account-profile', title: '我的信息', icon: CircleUserRound, path: '/account/profile', permission: 'account:profile:view' }, { key: 'first-leg', - title: '头程业务', + title: '头程物流', icon: Truck, children: [ - { key: 'first-leg-orders', title: '头程订单', icon: ClipboardList, path: '/orders/first-leg', permission: 'order:first-leg:list' }, + { key: 'first-leg-orders', title: '头程下单', icon: ClipboardList, path: '/orders/first-leg', permission: 'order:first-leg:list' }, + { key: 'first-leg-import', title: '一键导入', icon: Package, path: '/first-leg/import' }, + { key: 'first-leg-quick-order', title: '快速下单', icon: Zap, path: '/first-leg/quick-order' }, + ], + }, + { + key: 'cross-border', + title: '出海下单', + icon: PlaneTakeoff, + children: [ + { key: 'cross-border-procurement', title: '海外采购', icon: Package, path: '/cross-border/procurement' }, + { key: 'cross-border-domestic-trucking', title: '美国本土卡', icon: Truck, path: '/cross-border/domestic-trucking' }, + { key: 'cross-border-pallet-shipping', title: '美本土散板', icon: Ship, path: '/cross-border/pallet-shipping' }, + ], + }, + { + key: 'overseas-warehouse', + title: '海外仓', + icon: Warehouse, + children: [ + { key: 'overseas-labeling', title: '贴标申请', icon: Tags, path: '/overseas-warehouse/labeling' }, + { key: 'overseas-return-inbound', title: '退货入库', icon: Package, path: '/overseas-warehouse/return-inbound' }, + { key: 'overseas-return-relabel', title: '退货换标', icon: Tags, path: '/overseas-warehouse/return-relabel' }, + { key: 'overseas-return-outbound', title: '退货出库', icon: Truck, path: '/overseas-warehouse/return-outbound' }, + ], + }, + { + key: 'order-management', + title: '订单管理', + icon: ClipboardList, + children: [ + { key: 'orders-my', title: '我的订单', icon: ReceiptText, path: '/orders/my' }, + { key: 'orders-inbound', title: '入库订单列表', icon: Package, path: '/orders/inbound' }, + { key: 'orders-delivery', title: '派送订单列表', icon: Truck, path: '/orders/delivery' }, + ], + }, + { + key: 'finance', + title: '财务结算', + icon: ReceiptText, + children: [ + { key: 'finance-payables', title: '应付账单', icon: ReceiptText, path: '/finance/payables' }, ], }, { key: 'company', title: '企业管理', icon: Settings, + dividerBefore: true, children: [ { key: 'company-profile', title: '企业资料', icon: Building2, path: '/company/profile', permission: 'company:profile:view' }, { key: 'company-members', title: '企业成员', icon: Users, path: '/organization/members', permission: 'company:member:list' }, @@ -53,6 +103,7 @@ export const clientNavigation: ClientNavigationNode[] = [ { key: 'company-permissions', title: '菜单权限', icon: KeyRound, path: '/organization/permissions', permission: 'company:permission:list' }, ], }, + { key: 'account-profile', title: '我的信息', icon: CircleUserRound, path: '/account/profile', permission: 'account:profile:view' }, ] function isNavigationGroup(node: ClientNavigationNode): node is ClientNavigationGroup { @@ -73,8 +124,9 @@ export function filterNavigationByPermissions( const allowed = new Set(permissions) const result: ClientNavigationNode[] = [] for (const node of nodes) { + if (node.hidden) continue if (!isNavigationGroup(node)) { - if (allowed.has(node.permission)) result.push(node) + if (!node.permission || allowed.has(node.permission)) result.push(node) continue } const children = filterNavigationByPermissions(node.children, permissions) @@ -84,7 +136,7 @@ export function filterNavigationByPermissions( } export function getFirstAccessiblePath(permissions: readonly string[]) { - return getNavigationLeaves(filterNavigationByPermissions(clientNavigation, permissions))[0]?.path ?? '/forbidden' + return getNavigationLeaves(filterNavigationByPermissions(clientNavigation, permissions)).find((leaf) => leaf.permission)?.path ?? '/forbidden' } function findNavigationParentKeys( diff --git a/src/router/index.ts b/src/router/index.ts index f5e3d2e..281a2cf 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -20,6 +20,19 @@ const router = createRouter({ { path: 'organization/roles', name: 'roles', component: () => import('@/views/RolesView.vue'), meta: { title: '角色管理', description: '建立符合企业分工的成员角色', permission: 'company:role:list' } }, { path: 'organization/permissions', name: 'permissions', component: () => import('@/views/PermissionsView.vue'), meta: { title: '菜单权限', description: '为本企业角色分配菜单及操作权限', permission: 'company:permission:list' } }, { path: 'orders/first-leg', name: 'first-leg-orders', component: () => import('@/views/FirstLegOrdersView.vue'), meta: { title: '头程订单', description: '创建、查询并跟进本企业头程订单', permission: 'order:first-leg:list' } }, + { path: 'first-leg/import', name: 'first-leg-import', component: () => import('@/views/first-leg/BatchImportView.vue'), meta: { title: '一键导入', description: '批量导入头程订单' } }, + { path: 'first-leg/quick-order', name: 'first-leg-quick-order', component: () => import('@/views/first-leg/QuickOrderView.vue'), meta: { title: '快速下单', description: '快速创建头程订单' } }, + { path: 'cross-border/procurement', name: 'cross-border-procurement', component: () => import('@/views/cross-border/ProcurementView.vue'), meta: { title: '海外采购', description: '管理海外采购订单' } }, + { path: 'cross-border/domestic-trucking', name: 'cross-border-domestic-trucking', component: () => import('@/views/cross-border/DomesticTruckingView.vue'), meta: { title: '美国本土卡', description: '创建美国本土卡车运输订单' } }, + { path: 'cross-border/pallet-shipping', name: 'cross-border-pallet-shipping', component: () => import('@/views/cross-border/PalletShippingView.vue'), meta: { title: '美本土散板', description: '创建美国本土散板运输订单' } }, + { path: 'overseas-warehouse/labeling', name: 'overseas-labeling', component: () => import('@/views/overseas-warehouse/LabelingView.vue'), meta: { title: '贴标申请', description: '提交海外仓贴标申请' } }, + { path: 'overseas-warehouse/return-inbound', name: 'overseas-return-inbound', component: () => import('@/views/overseas-warehouse/ReturnInboundView.vue'), meta: { title: '退货入库', description: '登记海外仓退货入库' } }, + { path: 'overseas-warehouse/return-relabel', name: 'overseas-return-relabel', component: () => import('@/views/overseas-warehouse/ReturnRelabelView.vue'), meta: { title: '退货换标', description: '提交退货换标申请' } }, + { path: 'overseas-warehouse/return-outbound', name: 'overseas-return-outbound', component: () => import('@/views/overseas-warehouse/ReturnOutboundView.vue'), meta: { title: '退货出库', description: '创建海外仓退货出库单' } }, + { path: 'orders/my', name: 'orders-my', component: () => import('@/views/order-management/MyOrdersView.vue'), meta: { title: '我的订单', description: '统一查询各类业务订单' } }, + { path: 'orders/inbound', name: 'orders-inbound', component: () => import('@/views/order-management/InboundOrdersView.vue'), meta: { title: '入库订单列表', description: '查询海外仓入库订单' } }, + { path: 'orders/delivery', name: 'orders-delivery', component: () => import('@/views/order-management/DeliveryOrdersView.vue'), meta: { title: '派送订单列表', description: '查询海外仓派送订单' } }, + { path: 'finance/payables', name: 'finance-payables', component: () => import('@/views/finance/PayableBillsView.vue'), meta: { title: '应付账单', description: '查询企业应付账单' } }, { path: 'forbidden', name: 'forbidden', component: () => import('@/views/ForbiddenView.vue'), meta: { title: '无权访问', description: '当前账号没有访问该页面的权限' } }, ], }, diff --git a/src/styles/index.css b/src/styles/index.css index d86bf1d..8a0c3dc 100644 --- a/src/styles/index.css +++ b/src/styles/index.css @@ -94,15 +94,12 @@ .client-content-grid { grid-template-columns: 1fr; } } @media (max-width: 720px) { - .top-header { padding: 0 14px; } - .client-sidebar { display: flex; width: min(286px, 86vw); padding: 0 14px 18px; visibility: hidden; pointer-events: none; transform: translateX(-100%); transition: transform .2s ease, visibility 0s linear .2s; z-index: 19; } + .top-header { inset: 0; width: 100%; max-width: 100vw; padding: 0 14px; } + .client-sidebar { display: flex; width: min(286px, 86vw); padding: 20px 14px 18px; visibility: hidden; pointer-events: none; transform: translateX(-100%); transition: transform .2s ease, visibility 0s linear .2s; z-index: 21; } .mobile-menu-open .client-sidebar { visibility: visible; pointer-events: auto; transform: translateX(0); transition-delay: 0s; } - .client-sidebar-scrim { position: fixed; inset: 68px 0 0; z-index: 18; display: block; padding: 0; border: 0; background: rgba(23, 50, 77, .48); } - .client-sidebar-header { display: flex; height: 52px; flex: 0 0 52px; align-items: center; justify-content: space-between; color: var(--navy); } - .client-sidebar-header strong { font-size: 13px; } - .client-sidebar-header button { display: grid; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--navy); place-items: center; } + .client-sidebar-scrim { position: fixed; inset: 0; z-index: 20; display: block; padding: 0; border: 0; background: rgba(7, 18, 34, .56); } + .client-sidebar-brand button { display: grid; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #fff; place-items: center; } .client-main { width: 100%; max-width: 100%; margin-left: 0; padding: 88px 14px 30px; } - .client-brand { display: none; } .client-header-menu-button { display: grid; } .client-header-heading p, .client-user-copy { display: none; } .client-header-heading h1 { font-size: 16px; } diff --git a/src/styles/navigationStyles.test.mjs b/src/styles/navigationStyles.test.mjs index 33a412d..b171106 100644 --- a/src/styles/navigationStyles.test.mjs +++ b/src/styles/navigationStyles.test.mjs @@ -10,20 +10,27 @@ const mobileStyles = compact.slice(compact.indexOf('@media (max-width: 720px)')) test('style source contract: constrains the desktop sidebar and gives the menu its own scroll region', () => { assert.match(compact, /\.client-shell\s*\{[^}]*overflow-x:\s*hidden/) - assert.match(compact, /\.client-sidebar\s*\{[^}]*overflow:\s*hidden/) + assert.match(compact, /\.client-sidebar\s*\{[^}]*inset:\s*0 auto 0 0[^}]*width:\s*250px[^}]*overflow:\s*hidden[^}]*background:\s*linear-gradient\(180deg, #0b1f3a 0%, #0c2a52 100%\)/) + assert.match(compact, /\.top-header\s*\{[^}]*inset:\s*0 0 auto 250px[^}]*max-width:\s*calc\(100vw - 250px\)/) assert.match(compact, /\.client-sidebar nav\s*\{[^}]*flex:\s*1[^}]*min-height:\s*0[^}]*overflow-y:\s*auto/) + assert.match(compact, /\.client-sidebar nav\s*\{[^}]*scrollbar-color:\s*rgba\(206, 222, 238, \.46\) transparent[^}]*scrollbar-width:\s*thin/) + assert.match(compact, /\.client-sidebar nav::\-webkit-scrollbar\s*\{[^}]*width:\s*10px[^}]*background:\s*transparent/) + assert.match(compact, /\.client-sidebar nav::\-webkit-scrollbar-track\s*\{[^}]*background:\s*transparent/) + assert.match(compact, /\.client-sidebar nav::\-webkit-scrollbar-thumb\s*\{[^}]*border:\s*3px solid transparent[^}]*background:\s*rgba\(206, 222, 238, \.46\)[^}]*background-clip:\s*padding-box/) + assert.match(compact, /\.client-sidebar nav::\-webkit-scrollbar-button\s*\{[^}]*display:\s*none[^}]*width:\s*0[^}]*height:\s*0/) assert.match(compact, /\.client-nav-menu,[^\{]*\.client-nav-submenu\s*\{[^}]*min-width:\s*0/) assert.match(compact, /\.client-nav-menu\s*\{[^}]*flex:\s*1[^}]*background:\s*transparent/) - assert.match(compact, /\.client-sidebar-header,\s*\.client-sidebar-scrim\s*\{[^}]*display:\s*none/) + assert.match(compact, /\.client-sidebar-brand button,\s*\.client-sidebar-scrim\s*\{[^}]*display:\s*none/) }) -test('style source contract: presents native grouped rows with restrained active states and truncation', () => { +test('style source contract: presents native grouped rows matching the prototype active and divider states', () => { assert.doesNotMatch(compact, /\.client-sidebar \.el-menu|\.el-menu-item|\.el-sub-menu/) assert.match(compact, /\.client-nav-menu,[^\{]*\.client-nav-submenu\s*\{[^}]*margin:\s*0[^}]*padding:\s*0[^}]*list-style:\s*none/) - assert.match(compact, /\.client-sidebar-group-trigger,[^\{]*\.client-sidebar-link\s*\{[^}]*height:\s*44px[^}]*border-radius:\s*8px/) - assert.match(compact, /\.client-sidebar-link\[aria-current="page"\]\s*\{[^}]*background:\s*#e9f4f2[^}]*color:\s*var\(--primary\)/) - assert.match(compact, /\.client-nav-node\.is-active-parent > \.client-sidebar-group-trigger\s*\{[^}]*background:\s*#f2f7f6[^}]*color:\s*var\(--primary\)/) - assert.match(compact, /\.client-nav-submenu\s*\{[^}]*padding-left:\s*3[6-8]px/) + assert.match(compact, /\.client-sidebar-group-trigger,[^\{]*\.client-sidebar-link\s*\{[^}]*height:\s*44px[^}]*border-radius:\s*10px[^}]*color:\s*rgba\(255, 255, 255, \.72\)/) + assert.match(compact, /\.client-sidebar-link\[aria-current="page"\]\s*\{[^}]*background:\s*linear-gradient\(90deg, #1565c0, #1e88e5\)[^}]*color:\s*#fff/) + assert.match(compact, /\.client-nav-node\.is-active-parent > \.client-sidebar-group-trigger\s*\{[^}]*background:\s*rgba\(255, 255, 255, \.08\)[^}]*color:\s*#fff/) + assert.match(compact, /\.client-nav-node\.has-divider-before\s*\{[^}]*border-top:\s*1px solid rgba\(255, 255, 255, \.1\)/) + assert.match(compact, /\.client-nav-submenu\s*\{[^}]*padding-left:\s*34px/) assert.match(compact, /\.client-sidebar-group-trigger\s*\{[^}]*border:\s*0[^}]*background:\s*transparent/) assert.match(compact, /\.client-sidebar-link\s*\{[^}]*text-decoration:\s*none/) assert.match(compact, /\.client-sidebar (?:\.client-sidebar-group-trigger|\.client-sidebar-link) svg[^\{]*\{[^}]*flex:\s*0 0 18px/) @@ -32,17 +39,18 @@ test('style source contract: presents native grouped rows with restrained active test('style source contract: makes navigation and drawer controls touch sized with visible keyboard focus', () => { assert.match(compact, /\.client-sidebar-group-trigger,[^\{]*\.client-sidebar-link\s*\{[^}]*height:\s*44px/) - assert.match(compact, /\.client-sidebar-group-trigger:focus-visible,[^\{]*\.client-sidebar-link:focus-visible,[^\{]*\.client-page-heading > button:focus-visible,[^\{]*\.client-sidebar-header button:focus-visible\s*\{[^}]*outline:\s*2px solid var\(--primary\)[^}]*outline-offset:\s*2px/) + assert.match(compact, /\.client-sidebar-group-trigger:focus-visible,\s*\.client-sidebar-link:focus-visible,[\s\S]*?\.client-sidebar-logout:focus-visible\s*\{[^}]*outline:\s*2px solid #8ed8cf[^}]*outline-offset:\s*2px/) + assert.match(compact, /\.client-sidebar-logout\s*\{[^}]*height:\s*44px[^}]*background:\s*rgba\(239, 68, 68, \.12\)/) }) test('style source contract: turns the sidebar into a layered drawer at 720px and below', () => { assert.doesNotMatch(mobileStyles, /\.client-sidebar\s*\{[^}]*display:\s*none/) - assert.match(mobileStyles, /\.client-sidebar\s*\{[^}]*display:\s*flex[^}]*width:\s*min\(286px,\s*86vw\)[^}]*visibility:\s*hidden[^}]*pointer-events:\s*none[^}]*transform:\s*translateX\(-100%\)[^}]*transition:\s*transform \.2s ease, visibility 0s linear \.2s[^}]*z-index:\s*19/) + assert.match(mobileStyles, /\.client-sidebar\s*\{[^}]*display:\s*flex[^}]*width:\s*min\(286px,\s*86vw\)[^}]*visibility:\s*hidden[^}]*pointer-events:\s*none[^}]*transform:\s*translateX\(-100%\)[^}]*transition:\s*transform \.2s ease, visibility 0s linear \.2s[^}]*z-index:\s*21/) assert.match(mobileStyles, /\.mobile-menu-open \.client-sidebar\s*\{[^}]*visibility:\s*visible[^}]*pointer-events:\s*auto[^}]*transform:\s*translateX\(0\)[^}]*transition-delay:\s*0s/) - assert.match(mobileStyles, /\.client-sidebar-scrim\s*\{[^}]*position:\s*fixed[^}]*inset:\s*68px 0 0[^}]*z-index:\s*18[^}]*background:\s*rgba\(23,\s*50,\s*77,\s*\.48\)/) - assert.match(mobileStyles, /\.client-sidebar-header\s*\{[^}]*display:\s*flex[^}]*height:\s*52px/) + assert.match(mobileStyles, /\.client-sidebar-scrim\s*\{[^}]*position:\s*fixed[^}]*inset:\s*0[^}]*z-index:\s*20[^}]*background:\s*rgba\(7,\s*18,\s*34,\s*\.56\)/) + assert.match(mobileStyles, /\.client-sidebar-brand button\s*\{[^}]*display:\s*grid[^}]*width:\s*44px[^}]*height:\s*44px/) assert.match(mobileStyles, /\.client-main\s*\{[^}]*max-width:\s*100%[^}]*margin-left:\s*0/) - assert.match(mobileStyles, /\.client-page-heading > button\s*\{[^}]*display:\s*grid[^}]*width:\s*44px[^}]*height:\s*44px/) + assert.match(mobileStyles, /\.client-header-menu-button\s*\{[^}]*display:\s*grid/) assert.match(mobileStyles, /\.client-user\s*\{[^}]*margin-left:\s*auto/) }) diff --git a/src/styles/shell.css b/src/styles/shell.css index cac6a9b..f35c9fb 100644 --- a/src/styles/shell.css +++ b/src/styles/shell.css @@ -1,7 +1,5 @@ .client-shell { min-height: 100vh; overflow-x: hidden; } -.top-header { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; width: 100%; max-width: 100vw; height: 68px; align-items: center; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--border); background: #fff; } -.client-brand { display: flex; width: 232px; min-width: 0; align-items: center; color: var(--navy); text-decoration: none; } -.client-brand-logo { display: block; width: 150px; height: 54px; object-fit: contain; object-position: left center; } +.top-header { position: fixed; inset: 0 0 auto 250px; z-index: 20; display: flex; width: auto; max-width: calc(100vw - 250px); height: 68px; align-items: center; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); } .client-header-menu-button { display: none; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--navy); place-items: center; } .client-header-heading { min-width: 0; flex: 1; } .client-header-heading h1 { overflow: hidden; margin: 0; color: var(--navy); font-size: 18px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; } @@ -11,21 +9,35 @@ .client-user-copy { display: flex; flex-direction: column; } .client-user-copy strong { font-size: 12px; } .client-user-copy small { color: var(--muted); font-size: 10px; } -.client-sidebar { position: fixed; inset: 68px auto 0 0; display: flex; width: 232px; flex-direction: column; overflow: hidden; padding: 20px 14px; border-right: 1px solid var(--border); background: #fff; } -.client-sidebar nav { display: flex; flex: 1; min-width: 0; min-height: 0; flex-direction: column; overflow-x: hidden; overflow-y: auto; } +.client-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 21; display: flex; width: 250px; flex-direction: column; overflow: hidden; padding: 20px 14px; background: linear-gradient(180deg, #0b1f3a 0%, #0c2a52 100%); color: #fff; } +.client-sidebar-brand { display: flex; flex: 0 0 auto; min-height: 68px; align-items: center; justify-content: space-between; gap: 10px; margin: -2px 0 14px; padding: 0 8px 14px; border-bottom: 1px solid rgba(255, 255, 255, .1); } +.client-sidebar-brand-link { display: flex; min-width: 0; align-items: center; gap: 10px; color: #fff; text-decoration: none; } +.client-sidebar-brand-mark { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 9px; background: #fff; box-shadow: 0 5px 14px rgba(0, 0, 0, .18); } +.client-sidebar-brand-mark img { display: block; width: 28px; height: 28px; object-fit: contain; } +.client-sidebar-brand-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; } +.client-sidebar-brand-copy strong { font-size: 15px; letter-spacing: .02em; line-height: 1.2; } +.client-sidebar-brand-copy small { color: rgba(255, 255, 255, .56); font-size: 10px; letter-spacing: .12em; } +.client-sidebar nav { display: flex; flex: 1; min-width: 0; min-height: 0; flex-direction: column; overflow-x: hidden; overflow-y: auto; scrollbar-color: rgba(206, 222, 238, .46) transparent; scrollbar-width: thin; } +.client-sidebar nav::-webkit-scrollbar { width: 10px; background: transparent; } +.client-sidebar nav::-webkit-scrollbar-track { background: transparent; } +.client-sidebar nav::-webkit-scrollbar-thumb { min-height: 40px; border: 3px solid transparent; border-radius: 999px; background: rgba(206, 222, 238, .46); background-clip: padding-box; } +.client-sidebar nav::-webkit-scrollbar-thumb:hover { background-color: rgba(235, 244, 252, .72); } +.client-sidebar nav::-webkit-scrollbar-button { display: none; width: 0; height: 0; } +.client-sidebar nav::-webkit-scrollbar-corner { background: transparent; } .client-nav-menu, .client-nav-submenu { min-width: 0; margin: 0; padding: 0; list-style: none; } .client-nav-menu { flex: 1; background: transparent; } -.client-nav-submenu { padding-left: 37px; } +.client-nav-submenu { padding-left: 34px; } .client-nav-node { min-width: 0; } +.client-nav-node.has-divider-before { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); } .client-sidebar-group-trigger, -.client-sidebar-link { display: flex; width: 100%; height: 44px; min-width: 0; align-items: center; gap: 11px; margin: 2px 0; padding: 0 10px; border-radius: 8px; color: #52616b; } +.client-sidebar-link { display: flex; width: 100%; height: 44px; min-width: 0; align-items: center; gap: 11px; margin: 2px 0; padding: 0 10px; border-radius: 10px; color: rgba(255, 255, 255, .72); } .client-sidebar-group-trigger { border: 0; background: transparent; cursor: pointer; text-align: left; } .client-sidebar-link { text-decoration: none; } .client-sidebar-group-trigger:hover, -.client-sidebar-link:hover { background: #f2f7f6; color: var(--primary); } -.client-sidebar-link[aria-current="page"] { background: #e9f4f2; color: var(--primary); font-weight: 650; } -.client-nav-node.is-active-parent > .client-sidebar-group-trigger { background: #f2f7f6; color: var(--primary); font-weight: 600; } +.client-sidebar-link:hover { background: rgba(255, 255, 255, .08); color: #fff; } +.client-sidebar-link[aria-current="page"] { background: linear-gradient(90deg, #1565c0, #1e88e5); box-shadow: 0 6px 18px rgba(21, 101, 192, .4); color: #fff; font-weight: 650; } +.client-nav-node.is-active-parent > .client-sidebar-group-trigger { background: rgba(255, 255, 255, .08); color: #fff; font-weight: 600; } .client-sidebar .client-sidebar-group-trigger svg, .client-sidebar .client-sidebar-link svg { flex: 0 0 18px; } .client-sidebar .client-sidebar-group-chevron { width: 16px; height: 16px; flex: 0 0 16px; margin-left: auto; transition: transform .2s ease; } @@ -35,10 +47,11 @@ .client-sidebar-group-trigger:focus-visible, .client-sidebar-link:focus-visible, .client-header-menu-button:focus-visible, -.client-sidebar-header button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; } -.client-sidebar-header, +.client-sidebar-brand button:focus-visible, +.client-sidebar-logout:focus-visible { outline: 2px solid #8ed8cf; outline-offset: 2px; } +.client-sidebar-brand button, .client-sidebar-scrim { display: none; } -.sidebar-help { display: flex; flex: 0 0 auto; flex-direction: column; gap: 4px; margin-top: 16px; padding: 14px; border-left: 3px solid var(--primary); background: #f2f7f6; } -.sidebar-help strong { font-size: 12px; } -.sidebar-help span { color: var(--muted); font-size: 11px; } -.client-main { width: calc(100% - 232px); max-width: 100%; min-height: 100vh; margin-left: 232px; padding: 88px 20px 40px; } +.client-sidebar-logout { display: flex; width: 100%; height: 44px; align-items: center; justify-content: flex-start; gap: 11px; margin: 2px 0 0; padding: 0 10px; border: 0; border-radius: 10px; background: rgba(239, 68, 68, .12); color: #fca5a5; cursor: pointer; font-weight: 600; text-align: left; } +.client-sidebar-logout:hover { background: rgba(239, 68, 68, .22); color: #fff; } +.client-sidebar-logout svg { flex: 0 0 18px; } +.client-main { width: calc(100% - 250px); max-width: 100%; min-height: 100vh; margin-left: 250px; padding: 88px 20px 40px; } diff --git a/src/views/cross-border/DomesticTruckingView.vue b/src/views/cross-border/DomesticTruckingView.vue new file mode 100644 index 0000000..716689f --- /dev/null +++ b/src/views/cross-border/DomesticTruckingView.vue @@ -0,0 +1,5 @@ + + + diff --git a/src/views/cross-border/PalletShippingView.vue b/src/views/cross-border/PalletShippingView.vue new file mode 100644 index 0000000..4b485d7 --- /dev/null +++ b/src/views/cross-border/PalletShippingView.vue @@ -0,0 +1,5 @@ + + + diff --git a/src/views/cross-border/ProcurementView.vue b/src/views/cross-border/ProcurementView.vue new file mode 100644 index 0000000..789ffc3 --- /dev/null +++ b/src/views/cross-border/ProcurementView.vue @@ -0,0 +1,5 @@ + + + diff --git a/src/views/finance/PayableBillsView.vue b/src/views/finance/PayableBillsView.vue new file mode 100644 index 0000000..3d262cc --- /dev/null +++ b/src/views/finance/PayableBillsView.vue @@ -0,0 +1,5 @@ + + + diff --git a/src/views/first-leg/BatchImportView.vue b/src/views/first-leg/BatchImportView.vue new file mode 100644 index 0000000..ac49ba4 --- /dev/null +++ b/src/views/first-leg/BatchImportView.vue @@ -0,0 +1,5 @@ + + + diff --git a/src/views/first-leg/QuickOrderView.vue b/src/views/first-leg/QuickOrderView.vue new file mode 100644 index 0000000..f4fd281 --- /dev/null +++ b/src/views/first-leg/QuickOrderView.vue @@ -0,0 +1,5 @@ + + + diff --git a/src/views/order-management/DeliveryOrdersView.vue b/src/views/order-management/DeliveryOrdersView.vue new file mode 100644 index 0000000..5b7bfc2 --- /dev/null +++ b/src/views/order-management/DeliveryOrdersView.vue @@ -0,0 +1,5 @@ + + + diff --git a/src/views/order-management/InboundOrdersView.vue b/src/views/order-management/InboundOrdersView.vue new file mode 100644 index 0000000..48cbbd2 --- /dev/null +++ b/src/views/order-management/InboundOrdersView.vue @@ -0,0 +1,5 @@ + + + diff --git a/src/views/order-management/MyOrdersView.vue b/src/views/order-management/MyOrdersView.vue new file mode 100644 index 0000000..9a63189 --- /dev/null +++ b/src/views/order-management/MyOrdersView.vue @@ -0,0 +1,5 @@ + + + diff --git a/src/views/overseas-warehouse/LabelingView.vue b/src/views/overseas-warehouse/LabelingView.vue new file mode 100644 index 0000000..8d07fcd --- /dev/null +++ b/src/views/overseas-warehouse/LabelingView.vue @@ -0,0 +1,5 @@ + + + diff --git a/src/views/overseas-warehouse/ReturnInboundView.vue b/src/views/overseas-warehouse/ReturnInboundView.vue new file mode 100644 index 0000000..e5c4b63 --- /dev/null +++ b/src/views/overseas-warehouse/ReturnInboundView.vue @@ -0,0 +1,5 @@ + + + diff --git a/src/views/overseas-warehouse/ReturnOutboundView.vue b/src/views/overseas-warehouse/ReturnOutboundView.vue new file mode 100644 index 0000000..a2024dd --- /dev/null +++ b/src/views/overseas-warehouse/ReturnOutboundView.vue @@ -0,0 +1,5 @@ + + + diff --git a/src/views/overseas-warehouse/ReturnRelabelView.vue b/src/views/overseas-warehouse/ReturnRelabelView.vue new file mode 100644 index 0000000..794211e --- /dev/null +++ b/src/views/overseas-warehouse/ReturnRelabelView.vue @@ -0,0 +1,5 @@ + + + diff --git a/src/views/prototype/PrototypeFeatureView.vue b/src/views/prototype/PrototypeFeatureView.vue new file mode 100644 index 0000000..53fb914 --- /dev/null +++ b/src/views/prototype/PrototypeFeatureView.vue @@ -0,0 +1,28 @@ + + + + +