yangyin
2024-06-27 80f3f783663cd6188e8276ee8500c6bc44e2ce9c
fix: 修改路由的页面
已修改6个文件
32 ■■■■ 文件已修改
customer_list/ch/static/config/globalConfig.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
customer_list/ch/static/config/route.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/menu/index.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/component/header/Header.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/pathMap.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/route.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
customer_list/ch/static/config/globalConfig.js
@@ -12,9 +12,9 @@
    },
    SoftWareInfo: {
        // 网站主标题(菜单导航、浏览器当前网页标题)
        globalTitle: 'chat',
        globalTitle: 'WI水务',
        // 网站副标题(登录页顶部文字)
        globalViceTitle: 'chat',
        globalViceTitle: 'WI水务',
        // 网站副标题(登录页顶部文字)
        globalViceTitleMsg: '义维科技有限公司',
        // tab 页 icon
customer_list/ch/static/config/route.js
@@ -1,5 +1,4 @@
window.route = [
    {
        name: 'Home',
        isKeepAlive: false,
@@ -7,6 +6,7 @@
        path: '/home',
        component: '/project/ch/home/Home.vue',
        redirect: null,
        showTitle: false,
    },
    {
        name: 'Scenario',
@@ -15,6 +15,7 @@
        path: '/Scenario',
        component: '/project/ch/home/Scenario.vue',
        redirect: null,
        showTitle: true,
    },
    {
        name: 'AboutUs',
@@ -23,6 +24,7 @@
        path: '/AboutUs',
        component: '/project/ch/home/AboutUs.vue',
        redirect: null,
        showTitle: true,
    }
];
src/api/menu/index.ts
@@ -150,7 +150,7 @@
                        resultAny.meta.isAffix = pathRoute.isAffix;
                        resultAny.meta.isKeepAlive = pathRoute.isKeepAlive;
                        resultAny.meta.showTitle = pathRoute.showTitle;
                        // 将 pathMap 的 value 置为当前 result
                        pathMap.set(item.Path, result as any);
                    }
src/layout/component/header/Header.vue
@@ -1,5 +1,14 @@
<template>
    <div class="top_text">
    <div class="top_text flex justify-between px-6 items-center">
        <div v-if="routerMeta.showTitle" class="font-bold flex items-center cursor-pointer" @click="goBack">
            <span class="flex-center">
                <SvgIcon name="ele-ArrowLeft" />
            </span>
            <span class="text-sm">
                {{ routerMeta.title }}
            </span>
        </div>
        <div class="notice">
            <el-badge :value="3">
                <el-button link size="small" icon="ele-Message" class="set-notice" @click="handleAnnouncementClick">系统公告</el-button>
@@ -22,7 +31,8 @@
</template>
<script setup lang="ts">
import { reactive } from 'vue';
import { computed, reactive } from 'vue';
import router from '/@/router';
let state = reactive({
    isShowAnnouncement: false,
    announcementList: [
@@ -43,9 +53,15 @@
        },
    ],
});
const routerMeta = computed(() => router.currentRoute.value.meta);
const handleAnnouncementClick = () => {
    state.isShowAnnouncement = !state.isShowAnnouncement;
};
const goBack = () => {
    router.back();
};
</script>
<style scoped lang="scss">
.top_text {
src/router/pathMap.ts
@@ -12,6 +12,7 @@
    path: String;
    component: String;
    redirect?: String;
    showTitle:boolean;
};
const pathArr = window.route;
src/router/route.ts
@@ -27,6 +27,7 @@
        isIframe?: boolean;
        roles?: string[];
        icon?: string;
        showTitle?:boolean;
    }
}