| | |
| | | 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: '运营公司' }, |
| | | { key: 'map', index: '06', label: '地理信息总览', audience: '指挥中心' } |
| | | { key: 'map', index: '01', label: '地理信息总览', audience: '指挥中心' }, |
| | | { key: 'overview', index: '02', label: '绿色校园总览', audience: '校领导' }, |
| | | { key: 'resource', index: '03', label: '垃圾资源化分析', audience: '后勤 / 环保' }, |
| | | { key: 'carbon', index: '04', label: '碳减排与绿色贡献', audience: '双碳 / ESG' }, |
| | | { key: 'participation', index: '05', label: '师生参与与碳积分', audience: '学工 / 团委' }, |
| | | { key: 'operation', index: '06', label: '回收运营监控', audience: '运营公司' } |
| | | ]; |
| | | |
| | | /** 从路由解析当前大屏子页;index / 空 / 非法值均回落到 overview */ |
| | | export function resolveScreenKey(page?: string | string[] | null, queryPage?: string | string[] | null): ScreenKey { |
| | | const raw = String(queryPage || page || 'overview'); |
| | | const raw = String(queryPage || page || 'map'); |
| | | if (raw === 'index') return 'map'; //if (raw === 'index') return 'overview'; |
| | | return SCREEN_NAV.some(e => e.key === raw) ? (raw as ScreenKey) : 'map'; |
| | | //return SCREEN_NAV.some(e => e.key === raw) ? (raw as ScreenKey) : 'overview'; |