|
|
|
@ -3,6 +3,7 @@ import { useRouter } from 'expo-router'; |
|
|
|
import { useState } from 'react'; |
|
|
|
import { |
|
|
|
ActivityIndicator, |
|
|
|
Alert, |
|
|
|
Pressable, |
|
|
|
ScrollView, |
|
|
|
StyleSheet, |
|
|
|
@ -140,7 +141,7 @@ function CandidateCard({ candidate }: { candidate: TalentCandidate }) { |
|
|
|
|
|
|
|
/* ===================== 子组件:人才池数据 ===================== */ |
|
|
|
|
|
|
|
function TalentPool({ stats, actions }: { stats: { id: string; value: string; label: string }[]; actions: { icon: string; label: string }[] }) { |
|
|
|
function TalentPool({ stats, actions, onPressAction }: { stats: { id: string; value: string; label: string }[]; actions: PoolActionItem[]; onPressAction: (action: PoolActionItem) => void }) { |
|
|
|
return ( |
|
|
|
<View style={styles.poolCard}> |
|
|
|
<Text style={styles.poolTitle}>人才池数据</Text> |
|
|
|
@ -154,7 +155,7 @@ function TalentPool({ stats, actions }: { stats: { id: string; value: string; la |
|
|
|
</View> |
|
|
|
<View style={styles.poolActions}> |
|
|
|
{actions.map((action) => ( |
|
|
|
<Pressable key={action.label} style={styles.poolAction}> |
|
|
|
<Pressable key={action.label} style={styles.poolAction} onPress={() => onPressAction(action)}> |
|
|
|
<Ionicons name={action.icon as keyof typeof Ionicons.glyphMap} size={20} color={colors.textSecondary} /> |
|
|
|
<Text style={styles.poolActionText}>{action.label}</Text> |
|
|
|
</Pressable> |
|
|
|
@ -217,10 +218,16 @@ function EmptyState({ |
|
|
|
|
|
|
|
/* ===================== 页面 ===================== */ |
|
|
|
|
|
|
|
const POOL_ACTIONS = [ |
|
|
|
/** |
|
|
|
* 人才池快捷操作项:带 route 的跳转目标页,无对应页面的弹「功能开发中」提示。 |
|
|
|
* 与 enterprise-chat.tsx 的 QuickActionItem 保持同一约定。 |
|
|
|
*/ |
|
|
|
type PoolActionItem = { icon: string; label: string; route?: string }; |
|
|
|
|
|
|
|
const POOL_ACTIONS: PoolActionItem[] = [ |
|
|
|
{ icon: 'mail-outline', label: '批量发邀请' }, |
|
|
|
{ icon: 'document-text-outline', label: '批量发Offer' }, |
|
|
|
{ icon: 'calendar-outline', label: '面试安排' }, |
|
|
|
{ icon: 'calendar-outline', label: '面试评分', route: '/interview-score' }, |
|
|
|
{ icon: 'notifications-outline', label: '群发通知' }, |
|
|
|
]; |
|
|
|
|
|
|
|
@ -229,6 +236,26 @@ export default function TalentRecommendationScreen() { |
|
|
|
const { recommendation, loading, error, refresh } = useTalentRecommendation(); |
|
|
|
const [activeTab, setActiveTab] = useState('all'); |
|
|
|
|
|
|
|
// 人才池快捷操作分发:有目标路由则跳转,无对应页面则提示「功能开发中」,
|
|
|
|
// 避免按钮点击后无任何反馈。与 enterprise-chat.tsx 的 handleQuickAction 同约定。
|
|
|
|
const handlePoolAction = (action: PoolActionItem) => { |
|
|
|
if (action.route) { |
|
|
|
router.push(action.route); |
|
|
|
} else { |
|
|
|
Alert.alert('提示', `${action.label}功能开发中,敬请期待`); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
// 以下两处原先绑的是空函数(() => {}),按钮点击后无任何反馈。
|
|
|
|
// 暂无对应页面,按项目约定弹「功能开发中」提示。
|
|
|
|
const handleReport = () => { |
|
|
|
Alert.alert('提示', '人才市场报告功能开发中,敬请期待'); |
|
|
|
}; |
|
|
|
|
|
|
|
const handleFilter = () => { |
|
|
|
Alert.alert('提示', '筛选条件功能开发中,敬请期待'); |
|
|
|
}; |
|
|
|
|
|
|
|
if (loading) { |
|
|
|
return ( |
|
|
|
<SafeAreaView style={styles.container} edges={['top']}> |
|
|
|
@ -264,18 +291,22 @@ export default function TalentRecommendationScreen() { |
|
|
|
<View> |
|
|
|
<TodayHeader |
|
|
|
count={recommendation.todayCount} |
|
|
|
onReport={() => {}} |
|
|
|
onReport={handleReport} |
|
|
|
/> |
|
|
|
{recommendation.candidates.map((candidate) => ( |
|
|
|
<CandidateCard key={candidate.id} candidate={candidate} /> |
|
|
|
))} |
|
|
|
<TalentPool stats={recommendation.poolStats} actions={POOL_ACTIONS} /> |
|
|
|
<TalentPool |
|
|
|
stats={recommendation.poolStats} |
|
|
|
actions={POOL_ACTIONS} |
|
|
|
onPressAction={handlePoolAction} |
|
|
|
/> |
|
|
|
</View> |
|
|
|
) : ( |
|
|
|
<EmptyState |
|
|
|
actions={recommendation.recommendedActions} |
|
|
|
dataReference={recommendation.dataReference} |
|
|
|
onFilter={() => {}} |
|
|
|
onFilter={handleFilter} |
|
|
|
/> |
|
|
|
)} |
|
|
|
</ScrollView> |
|
|
|
|