|
@@ -253,19 +253,31 @@ l16.229-16.229l16.229,16.229l42.867-42.867C115.034,45.228,109.133,42.189,102.956
|
|
|
text-color="#ffffff"
|
|
|
active-text-color="#6262a2"
|
|
|
background-color="#36348e"
|
|
|
+ @select="selectMenu"
|
|
|
>
|
|
|
- <el-sub-menu :index="index" :title="item.text" v-for="(item , index) in menuData">
|
|
|
+ <el-sub-menu
|
|
|
+ :index="index"
|
|
|
+ :title="item.text"
|
|
|
+ v-for="(item, index) in menuData"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
<template #title>
|
|
|
- <router-link :to="item.path">
|
|
|
- <el-icon>
|
|
|
- <SvgIcon :svgid="item.icon" />
|
|
|
- </el-icon>
|
|
|
- </router-link>
|
|
|
+ <router-link :to="item.path">
|
|
|
+ <el-icon>
|
|
|
+ <SvgIcon :svgid="item.icon" />
|
|
|
+ </el-icon>
|
|
|
+ </router-link>
|
|
|
</template>
|
|
|
- <el-menu-item-group v-for="(menu , idx) in item.children" :index="idx">
|
|
|
- <router-link :to="menu.path">
|
|
|
- <el-menu-item :index="index+'-'+idx">{{menu.text}}</el-menu-item>
|
|
|
- </router-link>
|
|
|
+ <el-menu-item-group
|
|
|
+ v-for="(menu, idx) in item.children"
|
|
|
+ :index="idx"
|
|
|
+ :key="idx"
|
|
|
+ >
|
|
|
+ <router-link :to="menu.path">
|
|
|
+ <el-menu-item :index="index + '-' + idx">{{
|
|
|
+ menu.text
|
|
|
+ }}</el-menu-item>
|
|
|
+ </router-link>
|
|
|
</el-menu-item-group>
|
|
|
</el-sub-menu>
|
|
|
</el-menu>
|
|
@@ -314,7 +326,7 @@ export default {
|
|
|
isLogined: true,
|
|
|
showSisView: false,
|
|
|
memuCloseTimeout: null,
|
|
|
- menuData:[]
|
|
|
+ menuData: [],
|
|
|
};
|
|
|
},
|
|
|
|
|
@@ -373,15 +385,41 @@ export default {
|
|
|
login(params) {
|
|
|
if (params.username && params.password) this.isLogined = true;
|
|
|
},
|
|
|
+ selectMenu(menuIndex) {
|
|
|
+ this.menuIndex = menuIndex;
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
$route(res) {
|
|
|
this.showSisView = res.fullPath === "/sisView";
|
|
|
+ let ActiveModule = null;
|
|
|
+ this.menuData.forEach((pEle) => {
|
|
|
+ if (pEle.path === res.fullPath) {
|
|
|
+ ActiveModule = pEle;
|
|
|
+ }
|
|
|
+ pEle?.children?.forEach((cEle) => {
|
|
|
+ if (cEle.path === res.fullPath) {
|
|
|
+ ActiveModule = cEle;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ if (ActiveModule) {
|
|
|
+ this.$store.dispatch("changeModuleName", ActiveModule.text);
|
|
|
+ }
|
|
|
},
|
|
|
"$store.state.menuData"(res) {
|
|
|
- this.menuData = res;
|
|
|
- },
|
|
|
+ this.menuData = res;
|
|
|
+ },
|
|
|
+ "$store.state.moudleName"(msg) {
|
|
|
+ if (window.__MODE__.showModuleName && msg) {
|
|
|
+ this.BASE.showMsg({
|
|
|
+ type: this.$store.state.themeName === "dark" ? "success" : "warning",
|
|
|
+ showClose: true,
|
|
|
+ msg,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|