| | |
| | | export type ScreenKey = 'overview' | 'resource' | 'carbon' | 'participation' | 'operation'; |
| | | export type RankMetric = 'weight' | 'people' | 'pointPerCapita' | 'weightPerCapita' | 'carbon'; |
| | | |
| | | export const SCREEN_NAV: { key: ScreenKey; path: string; index: string; label: string; audience: string }[] = [ |
| | | { key: 'overview', path: '/report/screen/overview', index: '01', label: '绿色校园总览', audience: '校领导' }, |
| | | { key: 'resource', path: '/report/screen/resource', index: '02', label: '垃圾资源化分析', audience: '后勤 / 环保' }, |
| | | { key: 'carbon', path: '/report/screen/carbon', index: '03', label: '碳减排与绿色贡献', audience: '双碳 / ESG' }, |
| | | { key: 'participation', path: '/report/screen/participation', index: '04', label: '师生参与与碳积分', audience: '学工 / 团委' }, |
| | | { key: 'operation', path: '/report/screen/operation', index: '05', label: '回收运营监控', audience: '运营公司' } |
| | | /** 首页菜单固定为 /report/screen/index,子页通过 ?page= 切换,避免离开首页入口 */ |
| | | export const SCREEN_HOME_PATH = '/report/screen/index'; |
| | | |
| | | export const SCREEN_NAV: { key: ScreenKey; index: string; label: string; audience: string }[] = [ |
| | | { key: 'overview', index: '01', label: '绿色校园总览', audience: '校领导' }, |
| | | { key: 'resource', index: '02', label: '垃圾资源化分析', audience: '后勤 / 环保' }, |
| | | { key: 'carbon', index: '03', label: '碳减排与绿色贡献', audience: '双碳 / ESG' }, |
| | | { key: 'participation', index: '04', label: '师生参与与碳积分', audience: '学工 / 团委' }, |
| | | { key: 'operation', index: '05', label: '回收运营监控', audience: '运营公司' } |
| | | ]; |
| | | |
| | | /** 从路由解析当前大屏子页;index / 空 / 非法值均回落到 overview */ |
| | | export function resolveScreenKey(page?: string | string[] | null, queryPage?: string | string[] | null): ScreenKey { |
| | | const raw = String(queryPage || page || 'overview'); |
| | | if (raw === 'index') return 'overview'; |
| | | return SCREEN_NAV.some(e => e.key === raw) ? (raw as ScreenKey) : 'overview'; |
| | | } |
| | | |
| | | export const TIME_RANGE_OPTIONS: { label: string; value: TimeRange }[] = [ |
| | | { label: '今日', value: 'today' }, |
| | | { label: '本周', value: 'week' }, |