From 88909258cc94304d48eb17d8bd828564468d134c Mon Sep 17 00:00:00 2001 From: zzh <1368735060@qq.com> Date: Sat, 24 Oct 2026 18:51:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=A2=E6=88=B7=E9=97=A8=E6=88=B7?= =?UTF-8?q?=E5=8F=AF=E6=8A=98=E5=8F=A0=E4=BE=A7=E6=A0=8F=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=EF=BC=8C=E5=8E=BB=E6=8E=89=E9=A1=B5=E7=AD=BE=E5=B9=B6=E5=8C=BA?= =?UTF-8?q?=E5=88=86=E6=89=93=E5=8D=B0=E5=85=A5=E5=8F=A3=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 运营端顶栏布局不变;客户侧栏按常用/仓储/更多分组,余额与打印沉底,打印提示按门户区分。 Co-authored-by: Cursor --- docs/前端页面设计规范.md | 18 +- src/components.d.ts | 1 + src/components/ContactService/index.vue | 78 +- .../PrintTemplate/OrderPrintModal.vue | 7 +- src/components/customer-side-rail/index.vue | 1115 +++++++++++++++++ src/components/top-nav/RightTopMessage.vue | 16 +- src/components/top-nav/RightTopUser.vue | 157 ++- src/components/top-nav/SelectLang.vue | 9 +- src/components/top-nav/index.vue | 65 +- src/layout/default-layout.vue | 81 +- src/locale/en-US.ts | 14 + src/locale/zh-CN.ts | 14 + src/utils/customer-portal-nav.ts | 334 +++++ src/utils/hiprint/dispatchPrintUrl.ts | 3 +- src/utils/hiprint/printControlHints.ts | 14 + src/views/operation/printLabel/index.vue | 4 +- src/views/order/myOrders/index.vue | 6 +- src/views/warehouse/parcel/index.vue | 4 +- 18 files changed, 1892 insertions(+), 48 deletions(-) create mode 100644 src/components/customer-side-rail/index.vue create mode 100644 src/utils/customer-portal-nav.ts create mode 100644 src/utils/hiprint/printControlHints.ts diff --git a/docs/前端页面设计规范.md b/docs/前端页面设计规范.md index 92b6bdd..9852214 100644 --- a/docs/前端页面设计规范.md +++ b/docs/前端页面设计规范.md @@ -27,19 +27,31 @@ ``` a-layout (垂直) -├── TopNav(顶部导航,fixed) +├── TopNav(仅运营端,fixed) ├── a-layout-content -│ ├── paddingTop: 顶部导航高度 + Tab 栏高度(可选) -│ └── PageLayout(router-view + keep-alive) +│ ├── 运营端:paddingTop = 顶栏 + Tab;PageLayout +│ └── 客户门户:CustomerSideRail(全高)+ PageLayout(无顶栏、无多页签) └── Footer(可选) ``` +运营端布局 DOM/样式与改前一致;客户门户不挂载 TopNav / TabBar。 + **约定:** - 主内容背景色:`#f0f3f4` - 页面容器使用 `[class$='-container']`,统一 `padding: 16px` - 内容区域使用 `overflow: hidden`、`height: 100%` 保证高度正确 +**客户门户 vs 运营端导航(差异约定):** + +| | 运营端 | 客户门户 | +|---|---|---| +| 顶栏 | 一级模块 + hover 二级 + 右侧余额/打印/用户 | **无顶栏** | +| 页签 | TabBar 多页签 | **无多页签**(当前页仅由侧栏高亮表达) | +| 侧栏 | 无全局侧栏 | **全高可折叠左栏**(默认展开):顶 Logo;中按「常用 / 仓储 / 更多」浅分组;**资产与账户收进用户下拉**;底沉余额/打印(含下载)/消息/仓库;**语言收进用户菜单** | +| 高亮 | 路由最长路径匹配 | 侧栏最长路径匹配;账户类路由高亮底栏用户区 | +| 数据 | RBAC 菜单树原样 | 仍用同一菜单树,`flatMap` 二级即可,不改表结构 | + ### 2.2 页面内容结构 单页内容推荐结构: diff --git a/src/components.d.ts b/src/components.d.ts index 4502aec..705769d 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -18,6 +18,7 @@ declare module 'vue' { CodeMirror: typeof import('./components/CodeMirror/index.vue')['default'] CompleteContactModal: typeof import('./components/CompleteContactModal/index.vue')['default'] ContactService: typeof import('./components/ContactService/index.vue')['default'] + CustomerSideRail: typeof import('./components/customer-side-rail/index.vue')['default'] CustomLeftMenu: typeof import('./components/CustomLeftMenu/index.vue')['default'] CustomList: typeof import('./components/CustomList/index.vue')['default'] DrawerPro: typeof import('./components/DrawerPro/index.vue')['default'] diff --git a/src/components/ContactService/index.vue b/src/components/ContactService/index.vue index ad4d2ae..aa34834 100644 --- a/src/components/ContactService/index.vue +++ b/src/components/ContactService/index.vue @@ -4,12 +4,18 @@ import { useI18n } from 'vue-i18n' import { getWarehouseList } from '@/api/system/warehouse' import { useCurrentWarehouseStore } from '@/store' -withDefaults( +const props = withDefaults( defineProps<{ - variant?: 'navbar' | 'login' + variant?: 'navbar' | 'login' | 'sider' + /** 下拉位置;侧栏沉底用 rt */ + dropdownPosition?: 'br' | 'bl' | 'tr' | 'tl' | 'rt' | 'rb' + /** 侧栏收起:窄宽展示缩略文案(无图标) */ + compact?: boolean }>(), { variant: 'navbar', + dropdownPosition: 'br', + compact: false, }, ) @@ -22,6 +28,17 @@ const displayName = computed( t('nav.contactService.selectWarehouse'), ) +/** 收起时只露一字,避免无图标时空块 */ +const labelText = computed(() => { + const name = displayName.value + if (props.variant === 'sider' && props.compact) { + return name.slice(0, 1) || '仓' + } + return name +}) + +const useDropdown = computed(() => props.variant === 'navbar' || props.variant === 'sider') + async function loadServiceDataList() { try { const { items } = await getWarehouseList({ @@ -51,15 +68,22 @@ onMounted(() => {