1d944b0fd32762c1f1d04c63c4af9f4a0af18ea7
Adds a canvas-based SignaturePad component used on the customer confirm page. Authorize now requires a non-empty signature; reject opens a required reason modal. The archived signature is shown to the customer after confirming and on the admin detail page. Also fixes the confirm page being clipped at the top when its content exceeds the viewport: the public layout used height:100vh + overflow:hidden which cropped the centered card. Switched to min-height:100vh so tall content can scroll naturally. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
溯源管理平台 - 前端应用
浙江贝凡溯源管理平台的前端应用,基于 React + TypeScript + Ant Design。
技术栈
- React 19: UI 框
- TypeScript: 类型系统
- Ant Design 6: UI 组件库
- Vite 7: 构建工具
- React Router v7: 路由管理
- Axios: HTTP 客户端
- QRCode: 二维码生成
项目结构
frontend/
├── src/
│ ├── components/ # 通用组件
│ │ ├── AdminLayout.tsx
│ │ └── PublicLayout.tsx # 公开页统一布局(Logo + 备案)
│ ├── pages/ # 页面组件
│ │ ├── Login.tsx
│ │ ├── PublicQuery.tsx
│ │ ├── Dashboard.tsx
│ │ ├── Manage.tsx
│ │ ├── EmployeeSerials.tsx
│ │ ├── Aftersales.tsx # 售后工单列表(管理后台)
│ │ ├── AftersalesDetail.tsx # 售后工单详情(管理后台)
│ │ ├── AftersalesConfirm.tsx # 售后工单扫码确认(公开)
│ │ ├── Users.tsx # 用户管理(仅管理员)
│ │ └── Profile.tsx
│ ├── services/ # API 服务层
│ │ └── api.ts
│ ├── types/ # TypeScript 类型定义
│ │ └── index.ts
│ ├── assets/ # 静态资源
│ ├── styles/ # 样式文件
│ ├── App.tsx # 主应用组件
│ └── main.tsx # 应用入口
├── package.json # 项目配置
├── tsconfig.json # TypeScript 配置
├── vite.config.ts # Vite 配置
└── index.html # HTML 入口
安装
pnpm install
开发
启动开发服务器:
pnpm dev
开发服务器将在 http://localhost:5173 运行
构建
构建生产版本:
pnpm build
预览
预览生产构建:
pnpm preview
环境变量
可以在 .env 文件中配置:
VITE_API_BASE_URL=/api
功能特性
公开页面
- 用户登录
- 公开查询序列号(支持二维码扫描)
- 扫描到
zjbf-sh-*售后码时自动跳转到售后确认页
- 扫描到
- 售后工单确认页(扫码 → 签名画板 → 已授权;或填写退回原因 → 未授权)
管理后台
- 控制台(数据统计)
- 生成二维码和序列号
- 支持自动生成和自定义前缀
- 支持自定义二维码颜色
- 企业管理
- 查看企业详情
- 查看序列号列表
- 吊销企业/序列号
- 查看序列号二维码
- 员工管理(员工赋码生成与维护)
- 售后工单
- 技术员创建工单、填写处理结果、提交客户确认
- 管理员可重新分配技术员或强制关闭工单
- 工单状态机:待处理 → 待客户确认 → 已完成 / 已退回
- 用户管理(仅管理员可见)
- 创建技术员/管理员账号、修改角色、重置密码、删除用户
- 用户资料管理
License
MIT
Description
Languages
TypeScript
93%
CSS
6.8%
HTML
0.2%