Files
ShiErFeng/shierfeng-fastapi-frontend/scripts/verify-dashboard-contract.mjs
yujiangandClaude Opus 5.5 167df4adb8 Feat: 前端改版 Web 端界面与业务作业流程
按设计稿改版登录后的全部页面,登录页与 Logo 资源未改动。

- 全局外壳:浅色侧边栏与分组菜单、左下角用户卡片、Ctrl/⌘K 搜索面板、
  测试模式提示条、深色模式配色、窄屏适配
- 共用组件:页头 PageHeader、托盘流程条 FlowStepper、扫码反馈 ScanFeedback、
  缩短单号 DocNo、托盘档案链接 PalletCodeLink、图标 SfIcon、上级资料选择
  MasterRefSelect,以及编号段解析等工具
- 工作台重做;新增托盘档案页;托盘追溯增加单托盘入口,报表托盘号可跳转档案
- 基础资料维护:各页加指标条、名称代替 ID、详情面板;三步式批量导入预览;
  分配用户对话框标注增减;7 个新增/编辑对话框统一布局
- 业务管理:发货出库、仓库入库、工厂装填、客户现场使用、退回仓库改为
  列表 + 详情面板 + 全屏作业区;写入流程、幂等键与防串单逻辑保持不变
- 修复入库页扫码反馈条因同名状态变量遮蔽组件而不显示的问题,并新增契约检查
- 新增入库粘贴解析、退回、装填的行为测试与现场使用页新流程测试,
  同步更新业务与工作台契约脚本

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 05:03:22 -07:00

80 lines
2.2 KiB
JavaScript

import test from 'node:test'
import assert from 'node:assert/strict'
import fs from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const scriptDir = path.dirname(fileURLToPath(import.meta.url))
const dashboardPath = path.resolve(scriptDir, '../src/views/dashboard/index.vue')
const dashboardSource = fs.readFileSync(dashboardPath, 'utf8')
test('首页工作台包含扫码入口、流转看板与核心运营模块', () => {
for (const label of [
'扫描托盘码',
'快捷作业',
'新建作业',
'在库托盘',
'客户现场在用',
'今日发货',
'待处理',
'托盘流转',
'装填与发货',
'临期预警',
'仓库库存',
'最近动态',
'仓库入库',
'工厂装填',
'发货出库',
'现场使用',
'退回仓库',
'托盘追溯',
'扫码异常'
]) {
assert.match(dashboardSource, new RegExp(label.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')))
}
})
test('首页不再包含通用模板示例内容', () => {
for (const sample of [
'项目数',
'团队内排名',
'项目访问',
'Alipay',
'Angular',
'Ant Design',
'XX 指数',
'吴彦祖'
]) {
assert.doesNotMatch(dashboardSource, new RegExp(sample.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')))
}
})
test('首页使用现有业务报表接口并保留空状态策略', () => {
for (const dependency of [
'@/api/business/inbound',
'@/api/business/shipment',
'@/api/business/return',
'@/api/report/palletInventory',
'@/api/report/shipment'
]) {
assert.match(dashboardSource, new RegExp(dependency.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')))
}
assert.match(dashboardSource, /暂无扫码异常记录/)
assert.match(dashboardSource, /loadDashboardData/)
})
test('首页快捷入口使用动态菜单注册的页面路径', () => {
for (const route of [
'/businessOperation/inbound',
'/businessOperation/filling',
'/businessOperation/shipment',
'/businessOperation/usage',
'/businessOperation/return',
'/businessReport/palletInventory',
'/businessReport/palletTrace',
'/businessMaster/warehouse'
]) {
assert.match(dashboardSource, new RegExp(route.replace(/[.*+?^${}()|[\\]\\]/g, '\\$&')))
}
})