kkfluous
4cd76b6a30
feat: 添加 /api/auth/me 调试端点查看当前用户权限
ci/woodpecker/push/woodpecker Pipeline was successful
2026-04-02 16:44:41 +08:00
kkfluous
bf1f1946e4
fix: 合并 exchange+login 为一步,直接从 jumpToken 响应提取用户信息签发JWT
...
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-02 16:04:09 +08:00
kkfluous
2575778293
feat: 后端用户认证和权限过滤
...
- 新增 auth 模块:jumpToken 代理交换、用户信息获取、JWT 签发
- 三级权限:full(所有权限/数智中心/BI-Leader)、department(BI-Leader-Dep)、personal
- 添加 managerId 到车辆数据模型,支持个人级别按 userId 精确过滤
- auth 中间件保护所有 /api/* 端点(跳过 /api/health 和 /api/auth/*)
- 所有路由集成 filterByPermission 权限过滤
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-02 15:35:29 +08:00
kkfluous
6dbd36dcd3
refactor: replace mileage monolith with modular route files
...
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-02 13:35:58 +08:00
kkfluous
7ec422c13a
refactor: create targets route handler
2026-04-02 13:33:14 +08:00
kkfluous
890050ed55
refactor: create trend route handler
2026-04-02 13:33:05 +08:00
kkfluous
ac2a16e7b7
refactor: create monitoring route handler
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-02 13:32:32 +08:00
kkfluous
459b0400b4
refactor: extract monitoring cache module
2026-04-02 13:31:07 +08:00
kkfluous
1a169feaa6
refactor: extract vehicle-info query module
2026-04-02 13:30:19 +08:00
kkfluous
bc1e0ea32e
refactor: extract mileage shared types
2026-04-02 13:30:02 +08:00
kkfluous
997374cf25
feat: 客户多选筛选、统计报表里程与监控看板数据一致
...
ci/woodpecker/push/woodpecker Pipeline was successful
- 资产管理按客户筛选改为多选(支持同时选多个客户)
- 新增 MultiSearchSelect 组件(搜索+标签+复选框)
- 统计报表 todayTotal 改用监控缓存数据,与里程看板一致
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-02 11:31:54 +08:00
kkfluous
8822ddf8ae
feat: 车牌区域筛选、型号批次筛选、回到顶部修复、删除涨跌幅
...
ci/woodpecker/push/woodpecker Pipeline was successful
- 新增车牌区域筛选(粤/沪/浙+数量),替代旧地区代码
- 新增型号批次筛选(从考核目标名称筛选车辆)
- 客户/部门增加"无值"选项筛选空值
- 修复回到顶部按钮在iOS上失效
- 删除KPI卡片涨跌幅百分比显示
- 全屏刷新按钮实际触发数据重新加载+加载动画
- 统计报表全屏刷新按钮修复
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-02 11:21:38 +08:00
kkfluous
adc9c3a9db
feat: 多项优化 - 全屏加载全部数据、无值筛选、刷新按钮、加载动画、负值显示为0
...
ci/woodpecker/push/woodpecker Pipeline was successful
- 全屏监控一次加载全部车辆数据,支持完整滚动和筛选
- 客户/部门筛选增加"无值"选项筛选空数据
- 全屏刷新按钮实际触发数据重新加载,带旋转动画
- 全屏筛选时显示加载遮罩
- 负值里程前端显示为0
- 未对接车机显示"未对接"替代"-"
- 删除"未同步"标签
- 统计报表配色统一为白色主题、KPI联动选中项目
- 统计报表全屏表格列合并优化
- 车辆明细面板增加日期选择、租赁状态/部门/客户信息、里程合计
- 每分钟自动刷新数据
- 清除按钮修复租赁状态重置
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-02 10:52:45 +08:00
kkfluous
06a2edc470
feat: 租赁状态与部门分列筛选,未同步车辆显示-,卡片增加今/总标签,全屏监控压缩优化
...
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-02 10:01:17 +08:00
kkfluous
50eaeb05ae
fix: 统计报表用年度完成率替代总完成率
...
- 完成率改用 current_year_completion_rate 平均值
- 50%达标数改用 current_year_completion_rate >= 0.5
- 修复后数据:40台普货 完成率51.6% 50%达标15台
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-02 00:08:46 +08:00
kkfluous
82dac759be
fix: 环比统计跟随筛选条件正确计算
...
每辆车缓存其昨日里程(yesterdayKm),筛选后的环比基于
相同筛选条件下的车辆计算,而非全局对比。
例如筛选"业务一部"后,今日和昨日都只统计一部的车辆。
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-01 23:50:07 +08:00
kkfluous
0b8bbbb063
feat: 支持查询指定日期里程+删除搜索关键词和车牌号筛选
...
- 后端支持 date 参数,指定日期时实时查询数据库(不用缓存)
- 同时查询前一天数据计算环比
- 高级筛选添加"查询日期"日期选择器
- 删除高级筛选中的"搜索关键词"和"车牌号"(已有快捷筛选)
- 筛选标签支持显示日期条件
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-01 23:41:03 +08:00
kkfluous
cbf0e18634
fix: 里程环比改为真实值(与前一天对比)
...
- 后端缓存刷新时查询前一天总里程(yesterdayTotal)
- 前端计算真实环比:(今日-昨日)/昨日*100%
- 上涨显示蓝色↑,下跌显示红色↓
- 昨日无数据时不显示环比
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-01 23:33:52 +08:00
kkfluous
66de41d50b
fix: KPI统计跟随筛选条件变化+客户筛选修正+部门排序
...
- KPI统计(总里程/平均单车/监控台数)改为基于筛选后数据计算
- 移除不需要的 onlineCount 字段
- 快捷筛选"按客户"和全屏表格"客户"列改为真正的客户筛选
- 删除混乱的 projects 变量映射
- 部门列表按 一部→二部→三部 顺序排序
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-01 23:29:31 +08:00
kkfluous
8fffa141f4
fix: 修复车牌搜索失效,确保所有筛选条件正常
...
- 后端新增 plate 查询参数支持
- 前端将 filterPlate 传给 API 并加入依赖数组
- 所有筛选条件(部门/项目/主体/车牌/搜索/里程范围)
均正确传递到后端并触发数据刷新
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-01 23:22:12 +08:00
kkfluous
2469da310d
fix: 里程范围筛选接入后端
...
- 后端支持 mileageMin/mileageMax 查询参数
- 前端点击"完成筛选"时将里程范围提交到后端
- "重置所有"同时清除已应用的里程范围
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-01 23:14:56 +08:00
kkfluous
863ab17b58
fix: 筛选器和显示优化
...
- 删除年份筛选
- 项目筛选改用真实项目数据(ln_vehicle_contract.project_name)
- 主体查询改用 tab_truck → tab_org 的 org_name
- 里程区间改为两个独立条件(里程≥ / 里程≤)
- 未分配客户显示为 -
- 统计报表日期格式改为 M.D(如 3.25)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-01 23:06:56 +08:00
kkfluous
d8f25448d0
fix: 实时监控显示优化
...
1. KPI 总里程不保留小数
2. 车辆卡片先展示部门再展示客户名称,客户名称不截断
3. 无部门时展示租赁状态(自营/租赁/挂靠等)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-01 22:45:46 +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
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
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
a7e617bc6f
feat: 添加 hydrogen_energy 数据库连接和里程管理类型定义
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-01 21:03:52 +08:00
kkfluous
240478142f
fix: 客户饼图省份用车辆表province、区域柱状图用realtime表;加出勤说明
...
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: 省份图表"未知"合入"其他"
...
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
...
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
16f5ef8741
fix: 区域统计客户筛选生效,后端region-stats支持过滤参数
...
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
9d0b305218
feat: 出勤率数据源切换为tab_truck_remote_sync_realtime_info
...
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
2626bf2aa7
fix: 库存统计口径统一包含Inventory+Abnormal
...
ci/woodpecker/push/woodpecker Pipeline was successful
inventory-stats端点只过滤status=Inventory,但/list的category=Inventory
包含Inventory+Abnormal,导致统计数和下钻列表不一致。统一为两者都包含。
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-28 23:11:48 +08:00
kkfluous
0eb4485af4
fix: 库存批次改为车型名称、区域待交车数量始终显示
...
ci/woodpecker/push/woodpecker Pipeline was successful
- 库存统计:移除批次筛选(原显示contractNo),batch字段改为model
- 区域Tab:待交车和库存数量即使为0也显示数字,移除|| ''和if守卫
- 桌面端和移动端的pendingCount/inventory全部始终显示
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-28 22:49:57 +08:00
kkfluous
8472f22f1e
fix: 出勤率改为当天计算(当天出勤数/总运营数)
...
ci/woodpecker/push/woodpecker Pipeline was successful
之前用近30天activeDays/totalDays计算,现改为:
当天里程>0的车辆数 / 部门总运营车辆数 × 100%
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-28 20:17:09 +08:00
kkfluous
8727dc36ab
fix: 部门出勤/闲置下钻改为基于当日里程区分
...
ci/woodpecker/push/woodpecker Pipeline was successful
- 后端/list新增attendance参数(active/idle),查询当日里程表区分
出勤(mileage>0)和闲置(mileage=0),仅对Operating车辆生效
- 前端部门Tab出勤/闲置点击改用attendance:'active'/'idle'替代
原来错误的category:'Operating'/'Inventory'
- 修复department='公务车'过滤:匹配departmentName为null的车辆
- 前端API层新增attendance参数传递
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-28 20:01:58 +08:00
kkfluous
cab26a207a
fix: 部门统计未分配部门改为显示"公务车",排序放最后
...
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-28 19:51:21 +08:00
kkfluous
93a6c7df1c
fix: 对齐原型UI差异、修复所有下钻维度、统一弹窗详情表格
...
ci/woodpecker/push/woodpecker Pipeline was successful
- 部门Tab:移除多余section header,标签改为总运营车辆/出勤/闲置,
表格移除日均里程列,按业务负责人改为按业务员,所有行加点击下钻
- 部门下钻增加department维度,后端/list接口新增department过滤参数
- 区域Tab:总资产下钻移除错误的category:Operating,库存改为Inventory,
补全source:region和title,图表高度h-72改h-64
- 客户Tab:4.5T/冷链点击增加isColdChain区分,移动端合计badge加下钻,
所有点击补全title
- 筛选面板:移除区域和客户的"完成筛选"按钮
- 所有manager下钻补全title字段
- 弹窗统一使用14列完整详情表格(月/部门/负责人/品牌/车型/归属/客户/
车牌/状态/提车时间/到期时间/区域/离到期/签约公司),移除source条件
- 表格加whitespace-nowrap和w-max,移动端水平滚动不换行
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-28 19:33:44 +08:00
kkfluous
f6a4884ad1
fix: category=Inventory包含Abnormal状态,与统计口径一致
...
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-28 18:49:06 +08:00
kkfluous
e7ef773bc8
fix: 新增下钻支持、移动端库存区域下钻加category:Inventory
...
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-28 18:46:57 +08:00
kkfluous
dd01671d9e
fix: 区域运营移动端数据、下钻支持城市/车型、网页标题
...
ci/woodpecker/push/woodpecker Pipeline was successful
- 移动端区域运营改用regionData真实数据(去掉Math.floor模拟)
- 区域/城市/车型行数字全部支持点击下钻
- 后端/list支持按车型大类过滤(如4.5T含普货+冷链)
- 网页标题改为"羚牛氢能车辆资产"
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-28 18:28:46 +08:00
kkfluous
2ba25427de
feat: tab导航、recharts图表、库存统计、出勤率里程、区域城市下钻、数据一致性修复
...
ci/woodpecker/push/woodpecker Pipeline was successful
- 新增tab导航(总览/按部门/按区域/按客户)+ 移动端底部导航
- 新增recharts柱状图(区域分布)和饼图(客户分布)
- 新增库存统计模块(按区域/按车型,筛选面板)
- 对接ln_vehicle_day_mileage表实现出勤率和日均里程
- 区域运营支持区域→城市→车型三级下钻
- 修复ownership取字段错误(改用truck_rent_status)
- 修复部门统计闲置定义(当日无行驶里程)
- 修复区域图表"其他"重复问题(后端Top N合并)
- 修复城市名空值降级(resolveCity取province)
- 修复下钻数据不一致(统一category/vehicleType参数)
- 扩展/list端点支持大区过滤和未分配匹配
- 所有筛选改为searchable datalist
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-28 18:09:18 +08:00
kkfluous
629451c13d
feat: add inventory statistics section, adapt to latest prototype
...
- Add GET /api/vehicles/inventory-stats endpoint that groups inventory vehicles by macro-region, city, brand, type, model, and batch
- Add RegionalInventoryStats type and fetchInventoryStats API function
- Add full inventory statistics section with region/model tabs, filters, desktop table, and mobile views
- Add modal filters (plate number, model, brand, location search) to vehicle detail modal
- Update modal header to support title field for contextual naming
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-28 16:24:39 +08:00
kkfluous
d6ac1044fe
fix: replace modal with prototype version, extend /list API fields
...
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-28 15:28:12 +08:00
kkfluous
73d5afde5c
feat: add dept/region/customer stats APIs and extend /list filters
...
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-27 18:13:44 +08:00
kkfluous
9a7382101b
feat: 库存弹窗展示车牌号及省市信息
...
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-27 15:39:10 +08:00
kkfluous
e4ffd027be
fix: 库存总数包含异动车辆,总计行改为累加计算
...
ci/woodpecker/push/woodpecker Pipeline was successful
- getStats 的 inventory 统计包含 Inventory + Abnormal
- 总计行所有列改为从各车型数据累加,不再使用 SUMMARY
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-26 15:11:12 +08:00
kkfluous
363399faed
fix: 修正总库存计算,区分在库/待交车/异动状态
...
ci/woodpecker/push/woodpecker Pipeline was successful
- 总库存 = 在库 + 异动(不含待交车)
- 待交车独立展示
- 库 = 纯在库数量
- 异 = 异动数量
- 验证: 运营 + 库存 + 待交 = 总资产
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-26 15:03:44 +08:00