Ready for Review
作为企业用户, 我希望查看和管理残疾人人才信息, 以便进行人才分配和就业管理。
docs/小程序原型/yongren.html中的人才管理页面依赖故事:
mini/src/api.ts:disabilityClient - 残疾人才API(路径前缀:/api/v1/disability)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布局组件,人才标签激活状态useRequireAuth钩子进行权限保护残疾人才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(order模块):
orderClient(已在mini/src/api.ts中可用,由故事011.001集成)/api/v1/orderGET /person/{person_id} - 人才工作信息查询接口(获取指定人才的相关订单信息)GET /history - 订单历史查询接口(支持按人才ID筛选)使用示例:
import { orderClient } from '@/api'
// 获取人才工作信息
const workInfo = await orderClient.person['{person_id}'].get({
param: { person_id: '123' }
})
// 获取订单历史
const orderHistory = await orderClient.history.get({
query: { person_id: '123', page: 1, limit: 10 }
})
薪资管理API(salary模块):
salaryClient(已在mini/src/api.ts中可用,由故事011.001集成)/api/v1/salaryGET /person/{person_id} - 薪资记录查询接口(获取指定人才的薪资记录)GET /history/{person_id} - 薪资历史接口(获取指定人才的薪资历史,支持时间范围筛选)使用示例:
import { salaryClient } from '@/api'
// 获取人才薪资记录
const salaryRecords = await salaryClient.person['{person_id}'].get({
param: { person_id: '123' }
})
// 获取薪资历史
const salaryHistory = await salaryClient.history['{person_id}'].get({
param: { person_id: '123' },
query: { start_date: '2024-01-01', end_date: '2024-12-31' }
})
文件管理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'
}
})
// 下载文件
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>个人征信文件区域(原型中可能在其他位置):
UI组件使用:
YongrenTabBarLayout - 底部导航布局组件(必须使用,人才标签激活状态)PageContainer - 页面容器组件(提供统一的内边距和滚动容器)UserStatusBar - 用户状态栏组件(可选,用于显示用户信息和通知).card样式规范(圆角12px,阴影等)docs/小程序原型/yongren.html 实现UI细节@d8d/allin-*系列UI包基础组件位置(已由故事011.001实现):
mini/src/layouts/yongren-tab-bar-layout.tsx - YongrenTabBarLayout组件(底部导航布局)mini/src/components/ui/page-container.tsx - PageContainer组件(页面容器)mini/src/components/ui/user-status-bar.tsx - UserStatusBar组件(用户状态栏,可选)mini/src/utils/auth.tsx - EnterpriseAuthProvider和useEnterpriseAuth钩子(企业认证上下文)mini/src/hooks/useRequireAuth.ts - useRequireAuth钩子(页面访问权限检查,由故事011.002添加)mini/src/api.ts - 所有API客户端主文件(包含disabilityClient、orderClient、salaryClient、fileClient等)mini/src/app.config.ts - 小程序路由配置文件(已包含人才管理页面路由占位符)页面组件位置(需要创建):
mini/src/pages/yongren/talent/list/index.tsx - 人才列表页面组件
YongrenTabBarLayout布局,activeTab="talent"PageContainer作为内容容器pages/yongren/talent/listmini/src/pages/yongren/talent/detail/index.tsx - 人才详情页面组件
YongrenTabBarLayout布局,activeTab="talent"PageContainer作为内容容器pages/yongren/talent/detail业务组件位置(需要创建):
mini/src/components/talent/ - 人才管理相关业务组件目录
TalentSearch.tsx - 人才搜索组件(集成到列表页搜索区域)TalentFilter.tsx - 人才筛选组件(支持工作状态、残疾类型等多维度筛选)TalentTable.tsx - 人才表格组件(或TalentCard.tsx卡片组件)TalentDetailInfo.tsx - 人才详情信息组件(展示基本信息、工作信息、薪资信息等)SalaryHistory.tsx - 薪资历史组件(展示薪资变化趋势和图表)CreditFileList.tsx - 个人征信文件列表组件(展示、预览、下载文件)测试文件位置(需要创建):
mini/tests/yongren-talent-list.test.tsx - 人才列表页测试mini/tests/yongren-talent-detail.test.tsx - 人才详情页测试mini/tests/yongren-talent-api.test.ts - 人才管理API集成测试(可扩展现有yongren-api.test.ts)基于史诗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 |
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接口已实现并可用GET /allocations/recent接口在实际实现中不存在(史诗012未实现此接口)✅ 已解决 - 已创建故事012.010专门实现此接口companyName字段,使用name字段替代 ✅ 已了解 - 前端已适配使用user.name字段allocations.recent接口引用 ✅ 已完成 - 已更新API规范,注明接口将在故事012.010实现/allocations/recent接口实现,或使用现有/company/overview接口 ✅ 已实施 - 已创建故事012.010专门实现此接口来自QA代理对已完成故事实施的QA审查结果