|
@@ -44,49 +44,113 @@ Ready for Development
|
|
|
- [ ] 任务1:创建薪资管理UI包基础结构 (AC: 1, 7)
|
|
- [ ] 任务1:创建薪资管理UI包基础结构 (AC: 1, 7)
|
|
|
- [ ] 创建目录:`allin-packages/salary-management-ui/`
|
|
- [ ] 创建目录:`allin-packages/salary-management-ui/`
|
|
|
- [ ] 复制并修改package.json:参考`allin-packages/platform-management-ui/package.json`,更新包名为`@d8d/allin-salary-management-ui`,添加对`@d8d/area-management-ui`的依赖
|
|
- [ ] 复制并修改package.json:参考`allin-packages/platform-management-ui/package.json`,更新包名为`@d8d/allin-salary-management-ui`,添加对`@d8d/area-management-ui`的依赖
|
|
|
|
|
+ - **参考文件**:`allin-packages/platform-management-ui/package.json`
|
|
|
|
|
+ - **修改点**:包名改为`@d8d/allin-salary-management-ui`,依赖调整,添加`@d8d/area-management-ui`
|
|
|
- [ ] 复制并修改tsconfig.json:参考`allin-packages/platform-management-ui/tsconfig.json`
|
|
- [ ] 复制并修改tsconfig.json:参考`allin-packages/platform-management-ui/tsconfig.json`
|
|
|
|
|
+ - **参考文件**:`allin-packages/platform-management-ui/tsconfig.json`
|
|
|
- [ ] 复制并修改vitest.config.ts:参考`allin-packages/platform-management-ui/vitest.config.ts`
|
|
- [ ] 复制并修改vitest.config.ts:参考`allin-packages/platform-management-ui/vitest.config.ts`
|
|
|
|
|
+ - **参考文件**:`allin-packages/platform-management-ui/vitest.config.ts`
|
|
|
- [ ] 创建基础目录结构:`src/`、`src/components/`、`src/api/`、`src/hooks/`、`src/types/`、`tests/`
|
|
- [ ] 创建基础目录结构:`src/`、`src/components/`、`src/api/`、`src/hooks/`、`src/types/`、`tests/`
|
|
|
|
|
+ - **参考结构**:`allin-packages/platform-management-ui/`目录结构
|
|
|
|
|
|
|
|
- [ ] 任务2:分析源UI页面结构和区域选择器集成 (AC: 2, 3)
|
|
- [ ] 任务2:分析源UI页面结构和区域选择器集成 (AC: 2, 3)
|
|
|
- [ ] 分析源文件:`allin_system-master/client/app/admin/dashboard/salary/page.tsx`
|
|
- [ ] 分析源文件:`allin_system-master/client/app/admin/dashboard/salary/page.tsx`
|
|
|
|
|
+ - **需迁移文件**:`allin_system-master/client/app/admin/dashboard/salary/page.tsx`
|
|
|
- [ ] 查看区域选择器组件:`packages/area-management-ui/src/components/AreaSelect.tsx`
|
|
- [ ] 查看区域选择器组件:`packages/area-management-ui/src/components/AreaSelect.tsx`
|
|
|
|
|
+ - **参考文件**:`packages/area-management-ui/src/components/AreaSelect.tsx`
|
|
|
- [ ] 参考对照文件:`allin-packages/platform-management-ui/src/components/PlatformManagement.tsx`和`allin-packages/company-management-ui/src/components/CompanyManagement.tsx`
|
|
- [ ] 参考对照文件:`allin-packages/platform-management-ui/src/components/PlatformManagement.tsx`和`allin-packages/company-management-ui/src/components/CompanyManagement.tsx`
|
|
|
|
|
+ - **参考文件1**:`allin-packages/platform-management-ui/src/components/PlatformManagement.tsx`
|
|
|
|
|
+ - **参考文件2**:`allin-packages/company-management-ui/src/components/CompanyManagement.tsx`
|
|
|
- [ ] 创建主组件:`src/components/SalaryManagement.tsx`
|
|
- [ ] 创建主组件:`src/components/SalaryManagement.tsx`
|
|
|
|
|
+ - **目标文件**:`allin-packages/salary-management-ui/src/components/SalaryManagement.tsx`
|
|
|
- [ ] 转换Ant Design组件为@d8d/shared-ui-components组件
|
|
- [ ] 转换Ant Design组件为@d8d/shared-ui-components组件
|
|
|
|
|
+ - **转换要点**:整合表格、表单、模态框、筛选功能于一个组件
|
|
|
|
|
+ - **架构**:使用React Query管理状态,React Hook Form + Zod处理表单,@d8d/shared-ui-components UI组件
|
|
|
|
|
+ - **功能**:薪资列表展示、搜索、创建、编辑、删除完整CRUD操作,区域选择器集成
|
|
|
- [ ] 集成区域选择器:使用`AreaSelect`组件替换原有的省份、城市、区县选择逻辑
|
|
- [ ] 集成区域选择器:使用`AreaSelect`组件替换原有的省份、城市、区县选择逻辑
|
|
|
|
|
+ - **集成方式**:导入`AreaSelect`组件,替换原有的Select组件逻辑
|
|
|
|
|
|
|
|
- [ ] 任务3:查看薪资模块RPC API调用路径并创建API客户端 (AC: 4)
|
|
- [ ] 任务3:查看薪资模块RPC API调用路径并创建API客户端 (AC: 4)
|
|
|
- [ ] 查看薪资模块集成测试:`allin-packages/salary-module/tests/integration/salary.integration.test.ts`
|
|
- [ ] 查看薪资模块集成测试:`allin-packages/salary-module/tests/integration/salary.integration.test.ts`
|
|
|
|
|
+ - **参考文件**:`allin-packages/salary-module/tests/integration/salary.integration.test.ts`
|
|
|
|
|
+ - **查看要点**:RPC客户端调用方式,特别是`byProvinceCity` API调用
|
|
|
- [ ] 查看薪资模块路由定义:`allin-packages/salary-module/src/routes/salary-custom.routes.ts`
|
|
- [ ] 查看薪资模块路由定义:`allin-packages/salary-module/src/routes/salary-custom.routes.ts`
|
|
|
|
|
+ - **参考文件**:`allin-packages/salary-module/src/routes/salary-custom.routes.ts`
|
|
|
|
|
+ - **查看要点**:API路径映射,参数定义
|
|
|
- [ ] 创建RPC客户端:`src/api/salaryClient.ts`
|
|
- [ ] 创建RPC客户端:`src/api/salaryClient.ts`
|
|
|
|
|
+ - **目标文件**:`allin-packages/salary-management-ui/src/api/salaryClient.ts`
|
|
|
|
|
+ - **参考文件**:`allin-packages/platform-management-ui/src/api/platformClient.ts`
|
|
|
|
|
+ - **架构**:使用rpcClient + ClientManager单例模式
|
|
|
- [ ] 实现`SalaryClientManager`类:使用rpcClient + ClientManager单例模式
|
|
- [ ] 实现`SalaryClientManager`类:使用rpcClient + ClientManager单例模式
|
|
|
|
|
+ - **模式**:单例模式,延迟初始化
|
|
|
|
|
+ - **方法**:`getInstance()`, `init()`, `get()`, `reset()`
|
|
|
- [ ] 导出`salaryClientManager`单例实例和`salaryClient`默认客户端实例
|
|
- [ ] 导出`salaryClientManager`单例实例和`salaryClient`默认客户端实例
|
|
|
- [ ] 创建类型定义:`src/api/types.ts`
|
|
- [ ] 创建类型定义:`src/api/types.ts`
|
|
|
|
|
+ - **目标文件**:`allin-packages/salary-management-ui/src/api/types.ts`
|
|
|
|
|
+ - **参考文件**:`allin-packages/platform-management-ui/src/api/types.ts`
|
|
|
|
|
+ - **类型**:使用`InferResponseType`, `InferRequestType`推导类型
|
|
|
|
|
|
|
|
- [ ] 任务4:完成状态管理和表单转换 (AC: 5, 6)
|
|
- [ ] 任务4:完成状态管理和表单转换 (AC: 5, 6)
|
|
|
- [ ] 转换Jotai状态管理为React Query
|
|
- [ ] 转换Jotai状态管理为React Query
|
|
|
|
|
+ - **实现方式**:在`SalaryManagement`组件中直接使用`useQuery`和`useMutation`
|
|
|
|
|
+ - **架构**:遵循参考组件模式,状态管理集成在主组件中
|
|
|
|
|
+ - **转换要点**:从Jotai状态管理转换为React Query服务端状态管理
|
|
|
- [ ] 转换Ant Design Form为React Hook Form + Zod
|
|
- [ ] 转换Ant Design Form为React Hook Form + Zod
|
|
|
|
|
+ - **实现**:使用`useForm`创建表单实例,集成`zodResolver`
|
|
|
|
|
+ - **表单**:创建表单和更新表单分别使用对应的Schema和类型
|
|
|
- [ ] 使用后端模块提供的Schema:`CreateSalarySchema`和`UpdateSalarySchema`
|
|
- [ ] 使用后端模块提供的Schema:`CreateSalarySchema`和`UpdateSalarySchema`
|
|
|
|
|
+ - **架构**:从后端模块导入`CreateSalarySchema`和`UpdateSalarySchema`
|
|
|
|
|
+ - **类型**:导入`CreateSalaryDto`和`UpdateSalaryDto`类型
|
|
|
|
|
+ - **源文件**:`allin-packages/salary-module/src/schemas/salary.schema.ts`
|
|
|
- [ ] 集成数值计算逻辑:基本工资、津贴、保险、公积金等计算
|
|
- [ ] 集成数值计算逻辑:基本工资、津贴、保险、公积金等计算
|
|
|
|
|
+ - **计算逻辑**:总额 = 基本工资 + 津贴 - 保险 - 公积金
|
|
|
|
|
+ - **显示**:在表单中实时计算并显示总额
|
|
|
- [ ] 实现复杂数值验证:正数验证、范围验证等
|
|
- [ ] 实现复杂数值验证:正数验证、范围验证等
|
|
|
|
|
+ - **验证规则**:使用Zod Schema进行数值范围验证
|
|
|
|
|
|
|
|
- [ ] 任务5:创建薪资选择器组件 (AC: 8)
|
|
- [ ] 任务5:创建薪资选择器组件 (AC: 8)
|
|
|
- [ ] 分析订单管理模块中的薪资选择需求:查看`allin_system-master/client/app/admin/dashboard/order/OrderDetailModal.tsx`和`AddOrderModal.tsx`
|
|
- [ ] 分析订单管理模块中的薪资选择需求:查看`allin_system-master/client/app/admin/dashboard/order/OrderDetailModal.tsx`和`AddOrderModal.tsx`
|
|
|
|
|
+ - **需求分析文件1**:`allin_system-master/client/app/admin/dashboard/order/OrderDetailModal.tsx`
|
|
|
|
|
+ - **需求分析文件2**:`allin_system-master/client/app/admin/dashboard/order/AddOrderModal.tsx`
|
|
|
|
|
+ - **查看要点**:`getSalaryByLocation`函数使用方式,薪资显示和调整逻辑
|
|
|
- [ ] 参考现有选择器组件模式:`allin-packages/platform-management-ui/src/components/PlatformSelector.tsx`
|
|
- [ ] 参考现有选择器组件模式:`allin-packages/platform-management-ui/src/components/PlatformSelector.tsx`
|
|
|
|
|
+ - **参考文件**:`allin-packages/platform-management-ui/src/components/PlatformSelector.tsx`
|
|
|
|
|
+ - **参考模式**:选择器组件结构、props设计、状态管理
|
|
|
- [ ] 创建薪资选择器组件:`src/components/SalarySelector.tsx`
|
|
- [ ] 创建薪资选择器组件:`src/components/SalarySelector.tsx`
|
|
|
|
|
+ - **目标文件**:`allin-packages/salary-management-ui/src/components/SalarySelector.tsx`
|
|
|
|
|
+ - **功能**:根据区域选择查询薪资,支持手动调整,显示薪资详情
|
|
|
- [ ] 集成区域选择器:与`AreaSelect`组件配合,支持区域选择后自动查询薪资
|
|
- [ ] 集成区域选择器:与`AreaSelect`组件配合,支持区域选择后自动查询薪资
|
|
|
|
|
+ - **集成方式**:使用`AreaSelect`组件进行区域选择,区域变化时自动查询薪资
|
|
|
|
|
+ - **参考文件**:`packages/area-management-ui/src/components/AreaSelect.tsx`
|
|
|
- [ ] 实现薪资查询逻辑:调用`getByProvinceCity` API查询薪资水平
|
|
- [ ] 实现薪资查询逻辑:调用`getByProvinceCity` API查询薪资水平
|
|
|
|
|
+ - **API调用**:使用`salaryClientManager.get().getByProvinceCity.$get`
|
|
|
|
|
+ - **查询条件**:根据选择的`provinceId`和`cityId`查询
|
|
|
- [ ] 添加组件导出:在`src/components/index.ts`中导出`SalarySelector`组件
|
|
- [ ] 添加组件导出:在`src/components/index.ts`中导出`SalarySelector`组件
|
|
|
|
|
+ - **目标文件**:`allin-packages/salary-management-ui/src/components/index.ts`
|
|
|
|
|
+ - **导出内容**:`SalarySelector`组件
|
|
|
|
|
|
|
|
- [ ] 任务6:编写集成测试 (AC: 9)
|
|
- [ ] 任务6:编写集成测试 (AC: 9)
|
|
|
- [ ] 创建主测试文件:`tests/integration/salary.integration.test.tsx`
|
|
- [ ] 创建主测试文件:`tests/integration/salary.integration.test.tsx`
|
|
|
|
|
+ - **目标文件**:`allin-packages/salary-management-ui/tests/integration/salary.integration.test.tsx`
|
|
|
|
|
+ - **参考文件**:`allin-packages/platform-management-ui/tests/integration/platform.integration.test.tsx`
|
|
|
- [ ] 实现完整CRUD流程测试:创建薪资 → 查询薪资列表 → 更新薪资 → 删除薪资
|
|
- [ ] 实现完整CRUD流程测试:创建薪资 → 查询薪资列表 → 更新薪资 → 删除薪资
|
|
|
|
|
+ - **测试场景**:创建薪资记录 → 查询薪资列表 → 更新薪资记录 → 删除薪资记录
|
|
|
|
|
+ - **参考模式**:平台管理集成测试中的完整流程
|
|
|
- [ ] 实现区域选择器集成测试:验证省份→城市→区县三级联动
|
|
- [ ] 实现区域选择器集成测试:验证省份→城市→区县三级联动
|
|
|
|
|
+ - **测试场景**:区域选择器组件集成,区域选择后表单字段更新
|
|
|
|
|
+ - **验证点**:区域ID正确传递,表单验证正常工作
|
|
|
- [ ] 实现数值计算测试:验证薪资计算逻辑
|
|
- [ ] 实现数值计算测试:验证薪资计算逻辑
|
|
|
|
|
+ - **测试场景**:基本工资、津贴、保险、公积金计算,总额显示
|
|
|
|
|
+ - **验证点**:计算逻辑正确,实时更新
|
|
|
- [ ] 实现错误处理测试:API错误、网络错误、验证错误
|
|
- [ ] 实现错误处理测试:API错误、网络错误、验证错误
|
|
|
|
|
+ - **测试场景**:API错误、网络错误、表单验证错误
|
|
|
|
|
+ - **参考模式**:平台管理集成测试中的错误处理
|
|
|
- [ ] 创建薪资选择器测试文件:`tests/integration/salary-selector.integration.test.tsx`
|
|
- [ ] 创建薪资选择器测试文件:`tests/integration/salary-selector.integration.test.tsx`
|
|
|
|
|
+ - **目标文件**:`allin-packages/salary-management-ui/tests/integration/salary-selector.integration.test.tsx`
|
|
|
|
|
+ - **参考文件**:`allin-packages/platform-management-ui/tests/integration/platform-selector.integration.test.tsx`
|
|
|
- [ ] 实现薪资选择器测试:区域选择、薪资查询、错误处理、组件复用
|
|
- [ ] 实现薪资选择器测试:区域选择、薪资查询、错误处理、组件复用
|
|
|
|
|
+ - **测试场景**:区域选择后自动查询薪资,薪资详情显示,手动调整功能,错误处理
|
|
|
|
|
+ - **验证点**:组件可被其他UI包导入使用
|
|
|
|
|
|
|
|
- [ ] 任务7:验证和测试 (AC: 10)
|
|
- [ ] 任务7:验证和测试 (AC: 10)
|
|
|
- [ ] 运行`pnpm typecheck`确保无类型错误
|
|
- [ ] 运行`pnpm typecheck`确保无类型错误
|
|
@@ -249,6 +313,7 @@ Ready for Development
|
|
|
| 2025-12-03 | 1.0 | 初始创建故事008.004 | Scrum Master Bob |
|
|
| 2025-12-03 | 1.0 | 初始创建故事008.004 | Scrum Master Bob |
|
|
|
| 2025-12-03 | 1.1 | 添加薪资选择器组件任务,基于订单管理模块需求分析 | Scrum Master Bob |
|
|
| 2025-12-03 | 1.1 | 添加薪资选择器组件任务,基于订单管理模块需求分析 | Scrum Master Bob |
|
|
|
| 2025-12-03 | 1.2 | 更新状态为Ready for Development | Scrum Master Bob |
|
|
| 2025-12-03 | 1.2 | 更新状态为Ready for Development | Scrum Master Bob |
|
|
|
|
|
+| 2025-12-03 | 1.3 | 在任务中直接标注文件路径,参考之前故事格式 | Scrum Master Bob |
|
|
|
|
|
|
|
|
## Dev Agent Record
|
|
## Dev Agent Record
|
|
|
*This section is populated by the development agent during implementation*
|
|
*This section is populated by the development agent during implementation*
|