|
@@ -2,7 +2,7 @@
|
|
|
<div class="menu">
|
|
|
<ul class="menu-list">
|
|
|
<li class="menu-item" v-for="(menu, index) of currentMenu" :key="menu" @click="click(index)" :class="{ active: activeIndex == index }" @mouseenter="subMenuShow(menu.children, index)">
|
|
|
- <router-link v-if="!menu.children" :to="{ path: menu.path, query: { root: currRoot } }">
|
|
|
+ <router-link v-if="!menu.children" :to="menu.path">
|
|
|
<el-tooltip class="item" effect="dark" :content="menu.text" placement="right" :show-after="500">
|
|
|
<div class="menu-icon svg-icon" :class="activeIndex == index ? 'svg-icon-green' : 'svg-icon-gray'">
|
|
|
<SvgIcon :svgid="menu.icon"></SvgIcon>
|
|
@@ -20,7 +20,7 @@
|
|
|
<div class="sub-menu" v-show="isShowSubMenu">
|
|
|
<ul class="menu-list">
|
|
|
<li class="menu-item" v-for="(menu, index) of subMenu" @click="subclick(index)" :key="menu" :class="{ active: subIndex == index }">
|
|
|
- <router-link :to="{ path: menu.path, query: { root: currRoot } }">
|
|
|
+ <router-link :to="menu.path">
|
|
|
<div class="menu-icon svg-icon">
|
|
|
<SvgIcon :svgid="menu.icon"></SvgIcon>
|
|
|
</div>
|
|
@@ -36,9 +36,7 @@ export default {
|
|
|
components: {
|
|
|
SvgIcon,
|
|
|
},
|
|
|
- props: {
|
|
|
- root: { type: String, default: "monitor" },
|
|
|
- },
|
|
|
+ props: {},
|
|
|
data() {
|
|
|
return {
|
|
|
currRoot: "monitor",
|
|
@@ -50,37 +48,42 @@ export default {
|
|
|
{
|
|
|
text: "驾驶舱",
|
|
|
icon: "svg-lead-cockpit",
|
|
|
- path: "/",
|
|
|
+ path: "/monitor/home",
|
|
|
},
|
|
|
{
|
|
|
text: "基础矩阵",
|
|
|
icon: "svg-matrix",
|
|
|
- path: "/lightmatrix1",
|
|
|
+ path: "/monitor/lightmatrix1",
|
|
|
},
|
|
|
{
|
|
|
- text: "风场明细矩阵",
|
|
|
+ text: "风场明细",
|
|
|
icon: "svg-mx-matrix",
|
|
|
- path: "/lightmatrix2",
|
|
|
+ path: "/monitor/lightmatrix3",
|
|
|
},
|
|
|
{
|
|
|
text: "欠发矩阵",
|
|
|
icon: "svg-qf-matrix",
|
|
|
- path: "/lightmatrix3",
|
|
|
+ path: "/monitor/lightmatrix2",
|
|
|
},
|
|
|
{
|
|
|
- text: "光伏明细矩阵",
|
|
|
+ text: "光伏矩阵",
|
|
|
icon: "svg-gf-matrix",
|
|
|
- path: "/lightmatrix",
|
|
|
+ path: "/monitor/lightmatrix",
|
|
|
},
|
|
|
{
|
|
|
text: "状态监视",
|
|
|
icon: "svg-state-watch",
|
|
|
- path: "/status",
|
|
|
+ path: "/monitor/status",
|
|
|
},
|
|
|
{
|
|
|
text: "Agc",
|
|
|
icon: "svg-agc",
|
|
|
- path: "/agc",
|
|
|
+ path: "/monitor/agc",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: "风场",
|
|
|
+ icon: "svg-wind-site",
|
|
|
+ path: "/monitor/windsite/home",
|
|
|
},
|
|
|
],
|
|
|
},
|
|
@@ -101,38 +104,38 @@ export default {
|
|
|
{
|
|
|
text: "健康管理1",
|
|
|
icon: "svg-wind-site",
|
|
|
- path: "/health1",
|
|
|
- },
|
|
|
- {
|
|
|
- text: "健康管理2",
|
|
|
- icon: "svg-wind-site",
|
|
|
- path: "/health2",
|
|
|
- },
|
|
|
- {
|
|
|
- text: "健康管理3",
|
|
|
- icon: "svg-wind-site",
|
|
|
- path: "/health3",
|
|
|
- },
|
|
|
- {
|
|
|
- text: "健康管理4",
|
|
|
- icon: "svg-wind-site",
|
|
|
- path: "/health4",
|
|
|
- },
|
|
|
- {
|
|
|
- text: "健康管理5",
|
|
|
- icon: "svg-wind-site",
|
|
|
- path: "/health5",
|
|
|
- },
|
|
|
- {
|
|
|
- text: "健康管理6",
|
|
|
- icon: "svg-wind-site",
|
|
|
- path: "/health6",
|
|
|
- },
|
|
|
- {
|
|
|
- text: "健康管理7",
|
|
|
- icon: "svg-wind-site",
|
|
|
- path: "/health7",
|
|
|
+ path: "/health/health1",
|
|
|
},
|
|
|
+ // {
|
|
|
+ // text: "健康管理2",
|
|
|
+ // icon: "svg-wind-site",
|
|
|
+ // path: "/health/health2",
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // text: "健康管理3",
|
|
|
+ // icon: "svg-wind-site",
|
|
|
+ // path: "/health/health3",
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // text: "健康管理4",
|
|
|
+ // icon: "svg-wind-site",
|
|
|
+ // path: "/health/health4",
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // text: "健康管理5",
|
|
|
+ // icon: "svg-wind-site",
|
|
|
+ // path: "/health/health5",
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // text: "健康管理6",
|
|
|
+ // icon: "svg-wind-site",
|
|
|
+ // path: "/health/health6",
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // text: "健康管理7",
|
|
|
+ // icon: "svg-wind-site",
|
|
|
+ // path: "/health/health7",
|
|
|
+ // },
|
|
|
],
|
|
|
},
|
|
|
{
|
|
@@ -142,22 +145,22 @@ export default {
|
|
|
{
|
|
|
text: "决策支持1",
|
|
|
icon: "svg-matrix",
|
|
|
- path: "/decision1",
|
|
|
+ path: "decision/decision1",
|
|
|
},
|
|
|
// {
|
|
|
// text: "决策支持2",
|
|
|
// icon: "svg-matrix",
|
|
|
- // path: "/decision2",
|
|
|
+ // path: "decision/decision2",
|
|
|
// },
|
|
|
// {
|
|
|
// text: "决策支持3",
|
|
|
// icon: "svg-matrix",
|
|
|
- // path: "/decision3",
|
|
|
+ // path: "decision/decision3",
|
|
|
// },
|
|
|
// {
|
|
|
// text: "决策支持4",
|
|
|
// icon: "svg-matrix",
|
|
|
- // path: "/decision4",
|
|
|
+ // path: "decision/decision4",
|
|
|
// },
|
|
|
],
|
|
|
},
|
|
@@ -204,7 +207,6 @@ export default {
|
|
|
let data = this.menuData.filter((t) => {
|
|
|
return t.id == this.currRoot;
|
|
|
})[0].data;
|
|
|
-
|
|
|
return data;
|
|
|
},
|
|
|
},
|
|
@@ -212,11 +214,9 @@ export default {
|
|
|
// 监听路由
|
|
|
$route: {
|
|
|
handler: function(val, oldVal) {
|
|
|
- if (val.query.root) this.currRoot = val.query.root;
|
|
|
-
|
|
|
- this.currentMenu.some((element, index) => {
|
|
|
- if (element.path == val.path) {
|
|
|
- this.activeIndex = index;
|
|
|
+ this.menuData.some((element, index) => {
|
|
|
+ if (val.path.includes(element.id)) {
|
|
|
+ this.currRoot = element.id;
|
|
|
return true;
|
|
|
}
|
|
|
});
|
|
@@ -224,27 +224,6 @@ export default {
|
|
|
//深度观察监听
|
|
|
deep: true,
|
|
|
},
|
|
|
- root: {
|
|
|
- handler: function(val, oldVal) {
|
|
|
- this.currRoot = val;
|
|
|
- },
|
|
|
- },
|
|
|
- currentMenu: {
|
|
|
- handler: function(val, oldVal) {
|
|
|
- if (val && val.length > 0) {
|
|
|
- // 基于 root 和 currRoot 为一致
|
|
|
- // 进行页面刷新
|
|
|
- // 防止 刷新页面也同步执行切换页面逻辑
|
|
|
- if (this.root == this.currRoot) {
|
|
|
- this.activeIndex = 0;
|
|
|
- this.$router.push({
|
|
|
- path: val[0].path,
|
|
|
- query: { root: this.currRoot },
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|