Commit Graph

100 Commits

Author SHA1 Message Date
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
kkfluous
96219d95b6 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-28 23:49:01 +08:00
kkfluous
9d0b305218 feat: 出勤率数据源切换为tab_truck_remote_sync_realtime_info
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- dept-stats和/list的attendance过滤改为查询realtime表的day_mileage
- day_mileage>0为出勤,=0为闲置
- 移除旧的ln_vehicle_day_mileage依赖
- 前端恢复出勤率/出勤/闲置的数据显示和下钻功能

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:48:10 +08:00
kkfluous
cae508a70a fix: 一级菜单仅客户名称用模糊搜索,其他改回select下拉
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 库存-车型名称、客户-业务负责人改回原生select
- 仅区域筛选和客户筛选的"客户名称"保留SearchSelect模糊搜索
- 弹窗内车牌搜索保留SearchSelect(二级页面)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:44:19 +08:00
kkfluous
8863039869 fix: 筛选面板删除X关闭按钮,底部加确认按钮点击后关闭
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 库存/区域/客户三个筛选面板移除X图标
- 底部增加"确认"按钮,点击后关闭面板
- 移除背景遮罩点击关闭,只能通过确认按钮关闭

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:41:10 +08:00
kkfluous
e85792a237 feat: 自定义SearchSelect组件,支持下拉+模糊搜索+iOS兼容
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 新增SearchSelect组件:输入框可打字模糊过滤,下拉列表点击选择
- 客户名称、业务负责人、车型名称、车牌号码使用SearchSelect
- 短选项列表(区域/城市/品牌/部门/业务员)保持原生select
- 点击外部自动关闭下拉,已选中项高亮,无匹配显示提示
- iOS Safari完全兼容(不依赖datalist)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:38:15 +08:00
kkfluous
28dcab771f fix: 所有筛选统一为select下拉,修复iOS不支持datalist
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 客户名称、业务负责人、车型名称、车牌号码全部从input+datalist
  改为select下拉,iOS Safari完全兼容
- 弹窗快速搜索也改为select
- 所有过滤逻辑统一为精确匹配(select值)
- 样式统一:所有筛选控件使用相同的select样式

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:33:53 +08:00
kkfluous
f4cf5d1cb6 fix: useMemo移到early return之前,修复hooks顺序错误
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
React要求hooks在每次渲染中顺序一致,不能在条件return之后调用。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:30:07 +08:00
kkfluous
454b2f0913 perf: useMemo优化所有派生数据,解决页面操作卡顿
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 所有filter/unique/grouped派生数据包裹useMemo,避免每次渲染重算
- 库存筛选、客户筛选、区域筛选、弹窗筛选的派生列表全部memoize
- 饼图数据提取为customerPieData useMemo,不再inline IIFE
- 水印文本memoize,仅lastUpdate变化时重算
- 预计减少每次交互的JS执行时间80%+

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