|
|
@@ -6,22 +6,19 @@ import { PageContainer } from '@d8d/mini-shared-ui-components/components/page-co
|
|
|
import { Navbar } from '@d8d/mini-shared-ui-components/components/navbar'
|
|
|
import { enterpriseDisabilityClient } from '../../api'
|
|
|
import { useRequireAuth } from '@d8d/mini-enterprise-auth-ui/hooks'
|
|
|
-import type { InferResponseType } from 'hono/client'
|
|
|
+// 直接从后端模块导入类型定义
|
|
|
+import type {
|
|
|
+ WorkHistoryItem,
|
|
|
+ SalaryHistoryItem,
|
|
|
+ SalaryHistoryResponse,
|
|
|
+ CreditInfoItem,
|
|
|
+ PersonVideoItem
|
|
|
+} from '@d8d/allin-disability-module/routes'
|
|
|
|
|
|
export interface TalentDetailProps {
|
|
|
// 组件属性定义(目前为空)
|
|
|
}
|
|
|
|
|
|
-// 从RPC客户端推断类型
|
|
|
-type WorkHistoryResponse = InferResponseType<typeof enterpriseDisabilityClient[':id']['work-history']['$get'], 200>
|
|
|
-type SalaryHistoryResponse = InferResponseType<typeof enterpriseDisabilityClient[':id']['salary-history']['$get'], 200>
|
|
|
-type CreditInfoResponse = InferResponseType<typeof enterpriseDisabilityClient[':id']['credit-info']['$get'], 200>
|
|
|
-
|
|
|
-// 提取数组元素类型
|
|
|
-type WorkHistoryItem = WorkHistoryResponse['工作历史'][number]
|
|
|
-type SalaryHistoryItem = SalaryHistoryResponse['薪资历史'][number]
|
|
|
-type CreditInfoItem = CreditInfoResponse['征信信息'][number]
|
|
|
-
|
|
|
|
|
|
const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
const { isLoggedIn } = useRequireAuth()
|
|
|
@@ -225,7 +222,7 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
// 企业专用视频API返回结构:{ 视频列表: [...] }
|
|
|
const videoList = data?.视频列表 || []
|
|
|
// 转换为VideoData数组
|
|
|
- return videoList.map((item) => ({
|
|
|
+ return videoList.map((item: PersonVideoItem) => ({
|
|
|
id: item.文件ID || '',
|
|
|
title: item.视频类型 || '未命名视频',
|
|
|
url: item.文件URL || undefined,
|
|
|
@@ -550,7 +547,7 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
</View>
|
|
|
) : creditFiles && creditFiles.length > 0 ? (
|
|
|
<View className="space-y-3">
|
|
|
- {creditFiles.map((file) => (
|
|
|
+ {creditFiles.map((file: { id: string; name: string; size?: number; createdAt?: string }) => (
|
|
|
<View key={file.id} className="flex justify-between items-center p-3 bg-gray-50 rounded-lg">
|
|
|
<View className="flex items-center">
|
|
|
<Text className="i-heroicons-document-text-20-solid text-gray-400 mr-2" />
|
|
|
@@ -601,13 +598,13 @@ const TalentDetail: React.FC<TalentDetailProps> = () => {
|
|
|
<View className="space-y-3">
|
|
|
{/* 按分类分组显示 */}
|
|
|
{['个税视频', '工资视频', '工作视频', '其他'].map((category) => {
|
|
|
- const categoryVideos = videos.filter(v => v.category === category)
|
|
|
+ const categoryVideos = videos.filter((v: { category: string }) => v.category === category)
|
|
|
if (categoryVideos.length === 0) return null
|
|
|
|
|
|
return (
|
|
|
<View key={category} className="space-y-2">
|
|
|
<Text className="text-sm font-medium text-gray-600 mb-1">{category}</Text>
|
|
|
- {categoryVideos.map((video) => (
|
|
|
+ {categoryVideos.map((video: { id: string; title: string; uploadTime?: string; size?: number }) => (
|
|
|
<View key={video.id} className="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
|
|
|
<View className="flex items-center">
|
|
|
<View className="w-10 h-10 bg-blue-100 rounded flex items-center justify-center mr-3">
|