Commit Graph
100 Commits
Author SHA1 Message Date
kkfluousandClaude Opus 4.6 afec75a1cc fix(scheduling): rescue candidates should be close-to-qualifying, not zero-mileage
For rescue_hopeless (换走) scenario, completely rethought candidate logic:

Before: showed biggest-gap candidates (0 mileage) → pointless, customer can't
  drive them to target
After: prioritize candidates where customer's remaining driving can push them
  over the target line (canQualifyAfterSwap), sorted by smallest gap first

Example: customer drives 178km/day × 57 days = ~1万km remaining.
- 粤AGR6869 (缺口 1990km) → 换后 3.8万, 可达标  (shown first)
- 浙FF58720 (缺口 6万km) → 换后 1万, 远不达标 (no longer shown first)

Also updated reason text to explain the math:
"该客户剩余57天还能跑约1万km,足以帮缺口小的车冲线"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:36:53 +08:00
kkfluousandClaude Opus 4.6 1d1f8901aa fix(scheduling): exclude near-qualified vehicles from rescue candidates
For rescue_hopeless (换走) scenario, filter out inventory candidates
where totalMileage/yearTarget >= 80%. These are already near target
and swapping them in adds no value.

Instead, prioritize candidates with biggest mileage gaps — they benefit
most from accumulating any mileage, even at a low-mileage customer.

Before: showed 粤AGR6869 (93% done, 缺口 1990) as "可达标" — pointless
After:  shows 浙FF58720 (0% done, 缺口 60000) — genuinely needs mileage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:34:05 +08:00
kkfluousandClaude Opus 4.6 81305be2df feat(scheduling): replace spinner with skeleton loading placeholders
- Full-page skeleton on initial load: card placeholders + list row placeholders
- List skeleton on refresh: 6 rows with pulse animation
- Skeleton blocks match actual layout (color bar, plate, badges, info line)
- Uses Tailwind animate-pulse for smooth loading effect

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:30:23 +08:00
kkfluousandClaude Opus 4.6 64f47d5ad6 fix(scheduling): truncate long customer names, prevent list item wrap
- Customer name in list items: truncate with max-w-[40%]
- Daily km and completion rate: flex-shrink-0 to stay on same line

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:28:30 +08:00
kkfluousandClaude Opus 4.6 9398688829 feat(scheduling): add department/manager filters, refine color palette
- Add department and manager fields to backend types and suggestions API
- Add department/manager to advanced filter panel
- Refine card colors: orange (换下) / blue (换走) / dark slate (全部)
- Selected card uses solid bg color, inactive uses gradient
- Batch pills use dark slate, confirm button uses dark slate
- Background changed to #F0F4F8 for subtle cool tone

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:28:04 +08:00
kkfluousandClaude Opus 4.6 48fa3bc73f refactor(scheduling): rewrite terminology to match core business logic
Core story: 里程高的车换下来,里程少的车换上去。

- Summary cards: "里程高·需换下" / "里程低·需换走" / "替换建议"
- List tags: "换下" (amber) / "换走" (blue) with matching color bars
- Detail modal title: "里程高·换下此车" / "里程低·换走此车"
- Candidate section: explains WHY these vehicles are recommended
  - 换下: "以下车辆里程缺口大,换到该高里程客户处可加速达标"
  - 换走: "以下车辆里程已充足,可调给当前客户,将此车换走给高里程客户冲刺"
- Reason text: states current situation + clear action recommendation
  with specific numbers (已跑, 缺口, 日均, 完成率)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:23:35 +08:00
kkfluousandClaude Opus 4.6 1a5a1c1514 feat(scheduling): add advanced filter panel matching prototype
- Filter icon in list header with active count badge
- Expandable filter panel: plate search, region select, vehicle type select, customer select
- FilterSelect component with search for long option lists
- Active filter tags shown as removable pills below header
- Temp/confirmed filter pattern (edit → confirm/cancel)
- Result count displayed when filters active

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:18:02 +08:00
kkfluousandClaude Opus 4.6 73080a605d refactor(scheduling): polish overall color scheme and UX
- Modal header: unified dark slate-800 with directional icon (↓ rescue, ↑ release)
- Modal click-outside to close
- Candidate metrics: table-style with bg-slate-50 + dividers, more scannable
- Send button: dark slate instead of blue (avoids color overload)
- Reason section: warm amber accent
- Consistent font sizing and spacing throughout

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:13:12 +08:00
kkfluousandClaude Opus 4.6 6f7555a407 feat(scheduling): make summary cards clickable filters + refine color scheme
- Cards filter suggestions by type (已达标/无望达标/全部)
- Toggle: click active card again to reset to all
- Default: white bg + gray border; active: colored bg + ring
- Batch selector: dark pills instead of blue
- Refresh button moved into list header
- Reset type filter when switching batch

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:12:02 +08:00
kkfluousandClaude Opus 4.6 bcbeb64e28 fix(scheduling): use current year mileage for consistent data display
- Add currentYearMileage to SchedulingVehicleInfo (backend + frontend)
- Compute completionRate as currentYearMileage/yearTarget (year-based)
  instead of using overall completion_rate from DB
- Display "本年已跑" instead of "累计" in detail modal
- Fix reason text to show year completion rate

Before: 累计 4.6万, 考核 3.0万, 完成率 12.1% (mismatched periods)
After:  本年已跑 8.3万, 考核 3.0万, 完成率 275% (consistent year-based)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:08:29 +08:00
kkfluousandClaude Opus 4.6 6ee811c937 refactor(scheduling): optimize UI for clarity and information density
- Summary cards: white bg + color border, remove icons, more compact
- SuggestionList: replace badge stacking with compact 2-line layout,
  use color bars for priority, fix completion rate format (0.16 → 16.4%)
- SuggestionDetail: bottom-sheet on mobile, compact inline metrics
  instead of grid cards, reduce vertical space per candidate
- Follows ui-ux-pro-max Data-Dense Dashboard guidelines

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:04:26 +08:00
kkfluousandClaude Opus 4.6 495f4bf44f feat(scheduling): add 本年考核 field to candidate cards and rename 年度目标 to 本年考核
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:01:01 +08:00
kkfluousandClaude Opus 4.6 ec3b079311 fix(scheduling): only suggest replacements for rented/operated vehicles
Filter enriched vehicles to only include rent_status = '租赁' or '自营'.
Inventory candidates already filtered by truck_rent_status = 0 (在库).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 20:52:16 +08:00
kkfluousandClaude Opus 4.6 033af15814 fix(scheduling): include soft-deleted trucks and infer type from target name
411 of 451 assessment vehicles had is_deleted=1 in tab_truck, causing type
classification to fall back to "其他" and miss all inventory matches. Fix:
- Remove is_deleted=0 filter from truck type query (assessment vehicles need type info regardless)
- Add inferTypeFromTargetName() fallback deriving type from target name when truck record is missing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 20:47:00 +08:00
kkfluousandClaude Opus 4.6 253cc2f2c0 fix(scheduling): fix vehicle type classification and algorithm candidate matching
- classifyVehicleType now parses dic_type.dic_name (e.g. "4.5吨冷链车") instead of raw model code
- Remove overly strict completionRate >= 0.8 filter for hopeless candidates
- Use vehicle's yearTarget as fallback when inventory has no assessment target
- Filter out suggestions with no candidates (not actionable)
- estimatedGain counts rescue_hopeless suggestions as potential gains

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 20:31:44 +08:00
kkfluousandClaude Opus 4.6 db5ca2e686 feat(scheduling): wire up scheduling module in app navigation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 20:26:53 +08:00
kkfluousandClaude Sonnet 4.6 2e82a30893 feat(scheduling): add SuggestionDetail modal with candidate comparison
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 20:25:58 +08:00
kkfluousandClaude Sonnet 4.6 9c005bebc8 feat(scheduling): add SuggestionList component
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 20:25:21 +08:00
kkfluousandClaude Sonnet 4.6 82ee7f5480 feat(scheduling): add SchedulingModule main entry component
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 20:25:13 +08:00
kkfluousandClaude Opus 4.6 4169e04a9c feat(scheduling): add suggestions route with data aggregation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 20:23:56 +08:00
kkfluousandClaude Sonnet 4.6 86d5bc8738 feat(scheduling): add notify route and wire up scheduling router
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 20:23:29 +08:00
kkfluousandClaude Opus 4.6 460c9906e1 feat(scheduling): add algorithm pure functions and export mapRegion
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 20:21:50 +08:00
kkfluousandClaude Sonnet 4.6 569b5ea349 feat(scheduling): add frontend types and API client
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 20:20:23 +08:00
kkfluousandClaude Sonnet 4.6 ebe46c6f73 feat(scheduling): add backend type definitions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 20:20:18 +08:00
kkfluousandClaude Opus 4.6 32b297c731 docs: 智能调度模块实现计划
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 20:17:08 +08:00
kkfluousandClaude Opus 4.6 9bf9bdd8ff docs: 智能调度模块设计规格
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 20:11:51 +08:00
kkfluousandClaude Opus 4.6 188d2b105f fix: 关闭全局演示模糊模式,恢复车牌等敏感字段正常显示,版本号 1.1.5
ci/woodpecker/push/woodpecker Pipeline was successful
Shell.tsx 的 DemoModeProvider 之前设为 enabled={true},Blur 组件包裹的
车牌/客户名/经理名全部被 blur(5px) 盖住。改为 false 恢复真实显示。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 18:59:58 +08:00
kkfluousandClaude Opus 4.6 26d59190c9 feat: 小程序 webview 内点全屏监控自动 CSS 横屏,版本号 1.1.4
ci/woodpecker/push/woodpecker Pipeline was successful
小程序 webview 无法调用系统旋转 API,竖屏全屏体验很差。检测到微信/抖音/
支付宝小程序 UA 且当前为竖屏时,全屏覆盖层用 transform: rotate(90deg)
配合 100vh × 100vw 的尺寸模拟真横屏,用户用横屏姿势看设备即可获得横屏
监控面板。浏览器会自动把触摸坐标映射回旋转前坐标系,交互不受影响。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 18:42:43 +08:00
kkfluousandClaude Opus 4.6 f3b795e8a9 fix: 小程序/webview 内需点两次返回才能退出的问题,版本号 1.1.3
ci/woodpecker/push/woodpecker Pipeline was successful
Shell 首次挂载时用 location.hash= 同步模块到 URL hash,会 push 一条多余
的 history 记录;webview 里第一次返回只是回到 hash 为空的同一页面没有
视觉变化,得再按一次才能真正退出。

改为 history.replaceState 更新 hash,切换 tab 也走 replace,整个应用
只占用一个 history 记录,一次返回即可退出。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:13:01 +08:00
kkfluousandClaude Opus 4.6 71ff459111 fix: 补提交缺失的 Blur 组件,修复 CI 打包找不到模块,版本号 1.1.2
ci/woodpecker/push/woodpecker Pipeline was successful
AssetsModule 等引用 src/components/Blur 但该文件未纳入版本库导致 CI
rollup 报 Could not resolve "../../components/Blur"。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 16:53:57 +08:00
kkfluousandClaude Opus 4.6 4acf10ef79 fix: 修复打包 lint 报错,版本号 1.1.1
ci/woodpecker/push/woodpecker Pipeline failed
middleware.ts 临时跳过认证的早 return 导致后续代码 unreachable,
TS 在不可达分支里不做类型 narrowing 触发 TS18048;
改为 BYPASS_AUTH 常量分支保留完整鉴权逻辑便于恢复。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 16:53:01 +08:00
kkfluousandClaude Opus 4.6 820fde5547 feat: 资产总览新增所属公司筛选,支持按归属主体过滤全页数据
ci/woodpecker/push/woodpecker Pipeline failed
- 后端:新增 /api/vehicles/subjects 端点返回公司列表+台数预览;所有聚合端点接受 ?subject= 参数按 tab_truck.org_id 对应的主体公司过滤
- 前端:标题下方新增 Scope Chip 单选下拉,支持搜索+台数预览,选中后全页 KPI/汇总/库存统计按公司联动刷新

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 16:50:25 +08:00
kkfluousandClaude Opus 4.6 d6c31dd2b6 fix: 实时监控累计总里程少算,G7S 数据源 total_km 为 NULL 时用业务库 vehicle_total_mileage 兜底
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 10:22:19 +08:00
kkfluousandClaude Opus 4.6 8660c0d999 fix: 部门列表隐藏非业务员账号(超级用户/刘思宇/潘舒/黄卓华/许铮杰)
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 22:48:07 +08:00
kkfluousandClaude Opus 4.6 b4c4929dbb feat: 部门/业务负责人列表补齐无车辆业务员
ci/woodpecker/push/woodpecker Pipeline was successful
/dept-stats 在按车辆聚合后,查询 tab_user 把业务部门内所有在职用户补进 managers 列表,无车辆显示为 0 辆。跳过公务车部门。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 22:44:01 +08:00
kkfluousandClaude Opus 4.6 e4f682dff5 fix: 按部门下钻车辆数与列表不一致,补充 category=Operating 过滤
ci/woodpecker/push/woodpecker Pipeline was successful
dept-stats 只统计 Operating 车辆,但下钻弹窗调用 /list 时未传 category
参数,导致返回了非运营状态车辆(如业务二部显示233但下钻显示237)。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 00:32:43 +08:00
kkfluousandClaude Opus 4.6 cbbdb7bb5f fix: 2-3字客户名脱敏改为 首字+* (如 徐*)
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 20:24:43 +08:00
kkfluousandClaude Opus 4.6 9c9d7a3805 feat: 全局客户名称脱敏(首尾保留+中间三个*)
ci/woodpecker/push/woodpecker Pipeline was successful
- 2-3字: 首字+*** (徐***)
- 4-6字: 首2字+***+末1字 (嘉兴***司)
- 7字+: 首4字+***+末2字 (嘉兴市乍***公司)
- 覆盖所有接口: monitoring, targets, vehicles, weekly-detail

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 20:23:24 +08:00
kkfluousandClaude Opus 4.6 e7efe179b7 fix: 未授权页面增加两种进入方式说明
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 18:19:18 +08:00
kkfluousandClaude Opus 4.6 39f89c30a2 fix: 库存统计(inventory-stats/inventory-analysis)不设数据权限,对所有人开放
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 18:15:15 +08:00
kkfluousandClaude Opus 4.6 8ed2031c45 feat: 水印移到全局Shell,资产和里程页面都有水印
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 18:12:48 +08:00
kkfluousandClaude Opus 4.6 c2d227059c feat: 实时监控加载动画 - KPI骨架屏+车辆列表skeleton
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 18:10:18 +08:00
kkfluousandClaude Opus 4.6 1680c53279 feat: 支持 URL path 路由进入不同模块
ci/woodpecker/push/woodpecker Pipeline was successful
/vehicle 或 /assets → 资产管理
/mileage → 里程管理

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 18:05:24 +08:00
kkfluousandClaude Opus 4.6 b5806b3148 feat: 生产环境配置 EXTERNAL_API_BASE=lnh2e.com 和 JWT_SECRET
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 18:01:49 +08:00
kkfluousandClaude Opus 4.6 840bf30517 fix: 本周动态也基于权限过滤后的车辆计算
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 16:57:32 +08:00
kkfluousandClaude Opus 4.6 441f574238 fix: /summary 和 /by-type 接口补上权限过滤(之前遗漏)
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 16:54:29 +08:00
kkfluous 143c1a57bb debug: 添加权限过滤日志定位问题
ci/woodpecker/push/woodpecker Pipeline was successful
2026-04-02 16:48:29 +08:00
kkfluous 4cd76b6a30 feat: 添加 /api/auth/me 调试端点查看当前用户权限
ci/woodpecker/push/woodpecker Pipeline was successful
2026-04-02 16:44:41 +08:00
kkfluousandClaude Opus 4.6 09719f3cd6 fix: 水印改为 用户名+时间 替代 羚牛氢能+时间
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 16:38:20 +08:00
kkfluousandClaude Opus 4.6 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
kkfluousandClaude Opus 4.6 a7ec5ba7b0 fix: 防止 StrictMode 双重调用导致 jumpToken 重复消费
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 15:59:11 +08:00
kkfluousandClaude Opus 4.6 f66049dcbc feat: 前端认证网关 + API 自动附加 JWT
ci/woodpecker/push/woodpecker Pipeline was successful
- AuthProvider 管理 jumpToken 交换和 JWT 生命周期
- 未授权页面(ShieldX 图标 + 提示文字)
- 加载中旋转动画
- fetchJson 全局客户端自动附加 Authorization header
- 401 响应触发重新认证
- JWT 存 sessionStorage,刷新不丢失

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 15:38:22 +08:00
kkfluousandClaude Opus 4.6 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
kkfluousandClaude Opus 4.6 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
kkfluousandClaude Sonnet 4.6 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
kkfluousandClaude Opus 4.6 460d17f07f fix: 合并图例到批次栏,压缩间距,最大化表格可见行数
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 11:59:06 +08:00
kkfluousandClaude Opus 4.6 ae42893d3e fix: 批次筛选移到全屏顶部为pill按钮,不占表格列
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 11:52:23 +08:00
kkfluousandClaude Opus 4.6 177ac9752f feat: 全屏表格增加批次筛选列,修复筛选依赖
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 11:48:12 +08:00
kkfluousandClaude Opus 4.6 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
kkfluousandClaude Opus 4.6 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
kkfluousandClaude Opus 4.6 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
kkfluousandClaude Opus 4.6 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
kkfluousandClaude Opus 4.6 affe356f43 fix: 默认日期改用本地时间,凌晨5点前显示前一天
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 01:13:52 +08:00
kkfluousandClaude Opus 4.6 e57b8d8801 fix: 全屏模式重新设计为纵向布局
ci/woodpecker/push/woodpecker Pipeline was successful
- 去掉 CSS transform 旋转(移动端不兼容)
- KPI 改为单行横排4个卡片
- 标题栏+KPI 紧凑排列在顶部
- 表格区域占满剩余空间,可滚动查看所有列
- 移动端和桌面端统一布局

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 00:38:26 +08:00
kkfluousandClaude Opus 4.6 8b95e53098 fix: 回到顶部改为 scrollTo(0) 确保完全回到页面顶端
用 window.scrollTo + documentElement.scrollTop 双重保险,
替代 scrollIntoView 避免只滚动到哨兵位置。
全屏模式改为 CSS transform 旋转实现移动端横屏。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 00:32:35 +08:00
kkfluousandClaude Opus 4.6 bfee8344b9 fix: 全屏按钮增加横屏锁定
点击全屏按钮后:进入浏览器全屏 + 锁定横屏方向
退出全屏时:解除横屏锁定

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 00:27:14 +08:00
kkfluousandClaude Opus 4.6 ca4a84f84b fix: 查询日期默认为当天
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 00:22:33 +08:00
kkfluousandClaude Opus 4.6 94277efc24 fix: 车辆详情清单标题也吸顶,与KPI合为一个sticky块
Tab栏 + KPI统计 + 清单标题 三层吸顶:
- Tab栏 sticky top-0
- KPI + 清单标题 sticky top-[44px]
移动端和Web端都生效。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 00:19:49 +08:00
kkfluousandClaude Opus 4.6 787fa27949 fix: overflow-x-hidden 改为 overflow-x:clip 修复 sticky 吸顶
overflow-x:hidden 会创建滚动容器导致 position:sticky 失效,
改用 overflow-x:clip 裁剪溢出但不破坏 sticky 定位。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 00:15:38 +08:00
kkfluousandClaude Opus 4.6 c5ee78e892 feat: Tab栏和KPI卡片吸顶固定
滚动列表时:
- Tab栏(实时监控/统计报表/每日汇报)sticky固定在顶部
- KPI统计卡片sticky固定在Tab栏下方,略缩小间距
- 背景色匹配页面避免透出内容

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 00:11:35 +08:00
kkfluousandClaude Opus 4.6 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
kkfluousandClaude Opus 4.6 1d8e827374 fix: 回到顶部按钮用 IntersectionObserver 检测+scrollIntoView
- 顶部放哨兵元素,离开视口时显示回到顶部按钮
- 点击用 scrollIntoView 替代 window.scrollTo,兼容各种布局

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 00:05:42 +08:00
kkfluousandClaude Opus 4.6 54c8449f7b fix: 用 IntersectionObserver 替代 scroll 事件实现瀑布流
scroll 事件在某些布局下不触发,改用 IntersectionObserver
监听列表底部哨兵元素,进入视口时自动加载下一页,更可靠。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 23:59:54 +08:00
kkfluousandClaude Opus 4.6 b7b254546c fix: 改进瀑布流滚动和回到顶部的可靠性
- 使用 ref 避免 loadMore 依赖导致事件重复注册
- 同时监听 window 和 document 的 scroll 事件
- 降低回到顶部按钮触发阈值到 400px
- 增大触底检测距离到 300px

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 23:52:38 +08:00
kkfluousandClaude Opus 4.6 82dac759be fix: 环比统计跟随筛选条件正确计算
每辆车缓存其昨日里程(yesterdayKm),筛选后的环比基于
相同筛选条件下的车辆计算,而非全局对比。
例如筛选"业务一部"后,今日和昨日都只统计一部的车辆。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 23:50:07 +08:00
kkfluousandClaude Opus 4.6 0b8bbbb063 feat: 支持查询指定日期里程+删除搜索关键词和车牌号筛选
- 后端支持 date 参数,指定日期时实时查询数据库(不用缓存)
- 同时查询前一天数据计算环比
- 高级筛选添加"查询日期"日期选择器
- 删除高级筛选中的"搜索关键词"和"车牌号"(已有快捷筛选)
- 筛选标签支持显示日期条件

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 23:41:03 +08:00
kkfluousandClaude Opus 4.6 cbf0e18634 fix: 里程环比改为真实值(与前一天对比)
- 后端缓存刷新时查询前一天总里程(yesterdayTotal)
- 前端计算真实环比:(今日-昨日)/昨日*100%
- 上涨显示蓝色↑,下跌显示红色↓
- 昨日无数据时不显示环比

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 23:33:52 +08:00
kkfluousandClaude Opus 4.6 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
kkfluousandClaude Opus 4.6 c73e20bacf fix: 快捷筛选按客户改为客户筛选、删除日期筛选、更新频率文案
- 快捷筛选"按客户"改为真正的客户名称筛选(独立于项目筛选)
- 删除高级筛选中的"日期区间"和"日期"(无后端支持)
- "40MIN更新"改为"每分钟更新"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 23:26:34 +08:00
kkfluousandClaude Opus 4.6 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
kkfluousandClaude Opus 4.6 cb620e5101 feat: 筛选条件标签展示+单独删除+清除全部
筛选后在 KPI 卡片上方展示活跃筛选条件标签(蓝色圆角),
每个标签可单独点×删除,右侧"清除"按钮重置所有筛选。
支持:部门/项目/主体/车牌/搜索/里程范围/地区。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 23:18:55 +08:00
kkfluousandClaude Opus 4.6 2469da310d fix: 里程范围筛选接入后端
- 后端支持 mileageMin/mileageMax 查询参数
- 前端点击"完成筛选"时将里程范围提交到后端
- "重置所有"同时清除已应用的里程范围

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 23:14:56 +08:00
kkfluousandClaude Opus 4.6 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
kkfluousandClaude Opus 4.6 2f6269e071 feat: 实时监控改为瀑布流无限滚动+回到顶部
- 移除分页按钮,改为滚动触底自动加载下一页
- 滚动超过600px时显示蓝色回到顶部按钮
- 底部提示加载状态(加载中.../已加载全部 N 条)
- 筛选/排序变化时自动重置为首页

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

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:11:52 +08:00
kkfluousandClaude Opus 4.6 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
kkfluousandClaude Opus 4.6 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
kkfluousandClaude Opus 4.6 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
kkfluousandClaude Opus 4.6 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
kkfluousandClaude Opus 4.6 dd1834477d fix: 修复统计报表完成率格式和项目名称显示
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:26:31 +08:00
kkfluousandClaude Opus 4.6 7e2eefc3da feat: 实现里程管理统计报表视图(1:1 复刻原型)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:16:39 +08:00
kkfluousandClaude Opus 4.6 167842408c feat: 实现里程管理实时监控视图(1:1 复刻原型)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:11:26 +08:00