In Progress
作为企业用户, 我希望查看和管理残疾人人才信息, 以便进行人才分配和就业管理。
docs/小程序原型/yongren.html中的人才管理页面依赖故事:
mini/src/api.ts:disabilityClient - 残疾人才API(路径前缀:/api/v1/disability)enterpriseDisabilityClient - 企业专用残疾人才API(路径前缀:/api/v1/yongren/disability-person)推荐使用orderClient - 订单管理API(路径前缀:/api/v1/order)salaryClient - 薪资管理API(路径前缀:/api/v1/salary)enterpriseCompanyClient - 企业统计API(路径前缀:/api/v1/yongren/company)fileClient - 文件管理API(路径前缀:/api/v1/file)pages/yongren/talent/list 和 pages/yongren/talent/detailYongrenTabBarLayout(底部导航布局)、UserStatusBar(用户状态栏)、PageContainer(页面容器)EnterpriseAuthProvider(认证上下文)、useEnterpriseAuth钩子(登录状态管理)mini/src/pages/login/index.tsx),UI严格对照原型设计useRequireAuth钩子)YongrenTabBarLayout布局组件,人才标签激活状态GET /api/v1/yongren/disability-person - 企业专用人才列表查询接口GET /api/v1/yongren/disability-person/{id} - 企业专用人才详情查询接口enterpriseDisabilityClient已集成到API客户端useRequireAuth钩子进行权限保护原型对比分析:通过对比原型文件 docs/小程序原型/yongren.html 和实际代码实现,发现以下差异:
核心功能已完整实现(对应验收标准1-5):
原型包含的功能(已作为增强任务实现):
实施建议:
背景:为实现更好的模块化和代码复用,史诗011的UI组件已拆分为独立的mini-ui-packages。
当前架构:
@d8d/yongren-talent-management-ui - 包含人才列表和详情页面组件@d8d/yongren-shared-ui - 提供YongrenTabBarLayout等共享组件@d8d/mini-shared-ui-components - 提供PageContainer等基础组件@d8d/mini-enterprise-auth-ui - 提供认证相关钩子影响:
残疾人才API(disability_person模块)- 通用版本:
disabilityClient(已在mini/src/api.ts中可用,由故事011.001集成)/api/v1/disabilityGET / - 人才列表查询接口(支持搜索、筛选、分页)search?(姓名、残疾证号)、status?(工作状态)、disability_type?(残疾类型)、page?、limit?GET /{id} - 人才详情查询接口GET /stats - 人才统计接口使用示例:
import { disabilityClient } from '@/api'
// 获取人才列表(带搜索和筛选)
const talentList = await disabilityClient.get({
query: {
search: '张明',
status: '在职',
disability_type: '肢体残疾',
page: 1,
limit: 20
}
})
// 获取人才详情
const talentDetail = await disabilityClient[':id'].get({
param: { id: '123' }
})
企业专用残疾人才API(disability_person模块扩展):
/api/v1/disability)返回所有人才数据,未按企业过滤。企业专用人才API(/api/v1/yongren/disability-person)只返回当前企业用户关联的人才数据,确保数据安全隔离。enterpriseDisabilityClient(已在mini/src/api.ts中可用,由故事011.001集成)/api/v1/yongren/disability-personGET / - 企业专用人才列表查询接口(支持搜索、筛选、分页,仅返回当前企业关联人才)keyword?(搜索关键词,支持姓名、残疾证号)、disability_type?(残疾类型)、page?、limit?GET /{id} - 企业专用人才详情查询接口(验证人员是否属于当前企业)GET /{id}/work-history - 人才工作历史查询接口(已通过故事012.003实现)GET /{id}/salary-history - 人才薪资历史查询接口(已通过故事012.003实现)GET /{id}/credit-info - 人才征信信息查询接口(已通过故事012.003实现)GET /{id}/videos - 人才视频关联查询接口(已通过故事012.003实现)使用示例:
import { enterpriseDisabilityClient } from '@/api'
// 获取企业专用人才列表(带搜索和筛选)
const talentList = await enterpriseDisabilityClient.$get({
query: {
keyword: '张明',
disability_type: '肢体残疾',
page: 1,
limit: 20
}
})
// 获取企业专用人才详情
const talentDetail = await enterpriseDisabilityClient[':id'].$get({
param: { id: '123' }
})
订单管理API(order模块)- 企业专用版本:
/api/v1/order)返回所有订单数据。企业用户应使用企业专用残疾人才API的work-history子路由,仅返回当前企业关联人才的工作历史。work-history子路由(已通过故事012.003实现)
/api/v1/yongren/disability-person/{id}/work-historyenterpriseDisabilityClient[':id']['work-history']使用示例:
import { enterpriseDisabilityClient } from '@/api'
// 获取人才工作历史(企业专用版本)
const workHistory = await enterpriseDisabilityClient[':id']['work-history'].$get({
param: { id: '123' }
})
薪资管理API(salary模块)- 企业专用版本:
/api/v1/salary)返回所有薪资数据。企业用户应使用企业专用残疾人才API的salary-history子路由,仅返回当前企业关联人才的薪资历史。salary-history子路由(已通过故事012.003实现)
/api/v1/yongren/disability-person/{id}/salary-historyenterpriseDisabilityClient[':id']['salary-history']使用示例:
import { enterpriseDisabilityClient } from '@/api'
// 获取人才薪资历史(企业专用版本)
const salaryHistory = await enterpriseDisabilityClient[':id']['salary-history'].$get({
param: { id: '123' },
query: {
start_date: '2024-01-01',
end_date: '2024-12-31',
page: 1,
limit: 20
}
})
文件管理API(file模块):
fileClient(已在mini/src/api.ts中可用,由故事011.001集成)/api/v1/fileGET /list - 文件列表查询接口(支持按关联类型和关联ID筛选)relation_type(如'disabled_person')、relation_id(人才ID)GET /download/{id} - 文件下载接口(验证文件权限)GET /preview/{id} - 文件预览接口(返回预览URL,验证文件权限)使用示例:
import { fileClient } from '@/api'
// 获取人才相关文件列表(自动验证企业权限)
const fileList = await fileClient.list.get({
query: {
relation_type: 'disabled_person',
relation_id: '123' // 人才ID,API会验证该人才是否属于当前企业
}
})
// 下载文件(自动验证文件权限)
const downloadUrl = fileClient.download[':id'].getUrl({ param: { id: 'file_456' } })
企业统计API(企业扩展):
enterpriseCompanyClient(已在mini/src/api.ts中可用,由故事011.001集成)/api/v1/yongren/companyGET /overview - 企业概览统计(已实现,故事012.003)GET /{id}/talents - 企业维度人才统计(已实现,故事012.003)GET /allocations/recent - 近期分配人才列表(已通过故事012.010实现,返回最近30天入职的人才列表)使用示例:
import { enterpriseCompanyClient } from '@/api'
// 获取企业概览统计(已实现)
const companyOverview = await enterpriseCompanyClient.overview.$get()
// 获取近期分配人才列表(已通过故事012.010实现)
const recentAllocations = await enterpriseCompanyClient.allocations.recent.$get({
query: { limit: 5 } // 可选参数,限制返回记录数
})
技术集成:
基础组件集成(由故事011.001提供): 人才管理页面必须与故事011.001已实现的基础框架无缝集成:
布局组件:
YongrenTabBarLayout - 底部导航布局组件,人才管理页面需要使用此布局,并确保"人才"标签处于激活状态PageContainer - 页面容器组件,提供统一的页面内边距和滚动容器UserStatusBar - 用户状态栏组件,显示当前用户信息和通知状态(可选使用)页面结构模板:
// 人才列表页基本结构示例
import { YongrenTabBarLayout } from '@/layouts/yongren-tab-bar-layout'
import { PageContainer } from '@/components/ui/page-container'
export default function TalentListPage() {
return (
<YongrenTabBarLayout activeTab="talent">
<PageContainer>
{/* 页面具体内容 */}
</PageContainer>
</YongrenTabBarLayout>
)
}
认证集成:
useRequireAuth钩子(由故事011.002提供)保护页面,未登录用户自动重定向到登录页useEnterpriseAuth钩子(由故事011.001提供)获取当前企业用户信息示例:
import { useRequireAuth } from '@/hooks/useRequireAuth'
export default function TalentListPage() {
// 未登录用户会自动重定向到登录页
useRequireAuth()
// 页面具体实现...
}
样式规范:
docs/小程序原型/yongren.html 实现UI细节人才列表页设计规范:
必须严格对照原型文件 docs/小程序原型/yongren.html 第419-560行的人才列表页面设计实现:
页面结构:
h-[calc(100%-60px)] overflow-y-auto(仅减去底部导航60px)搜索和筛选区域(第434-447行):
p-4 border-b border-gray-200flex items-center bg-gray-100 rounded-lg px-4 py-2 mb-3
<i class="fas fa-search text-gray-400 mr-2"></i><input type="text" placeholder="搜索姓名、残疾证号..." class="w-full bg-transparent outline-none">flex space-x-2 overflow-x-auto pb-2
bg-blue-100 text-blue-800 text-xs px-3 py-1 rounded-full whitespace-nowrap(激活状态)bg-gray-100 text-gray-800 text-xs px-3 py-1 rounded-full whitespace-nowrap列表标题区域(第451-461行):
flex justify-between items-center mb-4<h3 class="font-semibold text-gray-700">全部人才 (32)</h3>flex space-x-2
<button class="text-gray-500"><i class="fas fa-sort"></i></button><button class="text-gray-500"><i class="fas fa-filter"></i></button>人才卡片列表(第463-560行):
space-y-3person-card card bg-white p-4 flex items-center(复用基础样式)
name-avatar blue(颜色类:blue, green, purple等),显示姓氏flex-1flex justify-between items-start
<h4 class="font-semibold text-gray-800">张明</h4><p class="text-xs text-gray-500">肢体残疾 · 三级 · 男 · 28岁</p><span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded-full">在职</span>mt-2 flex justify-between text-xs text-gray-500
入职: 2023-08-15薪资: ¥4,800人才详情页设计规范:
必须严格对照原型文件 docs/小程序原型/yongren.html 第561-864行的人才详情页面设计实现:
页面结构:
h-[calc(100%-60px)] overflow-y-auto(仅减去底部导航60px)顶部信息区域(第576-605行):
gradient-bg text-white p-5flex justify-between items-start
flex items-centerw-16 h-16 rounded-full border-2 border-white mr-4 flex items-center justify-center bg-blue-500 text-white text-2xl font-bold,显示姓氏<h2 class="text-xl font-bold">张明</h2>,<p class="text-sm opacity-80">肢体残疾 · 三级 · 在职</p>bg-white/20 rounded-full p-2,图标 <i class="fas fa-ellipsis-v text-white"></i>mt-4 flex justify-between,三个卡片横向排列
text-center,数值 <p class="text-2xl font-bold">¥4,800</p>,标签 <p class="text-xs opacity-80">当前薪资</p>详细信息区域(第608-864行):
p-4基本信息卡片(第610-634行):
card bg-white p-4 mb-4<h3 class="font-semibold text-gray-700 mb-3">基本信息</h3>grid grid-cols-2 gap-3 text-sm
<p class="text-gray-500">性别</p>,值 <p class="text-gray-800">男</p>col-span-2 跨两列工作信息卡片(第637-657行):
card bg-white p-4 mb-4<h3 class="font-semibold text-gray-700 mb-3">工作信息</h3>space-y-3 text-sm
flex justify-between<p class="text-gray-500">入职日期</p><p class="text-gray-800">2023-08-15</p> 或状态标签 <span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded-full">在职</span>薪资信息卡片(第660-...行):
card bg-white p-4 mb-4<h3 class="font-semibold text-gray-700 mb-3">薪资信息</h3>历史工作内容时间线(原型第673-739行):
card bg-white p-4 mb-4<h3 class="font-semibold text-gray-700 mb-3">历史工作内容</h3>工作视频管理区域(原型第765-829行):
card bg-white p-4 mb-4<h3 class="font-semibold text-gray-700">工作视频</h3>,右侧有"查看更多"链接详情页操作按钮(原型第831-839行):
flex space-x-3,底部固定按钮区域flex-1 bg-blue-500 text-white py-3 rounded-lg font-medium,图标<i class="fas fa-phone mr-2"></i>,文本"联系"flex-1 bg-gray-100 text-gray-800 py-3 rounded-lg font-medium,图标<i class="fas fa-edit mr-2"></i>,文本"编辑"个人征信文件区域(原型中可能在其他位置):
UI组件使用:
YongrenTabBarLayout - 从@d8d/yongren-shared-ui/components/YongrenTabBarLayout导入(底部导航布局组件,必须使用,人才标签激活状态)PageContainer - 从@d8d/mini-shared-ui-components/components/page-container导入(页面容器组件,提供统一的内边距和滚动容器)UserStatusBar - 用户状态栏组件(可选,用于显示用户信息和通知).card样式规范(圆角12px,阴影等)@d8d/yongren-talent-management-ui包中):
TalentManagement组件 - 人才列表页面组件,包含搜索、筛选、分页功能TalentDetail组件 - 人才详情页面组件,展示完整人才信息useAuth和useRequireAuth - 从@d8d/mini-enterprise-auth-ui/hooks导入(企业认证上下文和页面访问权限检查)docs/小程序原型/yongren.html 实现UI细节当前架构(已按mini-ui-packages拆分):
人才管理UI包:
@d8d/yongren-talent-management-ui(位于mini-ui-packages/yongren-talent-management-ui/)src/pages/TalentManagement/TalentManagement.tsx - 人才列表页面组件YongrenTabBarLayout布局,activeTab="talent"PageContainer作为内容容器pages/yongren/talent/listsrc/pages/TalentDetail/TalentDetail.tsx - 人才详情页面组件YongrenTabBarLayout布局,activeTab="talent"PageContainer作为内容容器pages/yongren/talent/detailsrc/api/enterpriseDisabilityClient.ts - 企业专用残疾人才API客户端src/api/index.ts - API客户端导出文件依赖的UI包:
@d8d/yongren-shared-ui/components/YongrenTabBarLayout - YongrenTabBarLayout组件(底部导航布局)@d8d/mini-shared-ui-components/components/page-container - PageContainer组件(页面容器)@d8d/mini-enterprise-auth-ui/hooks - useAuth和useRequireAuth钩子(企业认证上下文和页面访问权限检查)@d8d/allin-disability-module - 残疾人才模块类型定义桥接文件位置(在mini项目中):
mini/src/pages/yongren/talent/list/index.tsx - 人才列表页面桥接文件
@d8d/yongren-talent-management-ui导入TalentManagement组件pages/yongren/talent/listmini/src/pages/yongren/talent/detail/index.tsx - 人才详情页面桥接文件
@d8d/yongren-talent-management-ui导入TalentDetail组件pages/yongren/talent/detail测试文件位置:
@d8d/yongren-talent-management-ui包内编写单元测试tests/目录中编写集成测试基于史诗012扩展的数据库schema:
disabled_person表已添加birth_date字段,用于准确年龄计算 [来源:docs/stories/012.001.story.md#数据模型]order_person_asset表的asset_type枚举已扩展视频类型 [来源:docs/stories/012.001.story.md#数据模型]users2表已添加company_id字段,用于关联企业用户 [来源:docs/stories/012.001.story.md#数据模型]测试框架:Jest + Testing Library 关键测试场景:
| 日期 | 版本 | 描述 | 作者 |
|---|---|---|---|
| 2025-12-17 | 1.0 | 初始创建(人才管理故事) | Bob(Scrum Master) |
| 2025-12-18 | 1.1 | 根据故事011.001和011.002完成情况更新文档 | John(产品经理) |
| 2025-12-18 | 1.2 | 更新依赖关系:详细列出已完成的011.001和011.002提供的功能 | John(产品经理) |
| 2025-12-18 | 1.3 | 更新API规范:添加具体客户端信息、路径前缀和使用示例 | John(产品经理) |
| 2025-12-18 | 1.4 | 更新组件规范:添加基础组件集成说明和页面结构模板 | John(产品经理) |
| 2025-12-18 | 1.5 | 更新文件位置:区分已实现的基础组件和需要创建的页面组件 | John(产品经理) |
| 2025-12-18 | 1.6 | 更新状态:从Draft改为Ready for Development | John(产品经理) |
| 2025-12-18 | 1.7 | 更新API规范:标注/allocations/recent接口已通过故事012.010实现 |
Claude Code |
| 2025-12-18 | 1.8 | 更新验收标准:标记所有验收标准为已完成 | James(开发工程师) |
| 2025-12-18 | 1.9 | 更新API规范:添加企业专用残疾人才API和依赖故事012.011 | Claude Code |
| 2025-12-19 | 1.10 | 修复人才详情页API使用:改用enterpriseDisabilityClient企业专用API,修复RPC客户端路径参数语法 | Claude Code |
| 2025-12-20 | 1.11 | 更新文档以反映mini-ui-packages拆分后的实际情况:更新文件位置、组件规范,添加架构变更说明 | James(开发工程师) |
| 2025-12-20 | 1.12 | 根据原型对比分析,补充缺失功能任务:添加任务7-9实现历史工作内容时间线、工作视频管理和详情页操作按钮,更新组件规范和原型对比说明 | James(开发工程师) |
| 2025-12-20 | 1.13 | 更新任务7-9状态为已完成,更新原型对比说明和实施建议 | James(开发工程师) |
| 2025-12-20 | 1.14 | 根据原型对比检查,添加任务10进行人才详情页样式统一 | James(开发工程师) |
claude-sonnet
enterpriseCompanyClient.allocations.recent路径不存在refresh_token字段类型不匹配mini/src/pages/yongren/talent/list/index.tsxmini/src/pages/yongren/talent/detail/index.tsxindex.css文件enterpriseCompanyClient.overview.get()调用应为$get()allocations.recentAPI调用,使用空数组临时替代(注:该接口已通过故事012.010实现)const { token, user, refresh_token } = await response.json() as { token: string; user: User; refresh_token?: string }/allocations/recent接口GET /allocations/recent接口已实现并可用disabilityClient改为enterpriseDisabilityClient{id}改为:idwork-history、salary-history、credit-infoas any类型断言salary、monthlySalary、currentSalary等字段不存在personId、name、gender、idCard等文件ID、文件URL、上传时间等实际字段,而非视频ID、视频标题docs/小程序原型/yongren.html 第561-864行与实现代码GET /allocations/recent接口在实际实现中不存在(史诗012未实现此接口)✅ 已解决 - 已创建故事012.010专门实现此接口companyName字段,使用name字段替代 ✅ 已了解 - 前端已适配使用user.name字段disabilityClient而非企业专用enterpriseDisabilityClient,存在数据安全风险 ✅ 已解决 - 已修复API客户端使用,改为企业专用API,确保数据安全隔离allocations.recent接口引用 ✅ 已完成 - 已更新API规范,注明接口将在故事012.010实现/allocations/recent接口实现,或使用现有/company/overview接口 ✅ 已实施 - 已创建故事012.010专门实现此接口来自QA代理对已完成故事实施的QA审查结果