Commit Graph

258 Commits

Author SHA1 Message Date
kkfluous
c3300359a0 fix: 所有里程数据添加 km 单位
实时监控:全屏表格、车辆卡片的今日/累计里程添加 km
统计报表:全屏表格、考核详情、侧滑面板的里程值添加 km
统一使用小写 km

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:35:45 +08:00
kkfluous
aa024f1b64 perf: 实时监控改为缓存+分页架构
后端:
- 每2分钟刷新全量数据到内存缓存(并行查询两库)
- 预计算统计信息(totalToday/totalAll/onlineCount/vehicleCount)
- 预提取筛选选项(departments/customers/plates)
- API 直接从缓存读取,支持分页(每页50条)+筛选+排序

前端:
- KPI 统计使用后端返回的 stats
- 车辆列表分页,带翻页控件
- 筛选选项从后端 filters 获取

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:23:25 +08:00
kkfluous
1fb9d53873 perf: 实时监控性能优化
- 后端:车辆关联信息缓存5分钟、两库并行查询、支持服务端
  筛选/排序/分页(默认返回100条)
- 前端:筛选和排序参数传给后端,不再加载全量数据
- 筛选选项(部门/客户/车牌)仅首次加载获取

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:11:52 +08:00
kkfluous
ad17803ed1 fix: 里程数超过10000显示为xx.xx万KM
添加 fmtKm() 格式化函数,统计报表中所有里程数值
超过10000时自动转为万单位显示。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:47:35 +08:00
kkfluous
152935819b fix: 考核区间支持多批次显示
190辆冷链车有3个不同考核区间(40台、50台、100台),
恒运有2个。后端改为查询每个target的不同考核区间并返回
periods数组,前端换行显示每个区间及其车辆数。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:43:17 +08:00
kkfluous
2a10c5ae31 fix: 修复统计报表移动端适屏问题
- Shell main 添加 min-w-0 overflow-x-hidden 防止 flex 子元素溢出
- trend API 排除当天数据 (stat_date < CURDATE()),只返回前7天
- StatisticsView 移除移动端 overflow-hidden,改为仅 landscape 模式
- 图表和列表卡片在移动端正确显示全宽内容

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:36:25 +08:00
kkfluous
ee3db94c75 fix: 修复统计报表在移动端的溢出问题
- MileageModule 减少移动端 padding (p-6→p-3)
- StatisticsView 添加 overflow-x-hidden 防止横向溢出
- 图表容器添加 overflow-hidden
- 减少图表右侧 margin 防止标签被截断

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:29:54 +08:00
kkfluous
dd1834477d fix: 修复统计报表完成率格式和项目名称显示
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:26:31 +08:00
kkfluous
7e2eefc3da feat: 实现里程管理统计报表视图(1:1 复刻原型)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:16:39 +08:00
kkfluous
167842408c feat: 实现里程管理实时监控视图(1:1 复刻原型)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:11:26 +08:00
kkfluous
0a2cfc22c4 feat: MileageModule Tab 切换 + DailyReportView 占位
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 21:06:05 +08:00
kkfluous
75b4e55dca feat: 添加里程管理 API 路由(monitoring/targets/trend)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 21:06:01 +08:00
kkfluous
5ff3372f2a feat: 添加里程管理 API 客户端 2026-04-01 21:05:29 +08:00
kkfluous
a7e617bc6f feat: 添加 hydrogen_energy 数据库连接和里程管理类型定义
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 21:03:52 +08:00
kkfluous
3d6c31a86e docs: 添加里程管理模块实施计划
7 个 Task:后端数据库连接+API 路由、前端类型+API 客户端、
MileageModule Tab 切换、MonitoringView 1:1 复刻、
StatisticsView 1:1 复刻、集成验证。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:01:58 +08:00
kkfluous
7cf7bc945a docs: 添加里程管理模块设计文档
覆盖架构、API 端点、前端组件、数据映射,
1:1 复刻原型的实时监控和统计报表。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:55:45 +08:00
kkfluous
968e9369a0 refactor: 重写 App.tsx 为模块化顶层壳 2026-04-01 19:22:30 +08:00
kkfluous
caec13eec5 refactor: 创建 AssetsModule,迁移资产管理逻辑
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 19:21:39 +08:00
kkfluous
bb3dbde1c7 feat: 创建 Shell 布局组件(侧边栏 + 底部导航)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 19:19:26 +08:00
kkfluous
40e84a1eaa feat: 创建里程管理占位组件 2026-04-01 19:19:22 +08:00
kkfluous
be6598a940 refactor: 移动 types.ts 和 api.ts 到 modules/assets/
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 19:19:11 +08:00
kkfluous
de0320bfcd refactor: 抽取 SearchSelect 为公共组件
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 19:18:16 +08:00
kkfluous
b495cac0fe docs: 添加模块化重构实施计划
7 个 Task 的详细步骤,覆盖 SearchSelect 抽取、文件迁移、
AssetsModule 创建、Shell 布局、里程占位、App.tsx 重写和清理。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 19:07:02 +08:00
kkfluous
cfd81b1b9d docs: 添加模块化重构设计文档
支持多 BI 大类(资产管理、里程管理)的架构重构设计,
包括目录结构、Shell 布局、导航机制和迁移策略。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 19:03:13 +08:00
kkfluous
44c6f98254 fix: 出勤说明移到按部门/按业务负责人切换Tab的上方
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 09:53:03 +08:00
kkfluous
dbf3f3becb fix: 日期格式化为yyyy-MM-dd、出勤说明另起一行
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 本周还车/交车/替换的日期从ISO格式截取前10位
- 出勤说明移到切换按钮下方单独一行

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 09:50:45 +08:00
kkfluous
3e4122caec fix: 去除客户Tab的饼图(客户运营地区占比)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 09:39:10 +08:00
kkfluous
c70e4b52c4 fix: 出勤说明文字改为浅灰色
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 09:36:15 +08:00
kkfluous
240478142f fix: 客户饼图省份用车辆表province、区域柱状图用realtime表;加出勤说明
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 后端region-chart新增source参数:vehicle用车辆表,realtime用实时表
- 客户运营地区占比"按省份"改用source=vehicle
- 区域资产分布概览"按省份"继续用source=realtime
- 部门Tab加说明文字:*说明:当天里程>0即为出勤。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 09:35:14 +08:00
kkfluous
6e8e01196c fix: 省份图表"未知"合入"其他"
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 09:28:03 +08:00
kkfluous
e910deac51 feat: 按城市改为按省份,数据从realtime表province获取,展示前5
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 后端region-chart支持groupBy=province,从realtime表读取省份
- 区域柱状图和客户饼图"按城市"改为"按省份"
- 省份展示前5,其余合入"其他"
- 前端state类型从'city'改为'province'

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 09:26:54 +08:00
kkfluous
db1e37b8bf fix: 客户饼图按城市显示时按省份(区域)分组排序
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
同省城市相邻显示:华东(嘉兴/宁波/金华)→华南(佛山/广州)→华中(开封)→...
组内按数量降序。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 09:13:28 +08:00
kkfluous
16f5ef8741 fix: 区域统计客户筛选生效,后端region-stats支持过滤参数
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 后端/region-stats新增customer/city/region查询参数
- 前端regionFilters变化时重新请求后端数据
- 移除前端冗余过滤逻辑,由后端统一处理

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 00:42:59 +08:00
kkfluous
1d19bb07a7 fix: 禁止iOS橡皮筋滚动,不再显示上下空白
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
overscroll-behavior:none + html overflow:hidden 防止页面过度滚动

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 00:36:26 +08:00
kkfluous
189098cd54 fix: Tab切换延迟渲染重内容,解决区域页切换卡顿
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 切换Tab时先卸载旧内容显示loading,下一帧再渲染新内容
- 图表等重组件不再阻塞Tab切换动画
- 所有Tab统一处理,切换体验一致

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 00:35:07 +08:00
kkfluous
799d00b3da fix: Tab切换用useTransition不阻塞UI、禁止缩放、版本升至1.1.0
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- Tab切换包裹startTransition,图表重渲染不阻塞交互
- viewport加maximum-scale=1.0 user-scalable=no禁止缩放
- 版本号1.0.0 → 1.1.0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 00:31:33 +08:00
kkfluous
d7575aeea2 feat: 三个筛选区域增加已选条件标签栏,支持单个×和一键清除
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 库存/区域/客户统计在筛选按钮下方显示已选条件标签
- 每个标签可点×单独移除
- 右侧"清除"按钮一键重置所有条件
- 不需要打开筛选面板即可快速清除

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 00:23:44 +08:00
kkfluous
c81b7058c3 fix: 移动端筛选面板高度自适应内容,不再撑满屏幕
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
从fixed top-24 bottom-24改为top-20 max-h-[80vh],
面板高度由内容决定,内容多时可滚动。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 00:20:56 +08:00
kkfluous
f25dffc7df feat: 客户筛选部门和业务负责人联动
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 选择部门后,业务负责人下拉只显示该部门的人
- 切换部门时自动清空已选的业务负责人
- 未选部门时显示所有部门的负责人

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 00:18:11 +08:00
kkfluous
11f7062104 fix: 移除筛选遮罩层防止阻塞Tab切换、部门选择按编号排序
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 删除三个筛选面板的fixed backdrop div,不再阻塞页面交互
- 部门下拉选项按编号排序(业务一部→二部→三部→五部→六部)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 00:12:49 +08:00
kkfluous
8f42676f7c fix: 筛选面板改为确认后才搜索、隐藏公务车分类
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 三个筛选面板(库存/区域/客户)改为draft状态模式:
  打开时复制当前筛选到draft,面板内操作draft,
  点确认才应用到实际筛选状态
- 移除点击外部关闭(只能通过确认按钮关闭)
- 业务负责人下拉隐藏"公务车"分组(部门Tab和客户Tab都已处理)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 00:11:46 +08:00
kkfluous
7b39d51fa3 fix: 所有筛选面板桌面端统一固定在视口右上角(top-20 right-4)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
库存筛选面板之前桌面端位置太低被页面遮挡,现在三个筛选面板
统一使用sm:top-20 sm:right-4固定定位,与客户筛选同样的位置。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 00:04:47 +08:00
kkfluous
bfb6fd132d Revert "fix: 库存统计筛选面板优化,参考客户筛选样式"
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This reverts commit 02af807705.
2026-03-29 00:02:01 +08:00
kkfluous
02af807705 fix: 库存统计筛选面板优化,参考客户筛选样式
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 标题改为"数据筛选",重置改为红色
- 车型和批次改为并排两列布局
- 标签统一uppercase加粗样式
- 确认按钮加阴影,更醒目
- 整体间距和样式与客户筛选一致

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 00:01:12 +08:00
kkfluous
6bdbfda981 fix: 筛选面板点击外部区域也能关闭
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
恢复backdrop的onClick,点击遮罩层关闭对应的筛选面板。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 00:00:16 +08:00
kkfluous
9f3b134007 fix: 筛选面板改为fixed定位,桌面端右侧浮动不受容器限制
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 所有筛选面板统一fixed定位,不依赖父容器overflow
- 移动端: 上下留白居中,可滚动
- 桌面端: 右侧浮动,max-h-[80vh]可滚动,确认按钮始终可见

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:58:32 +08:00
kkfluous
c20ac11ed7 fix: 筛选面板桌面端改为向上展开,加滚动防止底部遮挡
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 桌面端sm:top-full改为sm:bottom-full,面板从按钮上方弹出
- 加max-h和overflow-auto,内容过多时可滚动
- 移动端保持固定居中

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:57:31 +08:00
kkfluous
fd0b94175d fix: 客户运营统计业务负责人按部门编号排序
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
部门顺序:业务一部→二部→三部→五部→六部→公务车,
与部门Tab排序一致,负责人按deptData顺序排列。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:54:54 +08:00
kkfluous
66ea340a73 feat: 业务负责人下拉按部门分组显示
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 部门Tab和客户Tab的业务负责人下拉用optgroup按部门分组
- 顺序:部门名称作为组标题,组内显示该部门的负责人列表
- 部门排序与部门Tab一致(业务一部→二部→...→公务车)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:52:35 +08:00
kkfluous
258def4fdd feat: 库存筛选"车型名称"改为二级选择"车型→批次"
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 新增车型下拉(4.5T普货/冷链/18T/49T/挂车/其他)
- 批次下拉根据所选车型联动过滤,显示该车型下的具体型号
- 切换车型时自动清空批次选择
- 筛选标签栏对应更新:车型/批次

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:51:01 +08:00