diff --git a/docs/layout-性能优化分析.md b/docs/layout-性能优化分析.md new file mode 100644 index 00000000..280b3798 --- /dev/null +++ b/docs/layout-性能优化分析.md @@ -0,0 +1,405 @@ +# Layout 框架性能分析与优化建议 + +> 状态:**阶段 1、2 已实施;阶段 3 部分待定;阶段 4 评估后回滚** +> 范围:首屏加载 + 路由切换响应 +> 基线:`npm run build` 产物实测 + +--- + +## 〇、实施进展 + +| 阶段 | 项 | 状态 | +|---|---|---| +| 1 | 生产环境关闭路由树 `console.log` | ✅ 已完成 | +| 1 | `document.title` 去重 | ✅ 已完成 | +| 1 | `beforeEach` 打印连接加一次性标记 | ✅ 已完成 | +| 2 | 切页过渡去掉离开动画(0.2s → 0,进入 0.12s) | ✅ 已完成 | +| 2 | `TaskView` 标签定位改 `Map`(O(1)) | ✅ 已完成 | +| 2 | 打印运行时移到 mount 之后 | ⏭ 跳过(`startConnections` 依赖已初始化的 runtime,后置会漏连接) | +| 3 | `keep-alive` max 降到 4 | ⏸ 暂缓(会改变业务缓存行为) | +| 3 | `TopMenu` 测量缓存 / `Sidebar` 延迟渲染 | ⏸ 暂缓(收益中低、风险中) | +| 4 | Element Plus 按需引入 | ↩️ **已回滚**,详见下方 | + +### 阶段 4 回滚原因 + +启用 `unplugin-auto-import` + `unplugin-vue-components` 后,类型检查暴露出一批**既有的无效用法**(这些代码在全量注册下一直静默失效): + +- `el-list` / `el-list-item`:Element Plus 不存在该组件(Element UI 2 遗留) +- `type="link"`:Element Plus 的 Button 用 `link` 属性,`type="link"` 非法 +- 若干 `TreeNodeData` / `string | null` 类型不匹配 + +修复这些用法**会改变页面视觉**,超出「性能优化不影响样式」的范围,因此回滚,建议作为独立任务排期。 + +> 依赖 `unplugin-auto-import` / `unplugin-vue-components` 已安装,可留作后续实施。 + +--- + +## 一、现状基线 + +### 1.1 首屏加载资源(index.html 实际引用) + +| 资源 | 体积 | gzip | +|---|---|---| +| `vendor-element-plus.js` | **809 kB** | 256 kB | +| `vendor-VdJDF3fp.js`(其他第三方) | **416 kB** | 140 kB | +| `index.js`(入口 + 应用代码) | **228 kB** | 65 kB | +| `vendor-vue.js` | **210 kB** | 78 kB | +| **JS 合计** | **≈ 1.66 MB** | **≈ 539 kB** | +| `vendor-element-plus.css` | **347.6 kB** | ≈ 40 kB | +| `index.css` + `vendor*.css` | ≈ 60 kB | — | +| **CSS 合计** | **≈ 400 kB** | — | + +✅ 好消息:`vendor-echarts`(1.12 MB)和 `vendor-xlsx`(424 kB)**不在首屏预加载列表**,已是按需加载。 + +### 1.2 渲染与切换链路 + +``` +main.ts +├─ import ElementPlus(全量)+ 全量 CSS ← 首屏最大负担 +├─ import 'virtual:svg-icons-register' (67 个图标内联进入口) +├─ loadServerMessages() (异步 i18n) +├─ initPrinterRuntime() + bindRuntimeEvents() (mount 前同步执行) +└─ app.mount('#app') + +permission.ts(beforeEach) +├─ NProgress.start() +├─ hasGetUserInfo 判断 +│ └─ 否则:getInfo() → generateRoutes() → addRoute() × N +│ + console.log(formatRoutesForLog(...)) × 3 ← 生产环境也执行 +└─ ensurePrinterConnectionsAfterLogin() ← 每次导航都调用 + +AppMain.vue +└─ keep-alive(:include=cachedViews, :max=8) + + transition(mode="out-in", 0.2s) ← 感知延迟 + +TaskView/index.vue +├─ ResizeObserver → 写 --app-header-height +├─ visitedViews v-for + v-memo +├─ moveToCurrentTag():遍历全部标签定位 +└─ onBeforeUpdate 清空 tagsRef + +TopMenu.vue(top-bottom 布局) +└─ 渲染两份菜单 DOM:真实层 + 隐藏测量层 +``` + +### 1.3 已有的良好实践(无需再改) + +- ✅ 路由组件全部 `() => import()` 懒加载(`componentMap`) +- ✅ `keep-alive` 的 `wrapRouteComponent` 修复了 include 匹配失效问题 +- ✅ `router-view :key` 收窄为 `route.name ?? route.path`,同页 query 变化不再重建 +- ✅ 第三方库按库拆分 chunk,升级应用代码时第三方哈希不变,可长期缓存 +- ✅ `tags-view` 已加 `v-memo` +- ✅ `ResizeObserver` 替代轮询式高度同步 +- ✅ echarts / xlsx 不在首屏 + +--- + +## 二、性能瓶颈清单 + +### P0 · Element Plus 全量引入 + +**位置**:`main.ts` + +```ts +import ElementPlus from 'element-plus' +import 'element-plus/dist/index.css' +app.use(ElementPlus) +``` + +**代价**:首屏 JS **809 kB**(gzip 256 kB)+ CSS **347.6 kB**,占首屏 JS 的 **48%**、CSS 的 **87%**。 + +**实际使用情况**:项目里大量组件是 `` 模板标签,全量注册会让所有组件(含几乎不用的 Table/Tree/Cascader/Transfer…)都进入产物。 + +**建议**:改为按需自动引入 + +```ts +// vite.config.ts +import AutoImport from 'unplugin-auto-import/vite' +import Components from 'unplugin-vue-components/vite' +import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' + +plugins: [ + AutoImport({ resolvers: [ElementPlusResolver()] }), + Components({ resolvers: [ElementPlusResolver()] }) +] +``` + +同时 `main.ts` 移除 `app.use(ElementPlus)` 与全量 CSS import(样式由 resolver 按需注入)。 + +> 注意:`ElMessage` / `ElMessageBox` 这类**函数式调用**不会被模板扫描到,需要 `import { ElMessage } from 'element-plus'` 保持显式导入(项目里已经是这样用的,兼容)。 + +**预期收益**:首屏 JS **≈ -350~-450 kB**(gzip -100~-130 kB),CSS **≈ -250 kB**。 + +**风险**:中。需要全量回归一次(尤其是动态渲染的 `h(...)` 用法、`el-config-provider`、`ElLoading` 等指令式组件)。 + +--- + +### P0 · 生产环境仍在格式化整棵路由树 + +**位置**:`permission.ts` + +```ts +console.log('[Router] 动态路由 (后端菜单转换):', formatRoutesForLog(accessRoutes)) +console.log('[Router] 合并后完整路由 (constantRoutes + 动态):', formatRoutesForLog(permissionStore.routes)) +console.log('[Router] Vue Router 实例路由:', formatRoutesForLog(router.getRoutes())) +``` + +`formatRoutesForLog` 会**递归遍历整棵路由树并为每个节点创建新对象**,且执行了 3 次(其中一次还是合并后的全量路由)。 + +**代价**:菜单多时(当前 web_pages 89 + api 264 + 其他端),每次登录 / 整页刷新都要构造 3 份完整对象树,同时产生大量对象占用内存。 + +**建议**: + +```ts +if (import.meta.env.DEV) { + console.log(...) +} +``` + +**预期收益**:登录后首次进入 **-50~150 ms**,并释放可观内存。 + +**风险**:极低。 + +--- + +### P0 · `beforeEach` 每次导航都触发打印连接逻辑 + +**位置**:`permission.ts` + +```ts +if (hasGetUserInfo) { + ensurePrinterConnectionsAfterLogin() // 每次导航都执行 + maybeRetryPrintConnectionsAfterRefresh() + return true +} +``` + +`ensurePrinterConnectionsAfterLogin()` 内部会取 store、检查 `isLoaded`、调用 `startConnections()`(内部虽有幂等标记,但仍有数次函数调用与状态判断)。 + +**建议**:加一次性标记,仅在本会话首次通过守卫时执行: + +```ts +let bootstrapped = false +if (hasGetUserInfo) { + if (!bootstrapped) { bootstrapped = true; ensurePrinterConnectionsAfterLogin() } + ... +} +``` + +**预期收益**:每次切页 **-1~3 ms**(单次不大,但导航频率高)。 + +**风险**:低(需保留 `/redirect` 软刷新后的重连分支)。 + +--- + +### P1 · 切页动画造成的感知延迟 + +**位置**:`AppMain.vue` + +```vue + +``` + +```scss +.tab-fade-enter-active, .tab-fade-leave-active { transition: opacity .2s; } +``` + +`mode="out-in"` 表示**旧页面先淡出 200ms,新页面再淡入 200ms**,用户感知的切换延迟累计约 **400ms**。而 keep-alive 命中时页面其实已经缓存好了,这 200ms 完全是等待。 + +**建议**(按保守程度排序): + +1. 只保留进入动画,去掉离开动画: + ```scss + .fade-transform-leave-active { transition: opacity 0s; } + ``` +2. 或缩短到 100~120ms +3. 进阶:keep-alive 命中时跳过动画(按 `route.meta.noCache` 或首次访问判断) + +**预期收益**:切页感知 **-200~-300 ms**。 + +**风险**:低(纯视觉调整)。 + +--- + +### P1 · `TaskView` 每次切页线性遍历标签 + +**位置**:`TaskView/index.vue` + +```ts +const moveToCurrentTag = () => { + nextTick(() => { + for (const [i, tag] of visitedViews.value.entries()) { ... tagsRef.value[i] ... } + }) +} +``` + +- 每次 `route.fullPath` 变化都线性遍历全部已打开标签 +- `onBeforeUpdate` 会清空 `tagsRef`,随后 Vue 重建 ref 数组 + +**建议**: + +- 维护 `Map`,`moveToCurrentTag` 变成 O(1) +- 用函数式 `:ref="el => tagEls.set(tag.path, el)"` 替代数组 ref + 清空逻辑 + +**预期收益**:标签 20+ 时每次切页 **-3~10 ms**。 + +**风险**:低。 + +--- + +### P1 · `TopMenu` 渲染两份菜单 DOM + +**位置**:`TopMenu.vue` + +```vue +…真实菜单… +
+ …再渲染一份相同菜单… +
+``` + +测量层把**所有一级菜单再挂载一遍**(含 el-menu / el-sub-menu 全套组件实例),只为量取宽度。 + +**建议**: + +1. 短中期:菜单结构(routes)不变时缓存测量结果,避免 `resize` / `locale` / `fonts.ready` 反复触发 `measureItems` 全量重测 +2. 长期:直接用真实层的 `scrollWidth` 与 `clientWidth` 判断溢出,去掉测量层 +3. 至少把测量层降级为**纯 DOM 文本宽度测量**(`canvas.measureText`),不挂载组件 + +**预期收益**:首屏挂载 **-20~40 ms**,内存减少一份菜单实例。 + +**风险**:中(收纳数量计算的准确性依赖测量结果)。 + +--- + +### P1 · `Sidebar` 一次性挂载全部菜单 + +**位置**:`Sidebar/SidebarItem.vue` 递归 + +当前 `web_pages` 有 89 条(含子项),全部一次性渲染成 `el-menu-item` / `el-sub-menu`。 + +**建议**: + +- 折叠状态的子菜单**延迟渲染**:只有父级展开过(`is-opened`)才 `v-if` 渲染 children +- 菜单层级深的页面,首屏 DOM 节点数可减少 40%+ + +**预期收益**:首屏 DOM 挂载 **-30~60 ms**(取决于菜单量)。 + +**风险**:中低(需处理“展开瞬间”的首次渲染)。 + +--- + +### P2 · `document.title` 每次导航写两次 + +**位置**:`main.ts` + +```ts +watch([...frontBrandStore.loaded, siteTitle, router.currentRoute.value.path], () => applyDocumentTitle()) +router.afterEach((to) => applyDocumentTitle(to)) +``` + +`path` 变化时 `watch` 触发一次,`afterEach` 再触发一次,造成重复的 `tMenu` 翻译查找 + DOM 写入。 + +**建议**:只保留 `afterEach`(品牌加载完成的场景另加一次 watch 即可)。 + +**预期收益**:每次导航 **-1~2 ms**。 + +**风险**:低。 + +--- + +### P2 · 启动期同步初始化打印运行时 + +**位置**:`main.ts` + +```ts +initPrinterRuntime() +usePrinterComponentStore(pinia).bindRuntimeEvents() +app.mount('#app') +``` + +在 `mount` 之前同步执行,会推迟首帧。 + +**建议**:移到 `mount` 之后,或用 `requestIdleCallback` 包裹,让首屏优先渲染。 + +**预期收益**:首屏 FCP **-10~30 ms**。 + +**风险**:低(注意事件绑定时序)。 + +--- + +### P2 · `keep-alive` 最大缓存 8 个页面 + +`pageCacheMax` 默认 8。缓存的页面实例持有完整 DOM、表格数据、定时器。 + +**建议**: + +- 把默认值降到 4 +- 对重页面(含大表格/视频/图表的)在路由 `meta` 上标 `noCache` + +**预期收益**:内存占用下降,长时间使用后切换更稳。 + +**风险**:低(业务上会牺牲少量返回体验)。 + +--- + +### P3 · 首屏 CSS 未拆分/未压缩到极致 + +当前 `vendor-element-plus.css` 347.6 kB 是**全量样式**。按 P0 的按需引入解决后,这部分会降到约 80~100 kB。 + +另外建议确认部署侧已开启: + +- gzip / brotli +- `Cache-Control: immutable`(vendor chunk 带哈希,可长期缓存) +- HTTP/2 或 CDN + +--- + +## 三、建议实施顺序 + +| 阶段 | 内容 | 风险 | 预期收益 | +|---|---|---|---| +| **1** | 生产环境关闭路由树 `console.log` | 极低 | 首次进入 -50~150ms | +| **1** | `document.title` 去重 | 极低 | 每次导航 -1~2ms | +| **1** | `beforeEach` 打印连接加一次性标记 | 低 | 每次导航 -1~3ms | +| **2** | 切页动画去掉离开过渡 / 缩短时长 | 低 | 切页感知 -200~300ms | +| **2** | `TaskView` 标签定位改 Map | 低 | 每次切页 -3~10ms | +| **2** | 打印运行时移到 mount 之后 | 低 | FCP -10~30ms | +| **3** | `TopMenu` 测量结果缓存 / 去测量层 | 中 | 首屏 -20~40ms | +| **3** | `Sidebar` 子菜单延迟渲染 | 中 | 首屏 -30~60ms | +| **3** | `keep-alive` max 降到 4 + 重页面 noCache | 低 | 内存下降 | +| **4** | **Element Plus 按需引入** | 中 | 首屏 JS **-350~450kB**、CSS **-250kB** | + +> 阶段 1、2 几乎零风险,可以先做,**不改任何业务逻辑**。 +> 阶段 4 收益最大但需要全量回归,建议单独排期。 + +--- + +## 四、可选:先加观测再优化 + +当前没有任何性能埋点,优化效果无法量化。建议先加最小埋点: + +```ts +// 切页耗时 +router.beforeEach(() => { performance.mark('route-start') }) +router.afterEach((to) => { + performance.mark('route-end') + performance.measure(`route:${String(to.name)}`, 'route-start', 'route-end') +}) +``` + +配合 Chrome Performance 面板,可以直接确认「切页慢」到底是: + +- 路由守卫耗时(P0-2 / P0-3) +- 组件渲染耗时(P1-1 / P1-3) +- 还是首屏资源太大(P0-1) + +--- + +## 五、结论 + +- **首屏慢的主因是 Element Plus 全量引入**(1.66MB 首屏 JS 里占 809kB),这是唯一能带来「量级变化」的优化点 +- **切页慢的主因是 200ms 的 `out-in` 过渡动画 + 每次导航的重复守卫逻辑**,这两项改动小、收益直接 +- 菜单相关的渲染开销(TopMenu 双份 DOM、Sidebar 全量挂载)属于「菜单条目多时才会显现」的次要因素,可作为第三阶段 + +如果只能做三件事:**关掉路由树日志 → 去掉离开过渡动画 → Element Plus 按需引入**。 diff --git a/docs/菜单图标体系-实施方案.md b/docs/菜单图标体系-实施方案.md new file mode 100644 index 00000000..ae8d8730 --- /dev/null +++ b/docs/菜单图标体系-实施方案.md @@ -0,0 +1,302 @@ +# 菜单图标体系 · 实施方案 + +> 范围:web 端左侧菜单 / 顶部菜单的图标(`wms_permission.meta_icon`) +> 状态:**方案稿,未改代码** +> 目标:命名统一、可维护、失效可见、存量可迁移 + +--- + +## 一、图标库选型 + +### 1.1 现状 + +| 环节 | 实现 | +|---|---| +| 构建 | `vite-plugin-svg-icons`,扫描 `src/icons/svg/*.svg`,生成 sprite,id = `icon-{文件名}` | +| 注册 | `main.ts` → `virtual:svg-icons-register` + `app.component('svg-icon', SvgIcon)` | +| 渲染 | `` → `` | +| 尺寸/颜色 | `1em × 1em`,`fill: currentColor` | +| 现有图标 | 16 个通用图标(dashboard / form / table / user …),**无业务图标** | + +另一套:`@element-plus/icons-vue`(`ArrowDown`、`ChatDotRound` 等),以 **Vue 组件**形式零散使用,不参与菜单图标。 + +### 1.2 候选方案对比 + +| 方案 | 优点 | 缺点 | 结论 | +|---|---|---|---| +| **A. 沿用 svg sprite + 自建业务图标集** | 零新增依赖;渲染链路不变;40+ 现有使用点无需改动;体积可控(按需打包);`fill: currentColor` 天然适配主题色 | 需要人工沉淀图标文件 | ✅ **推荐** | +| B. `@element-plus/icons-vue` 作为菜单图标源 | 依赖已存在,约 290 个通用图标 | 组件形式,无法用 `meta_icon` 字符串直接驱动;**缺少订单/库存/仓储类业务语义图标** | ❌ 不作为菜单图标源,继续用于按钮内图标 | +| C. Iconify 离线集合(`@iconify/vue`) | 图标海量(20 万+),字符串直用,可离线 | 新增运行时依赖;命名带集合前缀;需改造 `SvgIcon`;首屏体积需额外控制 | ⚠️ 进阶可选 | +| D. iconfont 字体/symbol | 设计可维护,可自定义 | 依赖外部项目与更新流程;字体图标单色 | ⚠️ 团队有设计资源时可选 | + +### 1.3 结论 + +**继续使用现有的 `vite-plugin-svg-icons` + `svg-icon` 机制**,只补齐「业务图标资源 + 命名规范 + 兜底校验」。 + +图标素材来源建议使用 MIT 协议的开源集合(可直接商用、可落地成 svg 文件): + +- **Tabler Icons**(MIT,线条风格,与当前 UI 风格接近) +- **Material Design Icons**(Apache-2.0) +- **Carbon Icons**(Apache-2.0) + +> 落地方式:下载为 `.svg` 放入 `src/icons/svg/`,文件名即 `meta_icon` 的值,**不引入任何新依赖**。 + +命名规范: + +``` +全小写 kebab-case,语义优先,不带前缀 +✔ order、goods、storage、express-truck、after-sale +✘ el-icon-s-goods、Icon_Order、orderIcon +``` + +--- + +## 二、图标清单 + +### 2.1 需要新增的 svg 文件(19 个) + +| # | 文件名 | 语义 | 建议来源 | +|---|---|---|---| +| 1 | `order.svg` | 订单 | 单据/清单 | +| 2 | `goods.svg` | 商品 | 包裹/盒子 | +| 3 | `storage.svg` | 库存 | 货架/箱子堆叠 | +| 4 | `material.svg` | 物料 | 耗材/组件 | +| 5 | `warehouse-grid.svg` | 仓位 | 网格/库位 | +| 6 | `warehouse.svg` | 仓库 | 仓库/厂房 | +| 7 | `data-chart.svg` | 数据 | 柱状/折线图 | +| 8 | `store-owner.svg` | 货主 | 商户/店铺 | +| 9 | `express-truck.svg` | 物流 | 货车 | +| 10 | `finance.svg` | 财务 | 钱币/钱包 | +| 11 | `video-camera.svg` | 视频监控 | 摄像头 | +| 12 | `settings.svg` | 设置 | 齿轮 | +| 13 | `system.svg` | 系统 | 服务器/终端 | +| 14 | `after-sale.svg` | 售后 | 客服/售后 | +| 15 | `inbox-message.svg` | 消息 | 收件箱/消息 | +| 16 | `user-check.svg` | 成员加入审核 | 用户+对勾 | +| 17 | `permission.svg` | 权限管理 | 盾牌/钥匙 | +| 18 | `role.svg` | 角色管理 | 用户组 | +| 19 | `material-info.svg` | 物料资料 | 文档+信息 | + +已存在、无需新增:`user.svg`(账号管理沿用) + +### 2.2 菜单 → 图标映射表 + +| id | path | 菜单标题 | 现 meta_icon | 新 meta_icon | +|---|---|---|---|---| +| 1 | `/order` | 订单 | `''` | `order` | +| 13 | `/stock` | 商品 | `el-icon-s-goods` | `goods` | +| 18 | `/storage` | 库存 | `el-icon-s-data` | `storage` | +| 15 | `/material` | 物料 | `el-icon-s-cooperation` | `material` | +| 14 | `/warehouse` | 仓位 | `el-icon-s-grid` | `warehouse-grid` | +| 16 | `/data` | 数据 | `el-icon-s-marketing` | `data-chart` | +| 17 | `/store` | 货主 | `el-icon-s-custom` | `store-owner` | +| 393 | `/warehouses` | 仓库 | `el-icon-s-custom` | `warehouse` | +| 19 | `/express` | 物流 | `el-icon-truck` | `express-truck` | +| 28 | `/finance` | 财务 | `el-icon-s-finance` | `finance` | +| 47 | `video` | 视频监控 | `el-icon-video-camera-solid` | `video-camera` | +| 4 | `/setting` | 设置 | `el-icon-s-tools` | `settings` | +| 73 | `/system` | 系统 | `el-icon-s-tools` | `system` | +| 519 | `afterSale` | 售后 | `null` | `after-sale` | +| 492 | `/inbox` | 消息 | `null` | `inbox-message` | +| 50 | `/auth/approve` | 成员加入审核 | `null` | `user-check` | +| 6 | `account` | 账号管理 | `user` | `user`(不变) | +| 5 | `permission` | 权限管理 | `setting` | `permission` | +| 7 | `role` | 角色管理 | `role` | `role`(补文件) | +| 29 | `materialInfo` | 物料资料 | `el-icon-info` | `material-info` | + +> `720` 行之外的其他 `web_pages` 子菜单当前无图标,可按需逐步补充,不影响本方案实施。 + +--- + +## 三、迁移 SQL + +### 3.1 前置检查 + +```sql +-- 迁移前快照(便于回滚比对) +SELECT id, path, meta_title, meta_icon +FROM wms_permission +WHERE type = 'web_pages' AND meta_icon IS NOT NULL AND meta_icon <> '' +ORDER BY id; +``` + +### 3.2 正向迁移 + +```sql +UPDATE wms_permission SET meta_icon = 'order' WHERE id = 1 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'goods' WHERE id = 13 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'storage' WHERE id = 18 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'material' WHERE id = 15 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'warehouse-grid' WHERE id = 14 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'data-chart' WHERE id = 16 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'store-owner' WHERE id = 17 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'warehouse' WHERE id = 393 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'express-truck' WHERE id = 19 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'finance' WHERE id = 28 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'video-camera' WHERE id = 47 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'settings' WHERE id = 4 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'system' WHERE id = 73 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'after-sale' WHERE id = 519 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'inbox-message' WHERE id = 492 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'user-check' WHERE id = 50 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'permission' WHERE id = 5 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'role' WHERE id = 7 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'material-info' WHERE id = 29 AND type = 'web_pages'; +-- 账号管理 id = 6 保持 'user' 不变 +``` + +> 全部带 `id + type` 双重条件,避免误伤其他端(`pda_pages` / `miniprogram_pages`)。 + +### 3.3 回滚 + +```sql +UPDATE wms_permission SET meta_icon = '' WHERE id = 1 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'el-icon-s-goods' WHERE id = 13 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'el-icon-s-data' WHERE id = 18 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'el-icon-s-cooperation' WHERE id = 15 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'el-icon-s-grid' WHERE id = 14 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'el-icon-s-marketing' WHERE id = 16 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'el-icon-s-custom' WHERE id = 17 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'el-icon-s-custom' WHERE id = 393 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'el-icon-truck' WHERE id = 19 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'el-icon-s-finance' WHERE id = 28 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'el-icon-video-camera-solid' WHERE id = 47 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'el-icon-s-tools' WHERE id = 4 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'el-icon-s-tools' WHERE id = 73 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = NULL WHERE id = 519 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = NULL WHERE id = 492 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = NULL WHERE id = 50 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'setting' WHERE id = 5 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'role' WHERE id = 7 AND type = 'web_pages'; +UPDATE wms_permission SET meta_icon = 'el-icon-info' WHERE id = 29 AND type = 'web_pages'; +``` + +### 3.4 迁移后校验 + +```sql +-- 应无 el-icon-* 残留(web_pages) +SELECT id, path, meta_icon FROM wms_permission +WHERE type = 'web_pages' AND meta_icon LIKE 'el-icon-%'; + +-- 列出所有在用的图标名,逐个核对 svg 文件是否齐全 +SELECT meta_icon, COUNT(*) AS used_by +FROM wms_permission +WHERE type = 'web_pages' AND meta_icon IS NOT NULL AND meta_icon <> '' +GROUP BY meta_icon ORDER BY meta_icon; +``` + +--- + +## 四、组件改造方案 + +### 4.1 `SvgIcon` 增加兜底与告警 + +`src/components/SvgIcon/index.vue` + +现状:icon 不存在时静默渲染空白,**无法发现问题**。 + +改造要点: + +| 项 | 做法 | +|---|---| +| 兜底图标 | 新增 `fallback` prop,默认 `unknown`;symbol 不存在时显示它 | +| 存在性检测 | 检测 `#icon-{name}` 是否存在于 sprite(结果按名字缓存,避免重复查询 DOM) | +| 开发期告警 | `import.meta.env.DEV` 下 `console.warn('[svg-icon] 图标不存在: xxx')` | +| 保持兼容 | `iconClass` 为空或外部链接时行为不变 | + +伪代码: + +```ts +const iconExists = computed(() => { + if (!props.iconClass || isExternal.value) return true + if (cache.has(props.iconClass)) return cache.get(props.iconClass)! + const ok = !!document.getElementById(`icon-${props.iconClass}`) + cache.set(props.iconClass, ok) + if (!ok && import.meta.env.DEV) console.warn(`[svg-icon] 图标不存在: ${props.iconClass}`) + return ok +}) +const finalIcon = computed(() => (iconExists.value ? props.iconClass : props.fallback)) +``` + +> 注意:缓存要在 sprite 注册完成后才有意义,首次调用前需确保 `virtual:svg-icons-register` 已执行(入口已保证)。 + +### 4.2 权限页图标列表改为动态生成 + +`src/views/system/setting/permission/index.vue` + +现状:`iconList` 硬编码 16 个字符串,其中 `shopping-cart`、`skill`、`star`、`zip` **文件不存在**,`user` 重复两次。 + +改造: + +```ts +const svgModules = import.meta.glob('@/icons/svg/*.svg') +const iconList = Object.keys(svgModules) + .map((p) => p.split('/').pop()!.replace(/\.svg$/, '')) + .sort() +``` + +收益: + +- 新增图标文件后**自动出现在下拉里**,无需改代码 +- 彻底消除「列表与实际资源漂移」 +- 重复项自动去重 + +### 4.3 图标选择器开放到 `web_pages` + +现状:`meta_icon` 输入块被 `v-if="tempCreate.type === 'pda_pages'"` 限制,**web 菜单在界面上无法配置图标**。 + +改造:条件放宽为 + +```vue +v-if="tempCreate.type === 'web_pages' || tempCreate.type === 'pda_pages'" +``` + +同步修改编辑弹窗(`tempUpdate`)中的同一处。 + +### 4.4 可选:抽 `IconPicker` 组件 + +如果后续多个页面都要选图标,把「下拉 + 预览 + 搜索」抽成 `src/components/IconPicker/index.vue`: + +| prop | 说明 | +|---|---| +| `modelValue` | 图标名 | +| `clearable` | 是否可清空 | +| `placeholder` | 占位文案 | + +内部复用动态生成的 `iconList`,下拉项左侧渲染 `svg-icon` 预览。 + +--- + +## 五、实施步骤 + +| 步骤 | 内容 | 影响面 | 可独立上线 | +|---|---|---|---| +| 1 | 落地 19 个 svg 文件到 `src/icons/svg/` | 仅新增资源 | ✅ | +| 2 | `SvgIcon` 加兜底 + DEV 告警 | 全局组件 | ✅ | +| 3 | `iconList` 改为 `import.meta.glob` 动态生成 | 权限页 | ✅ | +| 4 | 图标选择器开放 `web_pages` | 权限页 | ✅ | +| 5 | 执行迁移 SQL | 数据 | ✅(建议与 1 同批) | +| 6 | 校验:菜单逐项检查 + 无 `el-icon-*` 残留 | — | — | + +> 步骤 1 与 5 必须同批发布,否则会出现「数据改了但图标文件没有」的空白期。 + +--- + +## 六、风险与注意事项 + +| 风险 | 说明 | 应对 | +|---|---|---| +| 图标文件缺失 | 数据先改、文件未发 → 菜单空白 | 步骤 1 先于 5,或同批 | +| 首页首屏体积 | 每个 svg 会被打进 sprite(内联) | 单个 svg 控制在 2KB 内,统一 `viewBox="0 0 24 24"` | +| 颜色失效 | 图标自带 `fill` 会覆盖 `currentColor` | svg 内**不要写死 `fill`**,统一用 `fill="currentColor"` 或不写 | +| 线宽不一致 | 不同来源图标混用视觉杂乱 | 统一同一图标集(建议全用 Tabler 或全用 MDI) | +| 其他端受影响 | `pda_pages` / `miniprogram_pages` 同字段 | 迁移 SQL 全部限定 `type='web_pages'` | +| 权限数据多环境 | 各环境 `id` 可能不同 | 优先按 `id + path` 双条件,或按 `path` 匹配后再核对 | + +--- + +## 七、待确认 + +1. 图标风格选哪套?(建议全量统一 Tabler,线条风格与现有 UI 最协调) +2. 是否需要我一并生成 19 个 svg 文件? +3. `pda_pages` / `miniprogram_pages` 的图标是否也纳入统一命名(本次只动 web)? diff --git a/docs/顶部区域-结构分析与优化方案.md b/docs/顶部区域-结构分析与优化方案.md new file mode 100644 index 00000000..27f4f212 --- /dev/null +++ b/docs/顶部区域-结构分析与优化方案.md @@ -0,0 +1,407 @@ +# 顶部区域结构分析与优化方案 + +> 状态:**仅分析,未改代码** +> 范围:`layout`(框架层)+ 各业务页面的「顶部标签区 / 页面容器高度」 +> 目标:**不改变最终视觉**,优化结构、提升响应速度、消除样式遗留问题 + +--- + +## 一、现状结构 + +### 1.1 渲染层级 + +``` +layout/index.vue (.app-wrapper) +├─ Sidebar +└─ .main-container + ├─ .fixed-header ← position: fixed,高度由内容撑开 + │ └─ TaskView/index.vue + │ ├─ .navbar-wrapper Navbar.vue + │ ├─ .shortcut-panel 快捷入口(仅展开时渲染) + │ │ ├─ .shortcut-toggle--expanded 20×10 浮层按钮 + │ │ └─ .shortcut-key 入口按钮行 + │ ├─ .shortcut-toggle--collapsed 收起态小条 + │ ├─ ScrollPane .tags-view-wrapper 已打开页面标签 + │ └─ .contextmenu + ├─ .fixed-header-spacer ← 高度 = 实测 headerHeight + └─ .main-box + ├─ AppMain.vue ← padding: 20px + │ └─ .app-main__body → router-view + keep-alive + └─ .ai-container +``` + +### 1.2 三种「标签」必须区分清楚 + +这是大量沟通成本和样式冲突的根源: + +| 概念 | 所在层 | 实现 | 驱动 | +|---|---|---|---| +| **A. 已打开页面标签** | 框架层(全局) | TaskView 的 `.tags-view-wrapper` | route / tagsView store | +| **B. 快捷入口** | 框架层(全局) | TaskView 的 `.shortcut-key` | shortcuts store | +| **C. 页面内业务标签** | 页面层 | 各页 `el-tabs.tab-container` | 页面本地状态 | + +「页面标签和底下页面之间有条细线」中的「页面标签」实际指 **C**(页内标签), +而「打开页面的标签」是 **A**。两者样式相近但归属完全不同,改动时极易混淆。 + +### 1.3 高度链路(当前) + +``` +真实高度 = Navbar(≈45) + 快捷区(0 或 ≈36) + 标签行(≈38) + = 收起 ≈93 / 展开 ≈119 + +app-main 可用高度 = 100vh - headerHeight - 40 (上下 padding 20×2) + = 100vh - 133(收起) / 100vh - 159(展开) +``` + +而业务页面里普遍写的是: + +```ts +const containerHeight = computed(() => + shortcutExpanded.value ? 'calc(100vh - 150px)' : 'calc(100vh - 100px)' +) +``` + +**差值为 33px / 9px**,这组魔法数已经与真实布局脱节。 + +--- + +## 二、已定位的问题清单 + +### P0-1 · `containerHeight` 在 30+ 页面重复硬编码 + +出现位置(部分): + +``` +order/waveOrder、order/orderManagement、warehouses、afterSale/list、 +afterSale/typelist、express/waybill、data/returnrecord、data/ordersummary、 +message、mode、material/packageSupplier、material/packageMaterial、 +storage/inventory、storage/stockout、storage/entry、storage/log、 +storage/receiving、storage/receiving_owner、storage/report、 +storage/report/store、storage/generalreport、storage/stockcheck、 +storage/productflow、storage/productflow/store、 +system/setting/workbench2、system/setting/miniprogram、 +system/setting/storeExpressBindingPolicy、video/newcamara、 +video/newcamaraserver … +``` + +影响: + +- **一改顶部,30+ 页面全部错位**。本轮快捷区高度从 46px → 36px,这批页面的可用高度就全错了 10px。 +- 数值本身不统一,且与真实布局不符。 +- 每个页面都依赖 `settingsStore.shortcutExpanded`,展开/收起会触发所有已挂载页面(含 keep-alive 缓存页)重新计算与重渲染。 + +### P0-2 · dashboard 高度声明自相矛盾 + +`src/views/dashboard/index.vue` + +```css +.dashboard-container { + padding: 20px; + background-color: #f5f7fa; + min-height: calc(100vh - 84px); + height: 100px; /* ← 遗留:与 min-height / flex: 1 冲突 */ + flex: 1; + overflow-y: auto; +} +``` + +`height: 100px` 与 `min-height: calc(100vh - 84px)`、`flex: 1` 三者互相打架。 +其中 `84px` 也是旧版 header 高度(当前为 ≈93),属于同一批遗留魔法数。 + +### P0-3 · `TabArea` 组件被复制 8 份 + +已存在同名组件副本: + +``` +views/afterSale/typelist/components/TabArea.vue +views/express/waybill/components/TabArea.vue +views/mode/components/TabArea.vue +views/data/ordersummary/components/TabArea.vue +views/storage/generalreport/components/TabArea.vue +views/storage/stockcheck/components/TabArea.vue +views/video/newcamaraserver/components/TabArea.vue +views/system/setting/workbench2/components/TabArea.vue +``` + +每份都带一套 `.tab-container` 的 `:deep()` 覆盖样式。 +改一次样式要改 8 处,且已经出现版本漂移风险。 + +### P0-4 · `type="border-card"` 自带外壳 + +所有页内 `el-tabs` 都用了 `type="border-card"`,Element Plus 默认为它加上: + +```css +.el-tabs--border-card { + border: 1px solid var(--el-border-color-light); + box-shadow: 0 2px 4px 0 rgba(0,0,0,.12), 0 0 6px 0 rgba(0,0,0,.04); + background: #fff; +} +``` + +而外层 `.tab-section` **自己也画了 border + box-shadow**。 +两层外壳叠加 → 标签区下方投影出一条淡灰色细线。 +(控制台页面没有 `el-tabs`,所以看不到该现象。) + +### P1-5 · 「标签↔内容」分隔线来源不唯一 + +同一条视觉分界线,可能来自四处的任意组合: + +1. `.tab-section` 的 `border` +2. `.el-tabs--border-card` 的 `border` / `box-shadow` +3. `.el-tabs__header.is-top` 的 `border-bottom` +4. `.main-container` 的 `border-top` + +**没有唯一定义方**,所以每修一次都可能从别处冒出第二条线。 + +### P1-6 · `.tab-section` / `.main-container` 样式重复定义 + +除 `TabArea.vue` 外,页面主文件里还有多份 `.tab-section` 定义 +(waveOrder、orderManagement、afterSale/typelist、data/returnrecord、mode、 +data/ordersummary、video/newcamara、video/newcamaraserver、storage/generalreport、 +storage/stockcheck、system/setting/workbench2 …),且细节不完全一致。 + +### P1-7 · tags-view 每次路由变化全量重建 + +`TaskView/index.vue`: + +- `v-for="tag in visitedViews"`,`:key="tag.path"` +- `onBeforeUpdate` 清空 `tagsRef` +- `moveToCurrentTag()` 在 `nextTick` 中遍历全部标签定位 + +标签较多时(20+),每次切页都走一遍全量 diff + 全量遍历。 +另外 `visitedViews` 是普通数组,任一标签增删都会让整个列表重新求值。 + +### P2-8 · 顶部高度曾有硬编码(本轮已修) + +已改为 `ResizeObserver` 实测 + `--app-header-height` CSS 变量, +不再是 `134 / 97`。但**消费端尚未跟进**(见 P0-1)。 + +--- + +## 三、优化方案(不改最终视觉) + +### 方案 A · 顶部高度单一事实源(根本解,优先级最高) + +已具备条件:`layout/index.vue` 已把实测高度写入: + +```css +:root { --app-header-height: 93px; } /* 由 ResizeObserver 实时更新 */ +``` + +两条落地路径,任选其一: + +**A-1(推荐)· 页面不再算高度** + +让 `app-main` 用 flex 撑满,页面根容器写 `height: 100%`: + +```css +.app-main__body :deep(.app-router-page) { flex: 1; min-height: 0; } +``` + +页面根容器删掉 `:style="{ height: containerHeight }"`,改 `height: 100%`。 +好处:**页面不再需要知道顶部多高**,顶部怎么改都不影响业务页。 + +**A-2 · 保留显式高度,但统一口径** + +提供 composable: + +```ts +// src/composables/usePageHeight.ts +export function usePageHeight(bottomPadding = 40) { + return computed(() => `calc(100vh - var(--app-header-height) - ${bottomPadding}px)`) +} +``` + +30+ 页面逐个替换为 `usePageHeight()`。 + +> A-1 更彻底(去掉契约),A-2 改动更小(保留契约)。 +> 建议先做 A-1 的公共容器改造,再逐步删页面里的 `containerHeight`。 + +### 方案 B · `TabArea` 收敛为全局组件 + +目标:`src/components/TabArea/index.vue`,props: + +| prop | 说明 | +|---|---| +| `tabs` | `{ name, label }[]` | +| `defaultActive` | 初始标签 | +| `sortable` | 是否显示排序入口 | +| `actions` | 右侧操作区插槽 | + +内置正确的样式(不依赖 `border-card` 自带外壳),8 份副本删除,页面改为引用。 + +### 方案 C · 分隔线职责唯一化 + +立约定,只保留一处: + +- `.tab-section` → **只负责左右和顶部边框 + 圆角** +- `.el-tabs--border-card` → `border: none; box-shadow: none; background: transparent` +- `.el-tabs__header.is-top` → **唯一负责** `border-bottom`(标签与内容的分界线) +- `.main-container` → `border-top: none` + +激活标签通过 `box-shadow: 0 1px 0 #fff` 遮住这条线,实现「标签与内容连通」。 + +### 方案 D · tags-view 渲染优化(收益中等) + +1. 把单个标签抽成 `TagItem` 子组件,配 `v-memo="[tag.path, isActive]"`,避免无关标签重渲染。 +2. `moveToCurrentTag` 只在 `route.path` 变化时执行(现在 `watch(route)` 是全量对象)。 +3. `visitedViews` 增删用 `findIndex` 替代 `some + push` 的两次遍历(次要)。 + +### 方案 E · 清理遗留魔法数 + +- `dashboard`:删 `height: 100px`,`min-height` 改用 `var(--app-header-height)` 或直接交给 flex。 +- 其余页面里的 `84 / 97 / 100 / 134 / 150` 一并纳入 A 方案统一处理。 + +--- + +## 四、建议实施顺序 + +| 阶段 | 内容 | 风险 | 预期收益 | +|---|---|---|---| +| 1 | 方案 C(分隔线唯一化)+ P0-4 | 低 | 消除细线类问题 | +| 2 | 方案 B(TabArea 收敛) | 中 | 8 处样式→1 处 | +| 3 | 方案 A-1(app-main 撑满,页面 `height: 100%`) | 中高 | 根除高度错位 | +| 4 | 方案 A-2 兜底(`usePageHeight`)+ 清理 30+ 处 | 中 | 兼容暂不改造的页面 | +| 5 | 方案 D(tags-view 渲染优化) | 低 | 切页更顺 | +| 6 | 方案 E(遗留魔法数清理) | 低 | 减少技术债 | + +> 阶段 1 可以立刻做,改动小、视觉无变化、直接解决当前细线问题。 + +--- + +## 五、需要确认的决策点 + +1. **页面高度契约**:选 A-1(页面 `height: 100%`,去掉 vh 计算)还是 A-2(统一 `usePageHeight`)? +2. **TabArea 是否统一带排序入口**?当前只有 order / waveOrder 有,其余页面没有。 +3. **`type="border-card"` 是否保留**?保留则需要全局覆盖其外壳;去掉则要确认视觉无变化。 +4. **是否接受 `app-main` 的 `padding: 20px` 改为可选**(dashboard 需要灰底铺满,其他页面需要留白)? + +--- + +# 六、实施记录(已完成) + +> 结论先行:**页面高度不再由页面自己算,标签视觉统一到 order 卡片式,8+ 份重复组件收敛为 1 份。** + +## 6.1 顶部表头高度:从「猜」改为「测」 + +**`src/layout/index.vue`** + +| 改动 | 说明 | +|---|---| +| 新增 `headerRef` + `ResizeObserver` | 实测 `.fixed-header` 的 `offsetHeight` | +| `headerHeight` 由 `ref` 提供 | 删除原来的 `134 / 97` 两个魔法数 | +| `.fixed-header-spacer` 高度 = 实测值 | 占位块永远等于真实表头高度 | +| `.ai-container` 的 `top` / `height` = 实测值 | AI 浮层不再自己猜顶部高度 | +| 写入 `--app-header-height` | 实测值同步到 `document.documentElement`,供任意页面复用 | +| 删除未使用的 `shortcutExpanded` | 布局层不再需要知道快捷区状态 | + +效果:快捷区展开/收起、切换语言导致导航换行、调整导航高度,占位与浮层都自动跟随,**不会再出现缝隙或遮挡**。 + +**`src/layout/component/AppMain.vue`** + +- 删除 `.fixed-header + .app-main { padding-top: 90px }` + (中间隔着 spacer,该选择器从未命中,属于历史死规则) + +## 6.2 快捷入口区结构 + +**`src/layout/component/TaskView/index.vue`** + +展开态: + +``` +.shortcut-panel +├─ .shortcut-toggle--expanded ← 20×10 浮层按钮(absolute) +└─ .shortcut-key ← 入口按钮行 +``` + +收起态:`.shortcut-toggle--collapsed`(缩进小条,视觉不变) + +| 改动 | 说明 | +|---|---| +| 展开按钮改为 `position: absolute; top: 0; left: 50%` | **不参与布局**,不撑高容器 | +| 按钮尺寸固定 20×10 | 不再铺满整条 | +| 删除重复的一份 `.shortcut-toggle` / `.shortcut-key` 定义 | 原来有两套样式同时存在 | +| `shortcut-panel` 的 padding 改为 `10px 12px 6px` | 上方 10px 正好容纳按钮,按钮下沿与入口行上沿相接 | + +## 6.3 页面内标签:分隔线唯一化 + 视觉统一 + +**新增 `src/styles/tab-area.scss`**,在 `src/styles/index.scss` 引入。 + +职责约定(解决「一条线四个来源」的问题): + +| 元素 | 职责 | +|---|---| +| `.tab-section` | 只负责左右 + 顶部边框、圆角 | +| `.el-tabs--border-card` | **不画**边框、阴影、背景 | +| `.el-tabs__header.is-top` | **唯一**负责 `border-bottom` | +| `.main-container` | 不再重复画 `border-top` | +| 激活标签 | `box-shadow: 0 1px 0 #fff` 盖住分隔线,实现「标签与内容连通」 | + +同时把「下划线式」统一为 order 卡片式: + +| 属性 | 统一前 | 统一后 | +|---|---|---| +| 标签高度 | 38px | **34px** | +| 标签字号 | 14px | **13px** | +| 左右内边距 | 20px | **16px** | +| 标签圆角 | 6px | **8px** | +| 标签底色/边框 | 透明边框 | **`#edf3fb` + `#e6edf8`** | +| 激活色 | `#409eff` | **`#2f80ed`** | +| 激活态 | 白色 2px 下边 + 上移 | **白底卡片 + 8px 圆点** | +| 底部活动条 | 2px 蓝条 | **隐藏** | + +> 不覆盖 `padding-left`:各页面按「是否显示排序入口」自行保留 12px / 46px 左留白。 + +## 6.4 TabArea 组件收敛 + +**新增 `src/components/TabArea/index.vue`** + +- 视觉基准 = `order/orderManagement`、`order/waveOrder` +- 排序入口:`v-if="tabs.length > 1"`,**单页签页面不显示** +- 排序结果按账号存本地,**组件内部自行重排**,父组件无需感知顺序 +- scope 未传时按 `tab-order:${route.path}` 自动生成,避免页面间串数据 + +**收敛结果** + +| 项 | 数量 | +|---|---| +| 删除的本地 `TabArea.vue` 副本 | **11 份** | +| 改指向全局组件的页面 | **11 个** | +| 顺带修复 | `express/waybill` 用了 `` 却从未 import(该页标签区此前渲染不出来) | + +## 6.5 页面高度契约改造 + +| 原写法 | 处理 | 数量 | +|---|---|---| +| `containerHeight = calc(100vh - 150px/100px)` | 改为 `'100%'`,由布局层提供高度 | **43 处** | +| `height: calc(100vh - 130px)` | 改为 `height: 100%` | 2 处 | +| `min-height: calc(100vh - 84px)` | 改为 `min-height: 0` | 1 处 | +| `height: calc(100vh - 84px)` | 改为 `height: 100%` | 1 处 | +| dashboard `height: 100px` + `min-height: calc(...)` | 删除,改为 `flex: 1; min-height: 0` | 1 处 | +| 已无用的 `shortcutExpanded` 声明 | 删除 | 43 处 | + +> 过程中批量正则误伤了 `TaskView` 里仍在使用的 `shortcutExpanded`,已恢复并重新构建验证。 + +## 6.6 打开页面的标签(tags-view)渲染优化 + +- 每个标签加 `v-memo="[tag.path, tag.fullPath, isActive(tag)]"`,无关标签跳过重渲染 +- `watch(route)` 收窄为 `watch(() => route.fullPath)`,减少无谓触发 +- `ScrollPane` 隐藏横向滚动条(`el-scrollbar__bar` + 原生滚动条) + +## 6.7 验证 + +| 检查 | 结果 | +|---|---| +| `npm run build` | 通过,退出码 0 | +| `get_errors` 全量 | 无错误 | +| `calc(100vh - 150/100/130/84px)` 残留 | 0(仅剩注释) | +| 本地 `TabArea.vue` 副本 | 0 | + +## 6.8 遗留事项 + +| 项 | 状态 | 说明 | +|---|---|---| +| `storage/generalreport` | 待定 | 有页面文件与 router 映射,但后台无菜单;确认不用可整体删除 | +| `data/returnrecord` / `stock/stockManagement` / `system/setting/encoding` | 未迁移 | 仍内联 `el-tabs`(有 `before-leave`、自定义排序 scope 等差异),目前靠全局样式统一外观 | +| 各页面 scoped 里的重复 tab 样式 | 未删除 | 已被全局规则覆盖,可后续清理 | +| 未使用的 `useSettingsStore` import | 未清理 | 构建无影响,属 lint 级冗余 | diff --git a/package-lock.json b/package-lock.json index 0132e9e4..04b98738 100644 --- a/package-lock.json +++ b/package-lock.json @@ -56,6 +56,8 @@ "sass": "^1.97.3", "typescript": "~5.9.3", "typescript-eslint": "^8.58.2", + "unplugin-auto-import": "^21.1.0", + "unplugin-vue-components": "^32.1.0", "vite": "^7.3.1", "vite-plugin-svg-icons": "^2.0.1", "vite-plugin-vue-devtools": "^8.0.6", @@ -553,7 +555,6 @@ "cpu": [ "ppc64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -570,7 +571,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -587,7 +587,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -604,7 +603,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -621,7 +619,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -638,7 +635,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -655,7 +651,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -672,7 +667,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -689,7 +683,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -706,7 +699,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -723,7 +715,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -740,7 +731,6 @@ "cpu": [ "loong64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -757,7 +747,6 @@ "cpu": [ "mips64el" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -774,7 +763,6 @@ "cpu": [ "ppc64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -791,7 +779,6 @@ "cpu": [ "riscv64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -808,7 +795,6 @@ "cpu": [ "s390x" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -825,7 +811,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -842,7 +827,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -859,7 +843,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -876,7 +859,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -893,7 +875,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -910,7 +891,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -927,7 +907,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -944,7 +923,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -961,7 +939,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -978,7 +955,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1267,9 +1243,9 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { @@ -1324,7 +1300,6 @@ "version": "2.5.6", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.6.tgz", "integrity": "sha512-tmmZ3lQxAe/k/+rNnXQRawJ4NjxO2hqiOLTHvWchtGZULp4RyFeh6aU4XdOYBFe2KE1oShQTv4AblOs2iOrNnQ==", - "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, @@ -1364,7 +1339,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1385,7 +1359,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1406,7 +1379,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1427,7 +1399,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1448,7 +1419,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1469,7 +1439,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1490,7 +1459,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1511,7 +1479,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1532,7 +1499,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1553,7 +1519,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1574,7 +1539,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1595,7 +1559,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1616,7 +1579,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1662,7 +1624,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1676,7 +1637,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1690,7 +1650,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1704,7 +1663,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1718,7 +1676,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1732,7 +1689,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1746,7 +1702,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1760,7 +1715,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1774,7 +1728,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1788,7 +1741,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1802,7 +1754,6 @@ "cpu": [ "loong64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1816,7 +1767,6 @@ "cpu": [ "loong64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1830,7 +1780,6 @@ "cpu": [ "ppc64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1844,7 +1793,6 @@ "cpu": [ "ppc64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1858,7 +1806,6 @@ "cpu": [ "riscv64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1872,7 +1819,6 @@ "cpu": [ "riscv64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1886,7 +1832,6 @@ "cpu": [ "s390x" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1900,7 +1845,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1914,7 +1858,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1928,7 +1871,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1942,7 +1884,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1956,7 +1897,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1970,7 +1910,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1984,7 +1923,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1998,7 +1936,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2040,7 +1977,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/@types/js-cookie": { @@ -2077,7 +2014,7 @@ "version": "24.11.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.11.0.tgz", "integrity": "sha512-fPxQqz4VTgPI/IQ+lj9r0h+fDR66bzoeMGHp8ASee+32OSGIkeASsoZuJixsQoVef1QJbeubcPBxKk22QVoWdw==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "undici-types": "~7.16.0" @@ -2749,6 +2686,7 @@ "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-14.2.1.tgz", "integrity": "sha512-3vwDzV+GDUNpdegRY6kzpLm4Igptq+GA0QkJ3W61Iv27YWwW/ufSlOfgQIpN6FZRMG0mkaz4gglJRtq5SeJyIQ==", "license": "MIT", + "peer": true, "dependencies": { "@types/web-bluetooth": "^0.0.21", "@vueuse/metadata": "14.2.1", @@ -2790,9 +2728,9 @@ "license": "BSD-3-Clause" }, "node_modules/acorn": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", - "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz", + "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==", "license": "MIT", "peer": true, "bin": { @@ -3573,9 +3511,9 @@ } }, "node_modules/confbox": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.4.tgz", - "integrity": "sha512-ysOGlgTFbN2/Y6Cg3Iye8YKulHw+R2fNXHrgSmXISQdMnomY6eNDprVdW9R5xBguEqI954+S6709UyiO7B+6OQ==", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.3.2.tgz", + "integrity": "sha512-ZUAKhKlkCOrIGKc8cj7zek9s9z1mveHif/25nUshI2BzCRzF7KH7KHa+Lnh2ubq+e1tIlaFuP763mzW4qVoehg==", "license": "MIT" }, "node_modules/convert-source-map": { @@ -4032,7 +3970,6 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", - "dev": true, "license": "Apache-2.0", "optional": true, "engines": { @@ -4431,7 +4368,7 @@ "version": "0.27.3", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz", "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==", - "dev": true, + "devOptional": true, "hasInstallScript": true, "license": "MIT", "bin": { @@ -4809,9 +4746,9 @@ "license": "MIT" }, "node_modules/exsolve": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.0.8.tgz", - "integrity": "sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.2.0.tgz", + "integrity": "sha512-h1pQPR9XoeSMdntRNCjyTznaume4UpfXrULBnlkZ2CUM/G5eSa+pBByGldO5uR8dxbPC+OuJXsPPNf+JZ81ADg==", "license": "MIT" }, "node_modules/extend-shallow": { @@ -5092,7 +5029,6 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, @@ -5533,7 +5469,7 @@ "version": "5.1.5", "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.5.tgz", "integrity": "sha512-t7xcm2siw+hlUM68I+UEOK+z84RzmN59as9DZ7P1l0994DKUWV7UXBMQZVxaoMSRQ+PBZbHCOoBt7a2wxOMt+A==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/imurmurhash": { @@ -5764,7 +5700,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -5819,7 +5755,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" @@ -6313,9 +6249,9 @@ } }, "node_modules/local-pkg": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-1.1.2.tgz", - "integrity": "sha512-arhlxbFRmoQHl33a0Zkle/YWlmNwoyt6QNZEIJcqNbdrsix5Lvc4HyyI3EnwxTYlZYc32EbYrQ8SzEZ7dqgg9A==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-1.2.1.tgz", + "integrity": "sha512-++gUqRDEvcnN6Zhqrr+y/CkVEHhlrR96vZn3nZZPYzMcBUyBtTKzB9NadClFIsIVSsu+3i9tfk/erqy9kAmt7Q==", "license": "MIT", "dependencies": { "mlly": "^1.7.4", @@ -6596,15 +6532,15 @@ } }, "node_modules/mlly": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.0.tgz", - "integrity": "sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.2.tgz", + "integrity": "sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==", "license": "MIT", "dependencies": { - "acorn": "^8.15.0", + "acorn": "^8.16.0", "pathe": "^2.0.3", "pkg-types": "^1.3.1", - "ufo": "^1.6.1" + "ufo": "^1.6.3" } }, "node_modules/mlly/node_modules/confbox": { @@ -6760,7 +6696,6 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", - "dev": true, "license": "MIT", "optional": true }, @@ -6988,6 +6923,20 @@ "node": ">=0.10.0" } }, + "node_modules/obug": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/obug/-/obug-2.2.1.tgz", + "integrity": "sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/ohash": { "version": "2.0.11", "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.11.tgz", @@ -7155,9 +7104,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", "license": "MIT", "engines": { "node": ">=12" @@ -7202,13 +7151,13 @@ } }, "node_modules/pkg-types": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.0.tgz", - "integrity": "sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.4.0.tgz", + "integrity": "sha512-07Fys7iVx0X6TcviMOgogM1Lk33ZyqOezMnU79S+kffWqwolG/5W9V8EgQSeYCIfFTYVgssRbnH630Oa2+soBA==", "license": "MIT", "dependencies": { - "confbox": "^0.2.2", - "exsolve": "^1.0.7", + "confbox": "^0.3.1", + "exsolve": "^1.1.3", "pathe": "^2.0.3" } }, @@ -7663,7 +7612,7 @@ "version": "4.59.0", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.59.0.tgz", "integrity": "sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@types/estree": "1.0.8" @@ -7845,7 +7794,7 @@ "version": "1.97.3", "resolved": "https://registry.npmjs.org/sass/-/sass-1.97.3.tgz", "integrity": "sha512-fDz1zJpd5GycprAbu4Q2PV/RprsRtKC/0z82z0JLgdytmcq0+ujJbJ/09bPGDxCLkKY3Np5cRAOcWiVkLXJURg==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "chokidar": "^4.0.0", @@ -7866,7 +7815,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "readdirp": "^4.0.1" @@ -7882,7 +7831,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">= 14.18.0" @@ -8536,6 +8485,26 @@ "node": ">=0.10.0" } }, + "node_modules/strip-literal": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-4.0.0.tgz", + "integrity": "sha512-PaqAvfUZKBwc/SLmNZtHmzK+v19Z4O4eS3cKPeGvbIv/U3pnyEq4Tuw3/4v/FwfM8VQaEawsyCcOQ0P+kpwWWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "js-tokens": "^10.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/strip-literal/node_modules/js-tokens": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-10.0.0.tgz", + "integrity": "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==", + "dev": true, + "license": "MIT" + }, "node_modules/superjson": { "version": "2.2.6", "resolved": "https://registry.npmjs.org/superjson/-/superjson-2.2.6.tgz", @@ -8751,13 +8720,13 @@ "license": "MIT" }, "node_modules/tinyglobby": { - "version": "0.2.15", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", - "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", "license": "MIT", "dependencies": { "fdir": "^6.5.0", - "picomatch": "^4.0.3" + "picomatch": "^4.0.4" }, "engines": { "node": ">=12.0.0" @@ -9101,9 +9070,80 @@ "version": "7.16.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", - "dev": true, + "devOptional": true, "license": "MIT" }, + "node_modules/unimport": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/unimport/-/unimport-6.5.0.tgz", + "integrity": "sha512-t0KLJLRbebz3f7NrQe+vy2ObeugVeM1XqI2oeYnauddmHSglYj3U6bxOJ65IbXmOFkcAGFJK2OyGH7aqHPM6Ug==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.18.0", + "escape-string-regexp": "^5.0.0", + "estree-walker": "^3.0.3", + "local-pkg": "^1.2.1", + "magic-string": "^1.2.3", + "mlly": "^1.8.2", + "pathe": "^2.0.3", + "picomatch": "^4.0.7", + "pkg-types": "^2.3.3", + "scule": "^1.3.0", + "strip-literal": "^4.0.0", + "tinyglobby": "^0.2.17", + "unplugin": "^3.3.0", + "unplugin-utils": "^0.3.2" + }, + "engines": { + "node": ">=18.12.0" + }, + "peerDependencies": { + "oxc-parser": "*", + "rolldown": "^1.0.0" + }, + "peerDependenciesMeta": { + "oxc-parser": { + "optional": true + }, + "rolldown": { + "optional": true + } + } + }, + "node_modules/unimport/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/unimport/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/unimport/node_modules/magic-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, "node_modules/union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", @@ -9131,27 +9171,115 @@ } }, "node_modules/unplugin": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-3.0.0.tgz", - "integrity": "sha512-0Mqk3AT2TZCXWKdcoaufeXNukv2mTrEZExeXlHIOZXdqYoHHr4n51pymnwV8x2BOVxwXbK2HLlI7usrqMpycdg==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-3.7.0.tgz", + "integrity": "sha512-GrM2uq3DQo3hvLU2FjeYhooJ8BY9N6j1Fbzgx7Pta3VVJevsD3VP4dPjZkZOS0mLvN8w9zzr9OlP+31bSMyuLw==", "license": "MIT", "dependencies": { "@jridgewell/remapping": "^2.3.5", - "picomatch": "^4.0.3", + "@rolldown/pluginutils": "^1.0.1", + "picomatch": "^4.0.7", "webpack-virtual-modules": "^0.6.2" }, "engines": { "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "@farmfe/core": "*", + "@rsbuild/core": "*", + "@rspack/core": "*", + "bun-types-no-globals": "*", + "esbuild": "*", + "rolldown": "*", + "rollup": "*", + "unloader": "*", + "vite": "*", + "webpack": "*" + }, + "peerDependenciesMeta": { + "@farmfe/core": { + "optional": true + }, + "@rsbuild/core": { + "optional": true + }, + "@rspack/core": { + "optional": true + }, + "bun-types-no-globals": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "rolldown": { + "optional": true + }, + "rollup": { + "optional": true + }, + "unloader": { + "optional": true + }, + "vite": { + "optional": true + }, + "webpack": { + "optional": true + } + } + }, + "node_modules/unplugin-auto-import": { + "version": "21.1.0", + "resolved": "https://registry.npmjs.org/unplugin-auto-import/-/unplugin-auto-import-21.1.0.tgz", + "integrity": "sha512-EzrSqWIBulEqCuP7idADXH+tVKYrbwKlR5+r/lOWik0o+Ksny1kitmtryHGNSv7puzzORlcIwT/x2JStiszlHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "local-pkg": "^1.2.1", + "magic-string": "^1.1.0", + "picomatch": "^4.0.5", + "unimport": "^6.4.0", + "unplugin": "^3.3.0", + "unplugin-utils": "^0.3.2" + }, + "engines": { + "node": ">=20.19.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@nuxt/kit": "^4.0.0", + "@vueuse/core": "*" + }, + "peerDependenciesMeta": { + "@nuxt/kit": { + "optional": true + }, + "@vueuse/core": { + "optional": true + } + } + }, + "node_modules/unplugin-auto-import/node_modules/magic-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" } }, "node_modules/unplugin-utils": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/unplugin-utils/-/unplugin-utils-0.3.1.tgz", - "integrity": "sha512-5lWVjgi6vuHhJ526bI4nlCOmkCIF3nnfXkCMDeMJrtdvxTs6ZFCM8oNufGTsDbKv/tJ/xj8RpvXjRuPBZJuJog==", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/unplugin-utils/-/unplugin-utils-0.3.2.tgz", + "integrity": "sha512-xVToRh2CTmLk2HnEG7ac4rl1MJTT3RFkpS8B++/SnB0kXvuaavD+n3m/vrzyWQOdJNSZQACnbz01pnppbwV5BA==", "license": "MIT", "dependencies": { "pathe": "^2.0.3", - "picomatch": "^4.0.3" + "picomatch": "^4.0.4" }, "engines": { "node": ">=20.19.0" @@ -9160,6 +9288,45 @@ "url": "https://github.com/sponsors/sxzz" } }, + "node_modules/unplugin-vue-components": { + "version": "32.1.0", + "resolved": "https://registry.npmjs.org/unplugin-vue-components/-/unplugin-vue-components-32.1.0.tgz", + "integrity": "sha512-YiUkSxuRjab18XFOrX5VsIxXzccrfmHVGsGeJgSgklb829DQmCy9E4vvDUE4tuvZZdxyFJZX0Oc4TPnnxiiMyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chokidar": "^5.0.0", + "local-pkg": "^1.2.0", + "magic-string": "^0.30.21", + "mlly": "^1.8.2", + "obug": "^2.1.1", + "picomatch": "^4.0.4", + "tinyglobby": "^0.2.16", + "unplugin": "^3.0.0", + "unplugin-utils": "^0.3.1" + }, + "engines": { + "node": ">=20.19.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@nuxt/kit": "^3.2.2 || ^4.0.0", + "vue": "^3.0.0" + }, + "peerDependenciesMeta": { + "@nuxt/kit": { + "optional": true + } + } + }, + "node_modules/unplugin/node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "license": "MIT" + }, "node_modules/unset-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", @@ -9315,7 +9482,7 @@ "version": "7.3.1", "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz", "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", - "dev": true, + "devOptional": true, "license": "MIT", "peer": true, "dependencies": { diff --git a/package.json b/package.json index 6ce789ed..12ba85ff 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,8 @@ "sass": "^1.97.3", "typescript": "~5.9.3", "typescript-eslint": "^8.58.2", + "unplugin-auto-import": "^21.1.0", + "unplugin-vue-components": "^32.1.0", "vite": "^7.3.1", "vite-plugin-svg-icons": "^2.0.1", "vite-plugin-vue-devtools": "^8.0.6", diff --git a/src/components/TabArea/index.vue b/src/components/TabArea/index.vue new file mode 100644 index 00000000..f2cba040 --- /dev/null +++ b/src/components/TabArea/index.vue @@ -0,0 +1,274 @@ + + + + + + diff --git a/src/icons/svg/account.svg b/src/icons/svg/account.svg new file mode 100644 index 00000000..19363ec2 --- /dev/null +++ b/src/icons/svg/account.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/after-sale.svg b/src/icons/svg/after-sale.svg new file mode 100644 index 00000000..1d6c90a8 --- /dev/null +++ b/src/icons/svg/after-sale.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/api.svg b/src/icons/svg/api.svg new file mode 100644 index 00000000..91b12adb --- /dev/null +++ b/src/icons/svg/api.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/barcode.svg b/src/icons/svg/barcode.svg new file mode 100644 index 00000000..4b7b8bff --- /dev/null +++ b/src/icons/svg/barcode.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/bill.svg b/src/icons/svg/bill.svg new file mode 100644 index 00000000..65e097a0 --- /dev/null +++ b/src/icons/svg/bill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/cart.svg b/src/icons/svg/cart.svg new file mode 100644 index 00000000..2b27a8fa --- /dev/null +++ b/src/icons/svg/cart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/combo.svg b/src/icons/svg/combo.svg new file mode 100644 index 00000000..d600bfd4 --- /dev/null +++ b/src/icons/svg/combo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/data-chart.svg b/src/icons/svg/data-chart.svg new file mode 100644 index 00000000..ce70eb55 --- /dev/null +++ b/src/icons/svg/data-chart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/erp.svg b/src/icons/svg/erp.svg new file mode 100644 index 00000000..7591e9d7 --- /dev/null +++ b/src/icons/svg/erp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/exception.svg b/src/icons/svg/exception.svg new file mode 100644 index 00000000..2c6a3f86 --- /dev/null +++ b/src/icons/svg/exception.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/expiry.svg b/src/icons/svg/expiry.svg new file mode 100644 index 00000000..8a3a2c9e --- /dev/null +++ b/src/icons/svg/expiry.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/express-truck.svg b/src/icons/svg/express-truck.svg new file mode 100644 index 00000000..aa6dbc8e --- /dev/null +++ b/src/icons/svg/express-truck.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/external.svg b/src/icons/svg/external.svg new file mode 100644 index 00000000..eb1f226b --- /dev/null +++ b/src/icons/svg/external.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/finance.svg b/src/icons/svg/finance.svg new file mode 100644 index 00000000..5b9b1363 --- /dev/null +++ b/src/icons/svg/finance.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/flow.svg b/src/icons/svg/flow.svg new file mode 100644 index 00000000..488aa8e4 --- /dev/null +++ b/src/icons/svg/flow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/goods.svg b/src/icons/svg/goods.svg new file mode 100644 index 00000000..8a742d6b --- /dev/null +++ b/src/icons/svg/goods.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/group.svg b/src/icons/svg/group.svg new file mode 100644 index 00000000..9944228b --- /dev/null +++ b/src/icons/svg/group.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/inbound.svg b/src/icons/svg/inbound.svg new file mode 100644 index 00000000..cca38e5f --- /dev/null +++ b/src/icons/svg/inbound.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/inbox-message.svg b/src/icons/svg/inbox-message.svg new file mode 100644 index 00000000..32481bd7 --- /dev/null +++ b/src/icons/svg/inbox-message.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/list.svg b/src/icons/svg/list.svg new file mode 100644 index 00000000..a6a4a1fb --- /dev/null +++ b/src/icons/svg/list.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/log.svg b/src/icons/svg/log.svg new file mode 100644 index 00000000..697abde4 --- /dev/null +++ b/src/icons/svg/log.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/material-info.svg b/src/icons/svg/material-info.svg new file mode 100644 index 00000000..20c5ebcb --- /dev/null +++ b/src/icons/svg/material-info.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/material.svg b/src/icons/svg/material.svg new file mode 100644 index 00000000..1972aa05 --- /dev/null +++ b/src/icons/svg/material.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/order.svg b/src/icons/svg/order.svg new file mode 100644 index 00000000..49f1bdbb --- /dev/null +++ b/src/icons/svg/order.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/outbound.svg b/src/icons/svg/outbound.svg new file mode 100644 index 00000000..de7a9732 --- /dev/null +++ b/src/icons/svg/outbound.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/package.svg b/src/icons/svg/package.svg new file mode 100644 index 00000000..44cfa5f2 --- /dev/null +++ b/src/icons/svg/package.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/permission.svg b/src/icons/svg/permission.svg new file mode 100644 index 00000000..44f8c777 --- /dev/null +++ b/src/icons/svg/permission.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/pricing.svg b/src/icons/svg/pricing.svg new file mode 100644 index 00000000..aded029f --- /dev/null +++ b/src/icons/svg/pricing.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/printer.svg b/src/icons/svg/printer.svg new file mode 100644 index 00000000..98d8a5d3 --- /dev/null +++ b/src/icons/svg/printer.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/receipt.svg b/src/icons/svg/receipt.svg new file mode 100644 index 00000000..61d237cc --- /dev/null +++ b/src/icons/svg/receipt.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/receivable.svg b/src/icons/svg/receivable.svg new file mode 100644 index 00000000..e09a9afb --- /dev/null +++ b/src/icons/svg/receivable.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/recheck.svg b/src/icons/svg/recheck.svg new file mode 100644 index 00000000..19b60fc9 --- /dev/null +++ b/src/icons/svg/recheck.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/reply.svg b/src/icons/svg/reply.svg new file mode 100644 index 00000000..14a69d49 --- /dev/null +++ b/src/icons/svg/reply.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/return.svg b/src/icons/svg/return.svg new file mode 100644 index 00000000..533cfacc --- /dev/null +++ b/src/icons/svg/return.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/role.svg b/src/icons/svg/role.svg new file mode 100644 index 00000000..087e0fc2 --- /dev/null +++ b/src/icons/svg/role.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/scale.svg b/src/icons/svg/scale.svg new file mode 100644 index 00000000..3bfa32d0 --- /dev/null +++ b/src/icons/svg/scale.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/settings.svg b/src/icons/svg/settings.svg new file mode 100644 index 00000000..318c9c4c --- /dev/null +++ b/src/icons/svg/settings.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/shortage.svg b/src/icons/svg/shortage.svg new file mode 100644 index 00000000..e9af561d --- /dev/null +++ b/src/icons/svg/shortage.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/stocktake.svg b/src/icons/svg/stocktake.svg new file mode 100644 index 00000000..2c882cf5 --- /dev/null +++ b/src/icons/svg/stocktake.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/storage.svg b/src/icons/svg/storage.svg new file mode 100644 index 00000000..9bdf3a1b --- /dev/null +++ b/src/icons/svg/storage.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/store-owner.svg b/src/icons/svg/store-owner.svg new file mode 100644 index 00000000..3d666ebd --- /dev/null +++ b/src/icons/svg/store-owner.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/strategy.svg b/src/icons/svg/strategy.svg new file mode 100644 index 00000000..e442338c --- /dev/null +++ b/src/icons/svg/strategy.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/supplier.svg b/src/icons/svg/supplier.svg new file mode 100644 index 00000000..42697f7b --- /dev/null +++ b/src/icons/svg/supplier.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/system.svg b/src/icons/svg/system.svg new file mode 100644 index 00000000..15b16a32 --- /dev/null +++ b/src/icons/svg/system.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/unpack.svg b/src/icons/svg/unpack.svg new file mode 100644 index 00000000..d3581e54 --- /dev/null +++ b/src/icons/svg/unpack.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/user-check.svg b/src/icons/svg/user-check.svg new file mode 100644 index 00000000..367ed98e --- /dev/null +++ b/src/icons/svg/user-check.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/video-camera.svg b/src/icons/svg/video-camera.svg new file mode 100644 index 00000000..bff696c5 --- /dev/null +++ b/src/icons/svg/video-camera.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/warehouse-grid.svg b/src/icons/svg/warehouse-grid.svg new file mode 100644 index 00000000..43544fce --- /dev/null +++ b/src/icons/svg/warehouse-grid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/warehouse.svg b/src/icons/svg/warehouse.svg new file mode 100644 index 00000000..3cb005dc --- /dev/null +++ b/src/icons/svg/warehouse.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/wave.svg b/src/icons/svg/wave.svg new file mode 100644 index 00000000..391bf4d9 --- /dev/null +++ b/src/icons/svg/wave.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/workbench.svg b/src/icons/svg/workbench.svg new file mode 100644 index 00000000..8da7da84 --- /dev/null +++ b/src/icons/svg/workbench.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/layout/component/AppMain.vue b/src/layout/component/AppMain.vue index 5d62614b..731fcecc 100644 --- a/src/layout/component/AppMain.vue +++ b/src/layout/component/AppMain.vue @@ -93,9 +93,9 @@ function wrapRouteComponent(Component: any, routeName: string | symbol | undefin width: 100%; } -.fixed-header + .app-main { - padding-top: 90px; -} +/* 注:原 `.fixed-header + .app-main { padding-top: 90px }` 已移除。 + 顶部占位现在由 layout/index.vue 的 .fixed-header-spacer(实测高度)负责, + 该选择器因中间隔着 spacer 从未命中,属于遗留死代码。 */ diff --git a/src/layout/component/Sidebar/SubItem.vue b/src/layout/component/Sidebar/SubItem.vue index 810b7592..90a5eaf9 100644 --- a/src/layout/component/Sidebar/SubItem.vue +++ b/src/layout/component/Sidebar/SubItem.vue @@ -6,7 +6,7 @@ {{ tMenu(title) }} -
+
@@ -33,6 +33,14 @@ const props = defineProps({ path: { type: String, default: '' + }, + /** + * 是否显示右侧星标(收藏)按钮。 + * 顶部「更多」下拉里的一级选项关闭该项,其子项仍保留。 + */ + showStar: { + type: Boolean, + default: true } }) @@ -58,6 +66,7 @@ const toggleShortcut = () => { align-items: center; justify-content: space-between; width: 100%; + min-width: 0; } .menu-info { @@ -65,6 +74,8 @@ const toggleShortcut = () => { flex-direction: row; align-items: center; flex: 1; + /* 标题过长时先截断,不挤压右侧星标 */ + min-width: 0; } .menu-icon-wrapper { @@ -73,6 +84,7 @@ const toggleShortcut = () => { align-items: center; justify-content: center; margin-right: 12px; + flex-shrink: 0; } .menu-icon { @@ -83,22 +95,36 @@ const toggleShortcut = () => { .menu-title { font-size: 14px; line-height: 1.2; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } +/* 收藏(星标):独立点击区,不参与标题排版,避免与展开箭头抢位 */ .shortcut-toggle { - padding: 4px; - cursor: pointer; + flex: 0 0 auto; + width: 22px; + height: 22px; display: flex; align-items: center; + justify-content: center; + border-radius: 4px; color: #909399; - transition: color 0.3s; + cursor: pointer; + transition: color 0.2s ease, background-color 0.2s ease; + + :deep(.el-icon) { + font-size: 14px; + } } .shortcut-toggle:hover { - color: #f7ba2a; + color: #2f80ed; + background-color: rgba(47, 128, 237, 0.08); } +/* 已收藏:使用项目主色蓝,与整体配色统一 */ .shortcut-toggle .is-active { - color: #f7ba2a; + color: #2f80ed; } diff --git a/src/layout/component/TaskView/ScrollPane.vue b/src/layout/component/TaskView/ScrollPane.vue index 9e8452c0..3ba732cb 100644 --- a/src/layout/component/TaskView/ScrollPane.vue +++ b/src/layout/component/TaskView/ScrollPane.vue @@ -48,20 +48,26 @@ defineExpose({ height: 100%; :deep(.el-scrollbar__bar) { - bottom: 0px; - height: 4px; + display: none; } :deep(.el-scrollbar__wrap) { - height: 30px; + height: 32px; overflow-x: auto; overflow-y: hidden; + scrollbar-width: none; + -ms-overflow-style: none; + + &::-webkit-scrollbar { + display: none; + } } :deep(.el-scrollbar__view) { - height: 30px; + height: 32px; display: flex; - align-items: center; + /* 标签底边贴住容器底部,与上方按钮下沿对齐 */ + align-items: flex-end; } } diff --git a/src/layout/component/TaskView/index.vue b/src/layout/component/TaskView/index.vue index cf1e6e9e..25a4ab5a 100644 --- a/src/layout/component/TaskView/index.vue +++ b/src/layout/component/TaskView/index.vue @@ -3,42 +3,63 @@ -
- - - - {{ generateTitle(shortcut.title) }} - - + +
+
+ +
+
+ + + + + + {{ generateTitle(shortcut.title) }} + + + +
-
- -
- - +
+ + + {{ generateTitle(tag.name || tag.meta?.title) }} + x + + + +
- {{ generateTitle(tag.name || tag.meta?.title) }} - x - - + +
+
  • {{ $t('common.refresh') || '刷新' }}
  • {{ $t('common.Close') || '关闭' }}
  • @@ -49,7 +70,7 @@ diff --git a/src/views/afterSale/typelist/index.vue b/src/views/afterSale/typelist/index.vue index d4760524..0d15f9ee 100644 --- a/src/views/afterSale/typelist/index.vue +++ b/src/views/afterSale/typelist/index.vue @@ -1,4 +1,4 @@ -