|
@@ -122,8 +122,8 @@
|
|
</ul>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<!-- :style="{ paddingLeft: fixed ? '65px' : 0 }" :style="{ paddingLeft: isShowMenu ? '65px' : 0 }"-->
|
|
<!-- :style="{ paddingLeft: fixed ? '65px' : 0 }" :style="{ paddingLeft: isShowMenu ? '65px' : 0 }"-->
|
|
- <!-- :style="pagestyFn()" -->
|
|
|
|
- <div class="pageSty" :style="pagestyFn()">
|
|
|
|
|
|
+ <!-- :style="pagestyFn()" :class="pageClaFn()" -->
|
|
|
|
+ <div class="pageSty" :style="pagestyFn(routepath)">
|
|
<router-view />
|
|
<router-view />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -989,18 +989,27 @@ export default {
|
|
dialogList: [],
|
|
dialogList: [],
|
|
realList: [],
|
|
realList: [],
|
|
audioElement: null,
|
|
audioElement: null,
|
|
|
|
+ routepath: ""
|
|
};
|
|
};
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
- $route: {
|
|
|
|
- handler: function (route) {
|
|
|
|
- this.showHeader = route.path === "/login" ? false : true;
|
|
|
|
|
|
+ // $route: {
|
|
|
|
+ // handler: function (route) {
|
|
|
|
+ // this.showHeader = route.path === "/login" ? false : true;
|
|
|
|
+ // this.isShowMenu =
|
|
|
|
+ // route.path === "/login" || route.path === "/home" ? false : true;
|
|
|
|
+ // //
|
|
|
|
+ // },
|
|
|
|
+ // immediate: true,
|
|
|
|
+ // },
|
|
|
|
+ $route(to, from) {
|
|
|
|
+ // 当路由发生变化时,更新 currentPath
|
|
|
|
+ this.routepath = to.path
|
|
|
|
+ this.showHeader = to.path === "/login" ? false : true;
|
|
this.isShowMenu =
|
|
this.isShowMenu =
|
|
- route.path === "/login" || route.path === "/home" ? false : true;
|
|
|
|
- this.pagestyFn(route.path)
|
|
|
|
- },
|
|
|
|
- immediate: true,
|
|
|
|
- },
|
|
|
|
|
|
+ to.path === "/login" || to.path === "/home" ? false : true;
|
|
|
|
+ this.pagestyFn(to.path)
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
async created() {
|
|
async created() {
|
|
@@ -1447,8 +1456,7 @@ export default {
|
|
return str;
|
|
return str;
|
|
},
|
|
},
|
|
pagestyFn(path) {
|
|
pagestyFn(path) {
|
|
- let str = "width: 100%;height:100vh";
|
|
|
|
- // let path = window.location.href;
|
|
|
|
|
|
+ let str = "";
|
|
if (path) {
|
|
if (path) {
|
|
if (path.indexOf("home") > -1) {
|
|
if (path.indexOf("home") > -1) {
|
|
str = "width:100%;height:100vh";
|
|
str = "width:100%;height:100vh";
|
|
@@ -1457,7 +1465,7 @@ export default {
|
|
if (path.indexOf("generatingCap") > -1) {
|
|
if (path.indexOf("generatingCap") > -1) {
|
|
str = "width: calc(100% - 200px);height:100vh";
|
|
str = "width: calc(100% - 200px);height:100vh";
|
|
} else if (path.indexOf("powerPrediction") > -1) {
|
|
} else if (path.indexOf("powerPrediction") > -1) {
|
|
- str = "width: calc(100% - 150px);height:100vh";
|
|
|
|
|
|
+ str = "width: calc(100% - 160px);height:100vh";
|
|
} else if (path.indexOf("integratedAlarm") > -1) {
|
|
} else if (path.indexOf("integratedAlarm") > -1) {
|
|
str = "width: calc(100% - 300px);height:100vh";
|
|
str = "width: calc(100% - 300px);height:100vh";
|
|
}
|
|
}
|