Browse Source

refactor(menu): 后台管理入口迁至企业端,清理 C 端菜单重复 id

- MOCK_MENU_ITEMS 移除「运营规则配置」「数据审计报告」:后台管理术语不再
  暴露给求职者端菜单(这两个页面在企业端「我的-管理后台」重新落地,非孤儿页)
- 修复 MOCK_MENU_ITEMS 中 enterprise-certification 重复出现两次导致
  React key 警告的问题(保留「企业入驻」)
- EnterpriseOverview 类型新增 manageActions 字段;新增
  MOCK_ENTERPRISE_MANAGE_ACTIONS 并接入企业总览
- 企业端「我的」页新增 ManageList「管理后台」分区:纵向列表,不挤占
  快捷入口已有的 6 项横排布局
master
doublex001 2 months ago
parent
commit
5022ff2842
  1. 60
      app/(enterprise)/enterprise-overview.tsx
  2. 15
      src/api/api.ts
  3. 5
      src/types/enterprise.ts

60
app/(enterprise)/enterprise-overview.tsx

@ -162,6 +162,38 @@ function JobEvaluationList({ jobs }: { jobs: JobEvaluationSummary[] }) {
); );
} }
/* ===================== 子组件:管理后台 ===================== */
/**
* 管理后台入口:运营规则配置 / 数据审计等低频管理操作。
* 单独成区纵向排列,既不挤占快捷入口的横排位,也避免后台术语出现在求职者端。
*/
function ManageList({ actions }: { actions: EnterpriseQuickAction[] }) {
const router = useRouter();
if (actions.length === 0) return null;
return (
<View style={styles.card}>
<Text style={styles.standaloneTitle}>管理后台</Text>
{actions.map((action) => {
const color = COLOR_TOKENS[action.color] ?? colors.primary;
return (
<Pressable
key={action.id}
style={styles.manageRow}
onPress={() => action.route && router.push(action.route as any)}
>
<View style={[styles.manageIcon, { backgroundColor: color + '15' }]}>
<Ionicons name={action.icon as keyof typeof Ionicons.glyphMap} size={20} color={color} />
</View>
<Text style={styles.manageLabel}>{action.label}</Text>
<Ionicons name="chevron-forward" size={18} color={colors.textHint} />
</Pressable>
);
})}
</View>
);
}
/* ===================== 页面主组件 ===================== */ /* ===================== 页面主组件 ===================== */
export default function EnterpriseOverviewScreen() { export default function EnterpriseOverviewScreen() {
@ -196,6 +228,7 @@ export default function EnterpriseOverviewScreen() {
<StatGrid stats={overview.stats} /> <StatGrid stats={overview.stats} />
<QuickActions actions={overview.quickActions} /> <QuickActions actions={overview.quickActions} />
<JobEvaluationList jobs={overview.jobEvaluations} /> <JobEvaluationList jobs={overview.jobEvaluations} />
<ManageList actions={overview.manageActions} />
</ScrollView> </ScrollView>
</View> </View>
); );
@ -430,4 +463,31 @@ const styles = StyleSheet.create({
fontWeight: '500', fontWeight: '500',
marginTop: 2, marginTop: 2,
}, },
standaloneTitle: {
fontSize: 16,
fontWeight: '700',
color: colors.textPrimary,
marginBottom: 8,
},
manageRow: {
flexDirection: 'row',
alignItems: 'center',
paddingVertical: 12,
borderBottomWidth: 1,
borderBottomColor: colors.borderLight,
},
manageIcon: {
width: 38,
height: 38,
borderRadius: 10,
justifyContent: 'center',
alignItems: 'center',
marginRight: 12,
},
manageLabel: {
flex: 1,
fontSize: 15,
fontWeight: '500',
color: colors.textPrimary,
},
}); });

15
src/api/api.ts

@ -634,9 +634,7 @@ const MOCK_MENU_ITEMS: MenuItem[] = [
{ id: 'job-management', title: '岗位管理', icon: 'business-outline', route: '/job-management' }, { id: 'job-management', title: '岗位管理', icon: 'business-outline', route: '/job-management' },
{ id: 'talent-recommendation', title: '人才推荐', icon: 'people-outline', route: '/talent-recommendation' }, { id: 'talent-recommendation', title: '人才推荐', icon: 'people-outline', route: '/talent-recommendation' },
{ id: 'enterprise-chat', title: '企业沟通', icon: 'chatbubble-outline', route: '/enterprise-chat' }, { id: 'enterprise-chat', title: '企业沟通', icon: 'chatbubble-outline', route: '/enterprise-chat' },
{ id: 'operation-rules', title: '运营规则配置', icon: 'options-outline', route: '/operation-rules' }, // 注:运营规则配置 / 数据审计报告属后台管理术语,已迁至企业端「我的-管理后台」,不在此暴露给求职者
{ id: 'audit-report', title: '数据审计报告', icon: 'shield-checkmark-outline', route: '/audit-report' },
{ id: 'enterprise-certification', title: '企业认证', icon: 'business-outline', route: '/enterprise-certification' },
]; ];
/** 企业端入口 */ /** 企业端入口 */
@ -2358,6 +2356,16 @@ const MOCK_ENTERPRISE_QUICK_ACTIONS: EnterpriseQuickAction[] = [
{ id: 'interviews', label: '面试日程', icon: 'calendar-outline', route: '/interview-score', color: 'action' }, { id: 'interviews', label: '面试日程', icon: 'calendar-outline', route: '/interview-score', color: 'action' },
]; ];
/**
* 企业端管理后台入口
* 低频管理操作,单独成区展示,不占用快捷入口的横排位;
* 同时避免「运营规则配置 / 数据审计」等后台术语出现在求职者端菜单。
*/
const MOCK_ENTERPRISE_MANAGE_ACTIONS: EnterpriseQuickAction[] = [
{ id: 'operation-rules', label: '运营规则配置', icon: 'options-outline', route: '/operation-rules', color: 'primary' },
{ id: 'audit-report', label: '数据审计报告', icon: 'shield-checkmark-outline', route: '/audit-report', color: 'info' },
];
/** 企业总览统计 */ /** 企业总览统计 */
const MOCK_ENTERPRISE_STATS: EnterpriseStat[] = [ const MOCK_ENTERPRISE_STATS: EnterpriseStat[] = [
{ id: 'jobs', label: '在招岗位', value: 1280, change: 12, icon: 'briefcase-outline', color: 'primary' }, { id: 'jobs', label: '在招岗位', value: 1280, change: 12, icon: 'briefcase-outline', color: 'primary' },
@ -2387,6 +2395,7 @@ const MOCK_ENTERPRISE_OVERVIEW: EnterpriseOverview = {
stats: MOCK_ENTERPRISE_STATS, stats: MOCK_ENTERPRISE_STATS,
jobEvaluations: MOCK_JOB_EVALUATION_SUMMARIES, jobEvaluations: MOCK_JOB_EVALUATION_SUMMARIES,
quickActions: MOCK_ENTERPRISE_QUICK_ACTIONS, quickActions: MOCK_ENTERPRISE_QUICK_ACTIONS,
manageActions: MOCK_ENTERPRISE_MANAGE_ACTIONS,
}; };
/** /**

5
src/types/enterprise.ts

@ -65,6 +65,11 @@ export interface EnterpriseOverview {
jobEvaluations: JobEvaluationSummary[]; jobEvaluations: JobEvaluationSummary[];
/** 快捷入口 */ /** 快捷入口 */
quickActions: EnterpriseQuickAction[]; quickActions: EnterpriseQuickAction[];
/**
* 管理后台入口(运营规则配置、数据审计等)
* 仅企业端「我的」展示,不在求职者端菜单暴露,避免后台术语干扰 C 端用户
*/
manageActions: EnterpriseQuickAction[];
} }
/** 企业总览快捷入口 */ /** 企业总览快捷入口 */

Loading…
Cancel
Save