wangrong
2026-09-08 35c60892f9b5c73caef01cc12b542111c77d757c
feat: 更新报告模块配置和页面
5个文件已修改
29 ■■■■■ 已修改文件
package.json 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/config/proxy.ts 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/modules/report/data/screen-demo.ts 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/modules/report/data/screen.ts 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/modules/report/views/screen/index.vue 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json
@@ -75,5 +75,5 @@
        "vite-plugin-vue-devtools": "^7.7.1",
        "vue-tsc": "^2.2.0"
    },
    "packageManager": "pnpm@11.12.0+sha512.820a6fbd0d9f04c226638002aead1e45340a9139dd5dc077c1d83ef44aa2481c8eb6637b4c9aa696a3c7e35ba818e49cf27213e5f2b91138d09b7a3e26e898ba"
    "packageManager": "pnpm@11.24.0"
}
src/config/proxy.ts
@@ -9,6 +9,10 @@
        target: 'https://show.cool-admin.com',
        changeOrigin: true,
        rewrite: (path: string) => path.replace(/^\/prod/, '/api')
    },
    '/upload/': {
        target: 'http://127.0.0.1:8001',
        changeOrigin: true
    }
};
src/modules/report/data/screen-demo.ts
@@ -193,11 +193,6 @@
        ],
        vehicles: [
            { no: '沪A·8K126', km: 86.4, idle: 12, overspeed: 0, status: '在线' },
            { no: '沪A·6D882', km: 72.1, idle: 8, overspeed: 1, status: '在线' },
            { no: '沪A·3F559', km: 64.8, idle: 18, overspeed: 0, status: '在线' },
            { no: '沪A·2H903', km: 58.2, idle: 6, overspeed: 0, status: '在线' },
            { no: '沪A·9M217', km: 46.5, idle: 22, overspeed: 2, status: '在线' },
            { no: '沪A·5P668', km: 38.6, idle: 0, overspeed: 0, status: '离线' },
            { no: '沪A·1R441', km: 24.3, idle: 0, overspeed: 0, status: '离线' }
        ],
        sites: [
src/modules/report/data/screen.ts
@@ -6,17 +6,17 @@
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';
src/modules/report/views/screen/index.vue
@@ -26,12 +26,12 @@
const route = useRoute();
const pageMap = {
    map: Map,
    overview: Overview,
    resource: Resource,
    carbon: Carbon,
    participation: Participation,
    operation: Operation,
    map: Map
    operation: Operation
};
/** 停留在 /report/screen/index,用 query.page(或动态路由 :page)切换子页,不再强制跳走 */