|
@@ -10,9 +10,9 @@
|
|
|
<div class="page-common-body-menu-border left bottom"></div>
|
|
|
<div class="page-common-body-menu-border right top"></div>
|
|
|
<div class="page-common-body-menu-border right bottom"></div>
|
|
|
- <router-link v-for="(menuData, index) of menuDatas" :key="index" :to="menuData.path">
|
|
|
- <div class="page-common-body-menu-item" @click="clickMenu(index)"
|
|
|
- :class="{ active: activeIndex == index }">
|
|
|
+ <router-link v-for="(menuData, index) of menuDatas" :key="index" :to="menuData.path" >
|
|
|
+ <div class="page-common-body-menu-item"
|
|
|
+ :class="{ active: activeIndex == index}">
|
|
|
<span class="svg-icon" :class="activeIndex == index ? 'svg-icon-yellow' : 'svg-icon-green'">
|
|
|
<SvgIcon :svgid="menuData.icon"></SvgIcon>
|
|
|
</span>
|
|
@@ -37,6 +37,7 @@
|
|
|
// 数据
|
|
|
data() {
|
|
|
return {
|
|
|
+ endPath: 0,
|
|
|
windsitePath: '',
|
|
|
activeIndex: 0,
|
|
|
menuDatas: [{
|
|
@@ -69,50 +70,25 @@
|
|
|
},
|
|
|
{
|
|
|
icon: "svg-wind-site",
|
|
|
- path: this.windsitePath,
|
|
|
+ path: '/monitor/windsite/info/MHS_FDC/MG01_01',
|
|
|
},
|
|
|
+
|
|
|
],
|
|
|
};
|
|
|
},
|
|
|
// 函数
|
|
|
methods: {
|
|
|
- jumpUrl() {
|
|
|
- var p = this.$route.path.split('/');
|
|
|
- var pData = p[p.length - 1].split('_');
|
|
|
- var fdjData = pData[0].substr(0,1);
|
|
|
- var wpId = p[p.length - 1];
|
|
|
- if (wpId.indexOf("FDC") !== -1) {
|
|
|
- this.windsitePath = `/monitor/windsite/info/${wpId}/${fdjData[0] + 'G01_01'}`
|
|
|
- } else {
|
|
|
- this.windsitePath = `../../windsite/inverter-info/${wpId}/${pData[0] + '01_01'}`
|
|
|
- }
|
|
|
- },
|
|
|
- clickMenu: function(index) {
|
|
|
- if (index == 7) { //风场
|
|
|
- this.jumpUrl();
|
|
|
- this.menu(index);
|
|
|
- $('.page-common-body-menu-box a').eq(7).hide();
|
|
|
- }else{
|
|
|
- $('.page-common-body-menu-box a').eq(7).show();
|
|
|
- }
|
|
|
- this.activeIndex = index;
|
|
|
+ menu() {
|
|
|
+ this.menuDatas.forEach((ele) => {
|
|
|
+ if (ele.icon == 'svg-wind-site') {
|
|
|
+ ele.path = ele.path
|
|
|
+ } else {
|
|
|
+ ele.path = ele.path + "/" + this.$route.params.wpId;
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
- menu(index) {
|
|
|
- if(index){
|
|
|
- this.menuDatas[index].path = this.windsitePath;
|
|
|
- }else{
|
|
|
- this.menuDatas.forEach((ele) => {
|
|
|
- if (ele.icon == 'svg-wind-site') {
|
|
|
- ele.path = this.windsitePath
|
|
|
- } else {
|
|
|
- ele.path = ele.path + "/" + this.$route.params.wpId;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
},
|
|
|
created() {
|
|
|
- this.jumpUrl();
|
|
|
this.menu();
|
|
|
},
|
|
|
};
|