chore: 添加输入输出文件 + .claude记忆和计划
输入文件:
- 租赁任务考核_2026年{1,2,3}月.xlsx (考核源数据)
- {1,2}月.xlsx (客户盈亏表)
- 车辆里程考核与奖金发放规则(V.1.2).docx
输出文件:
- 里程任务考核_{1,2,3}月核算.xlsx (月度核算结果)
- 里程任务考核_Q1汇总.xlsx (含车辆台账)
- 3月客户盈亏表(待填写).xlsx (模版)
.claude_memory: 项目记忆(规则/偏好/架构/测试车辆)
.claude_plans: 历次计划文件
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
72
.claude_plans/cuddly-strolling-rivest.md
Normal file
72
.claude_plans/cuddly-strolling-rivest.md
Normal file
@@ -0,0 +1,72 @@
|
||||
# 资产状态多选改造
|
||||
|
||||
## Context
|
||||
当前"总体任务-实时里程"页面的"资产状态"筛选器是单选下拉框,用户需要改为支持多选,以便同时筛选多个资产状态(如同时查看"在库"和"租赁"的车辆)。
|
||||
|
||||
## 后端接口修改建议
|
||||
|
||||
后端 API 端点:`GET /mileage/vehicle/list`
|
||||
|
||||
当前 `storageStatus` 参数为 `string` 类型(单值),需要改为支持多值。**建议两种方案(推荐方案一)**:
|
||||
|
||||
### 方案一:逗号分隔字符串(推荐,改动最小)
|
||||
- 参数名不变:`storageStatus`
|
||||
- 类型不变:`String`
|
||||
- 前端传值:`storageStatus=在库,租赁,自营`
|
||||
- 后端解析:用 `split(",")` 拆分为数组,SQL 查询改为 `WHERE storage_status IN (...)`
|
||||
- **优点**:前后端改动最小,URL 参数简洁,向后兼容(单值时无逗号,行为不变)
|
||||
|
||||
### 方案二:数组参数
|
||||
- 参数名改为:`storageStatuses` 或 `storageStatus[]`
|
||||
- 前端传值:`storageStatuses=在库&storageStatuses=租赁`
|
||||
- 后端用 `@RequestParam List<String> storageStatuses` 接收
|
||||
- **优点**:更 RESTful;**缺点**:前后端改动较大
|
||||
|
||||
### 后端改动清单(方案一)
|
||||
1. Controller 层:参数类型保持 `String storageStatus`
|
||||
2. Service 层:`storageStatus.split(",")` 得到数组
|
||||
3. MyBatis/SQL:将 `WHERE storage_status = #{storageStatus}` 改为:
|
||||
```xml
|
||||
<if test="storageStatusList != null and storageStatusList.size() > 0">
|
||||
AND storage_status IN
|
||||
<foreach collection="storageStatusList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
```
|
||||
4. 导出接口 `/mileage/vehicle/export` 同理修改
|
||||
|
||||
## 前端修改计划
|
||||
|
||||
### 涉及文件
|
||||
1. `src/pages/VehicleManagement/index.tsx` — 主页面
|
||||
2. `src/services/vehicleService.ts` — API 服务
|
||||
3. `src/types/mileage.ts` — 类型定义
|
||||
4. `src/pages/H5Mobile/index.tsx` — 移动端页面(同步修改)
|
||||
|
||||
### 修改步骤
|
||||
|
||||
#### Step 1: 修改类型定义 (`src/types/mileage.ts`)
|
||||
- `storageStatus?: string` → `storageStatus?: string | string[]`(兼容多选)
|
||||
|
||||
#### Step 2: 修改 API 服务 (`src/services/vehicleService.ts`)
|
||||
- `getVehicleList` 的 `storageStatus` 类型改为 `string | string[]`
|
||||
- `exportVehicleList` 的 `storageStatus` 类型同样修改
|
||||
- 在传参时,如果是数组则 `join(',')` 转为逗号分隔字符串发送给后端
|
||||
|
||||
#### Step 3: 修改主页面 (`src/pages/VehicleManagement/index.tsx`)
|
||||
- **搜索参数初始化** (L94): `storageStatus: undefined` → 类型改为 `string[] | undefined`
|
||||
- **重置** (L346): 保持 `storageStatus: undefined`
|
||||
- **Select 组件** (L1607-1619): 添加 `mode="multiple"` 属性,启用多选
|
||||
- **导出参数** (L1800): 数组 join(',') 传给导出函数
|
||||
- **loadData** (L192): 在传参前将数组 join(',')
|
||||
|
||||
#### Step 4: 修改移动端页面 (`src/pages/H5Mobile/index.tsx`)
|
||||
- 同步修改 Select 为多选模式
|
||||
|
||||
## 验证方式
|
||||
1. 打开"总体任务-实时里程"页面,确认资产状态下拉框可多选
|
||||
2. 选择多个状态后点击搜索,检查网络请求参数格式正确(逗号分隔)
|
||||
3. 点击重置,确认多选状态被清空
|
||||
4. 导出 Excel 时确认多选参数正确传递
|
||||
5. 移动端页面同步验证
|
||||
Reference in New Issue
Block a user