feat(ele): 充电记录后台导入页面 /ele/import(隐藏入口)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
后端 - 新建 bi_ele_charge_record 表(首次访问自动 CREATE TABLE IF NOT EXISTS) 字段含订单编号(UNIQUE)、电站、时段、电量/费用、车牌/判定车牌、内外部分类、原始 JSON、批次号 - POST /api/ele/import:multipart 上传 xlsx,识别表头自动定位, 文件内 + 数据库双重去重(INSERT IGNORE on UNIQUE order_no) 上传时按 plate/judged_plate 在 tab_truck 中匹配,命中=internal、未命中但有牌=external、无牌=unknown - GET /api/ele/list 分页 + kind/batch/search 过滤 - GET /api/ele/batches 批次汇总(数量、内/外/未知拆分、电量/费用合计) - GET /api/ele/aggregate 全量与近 30 日按日 × 分类聚合 前端 - /ele/import 路径直接渲染 EleImportPage,主导航不显示,需手动输入 URL - 拖拽/点击上传,结果卡展示解析/新增/重复/分类 - KPI 8 卡:总数、内/外/未知记录、累计电量与费用、内/外电量 - 批次列表(点击筛选)+ 最新记录表(kind 切换 + 关键字搜索) - 上传后自动 reload 全部数据 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import AssetsModule from './modules/assets/AssetsModule';
|
||||
import MileageModule from './modules/mileage/MileageModule';
|
||||
import SchedulingModule from './modules/scheduling/SchedulingModule';
|
||||
import EnergyModule from './modules/energy/EnergyModule';
|
||||
import EleImportPage from './modules/ele/EleImportPage';
|
||||
import AuthProvider from './auth/AuthProvider';
|
||||
import { useAuth } from './auth/useAuth';
|
||||
import UnauthorizedPage from './auth/UnauthorizedPage';
|
||||
@@ -45,6 +46,11 @@ function AuthGate() {
|
||||
return <UnauthorizedPage message={error || undefined} />;
|
||||
}
|
||||
|
||||
// 隐藏后端管理页:仅通过 /ele/import 直接访问,主导航不出现
|
||||
if (typeof window !== 'undefined' && window.location.pathname === '/ele/import') {
|
||||
return <EleImportPage />;
|
||||
}
|
||||
|
||||
return <Shell modules={modules} />;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user