能源监测电 页面显示隐藏逻辑修改

This commit is contained in:
lll 2023-11-27 13:25:44 +08:00
parent f3978de82b
commit 1b20e4de47
2 changed files with 26 additions and 21 deletions

View File

@ -1,17 +1,12 @@
import Vue from 'vue' import Vue from "vue";
import Vuex from 'vuex' import Vuex from "vuex";
Vue.use(Vuex) Vue.use(Vuex);
export default new Vuex.Store({ export default new Vuex.Store({
state: { state: {},
}, getters: {},
getters: { mutations: {},
}, actions: {},
mutations: { modules: {},
}, });
actions: {
},
modules: {
}
})

View File

@ -57,7 +57,7 @@
</div> </div>
</div> </div>
<div class="left" v-if="flag"> <div class="left" v-show="flag">
<img src="../../assets/img/标题/能源监测-电.png" class="title" /> <img src="../../assets/img/标题/能源监测-电.png" class="title" />
<div class="qcssdh"> <div class="qcssdh">
<div class="imgBox"> <div class="imgBox">
@ -106,7 +106,7 @@
</div> </div>
</div> </div>
<div class="right" v-if="flag"> <div class="right" v-show="flag">
<div class="yrfd"> <div class="yrfd">
<div class="imgBox"> <div class="imgBox">
<img src="../../assets/img/小标题栏.png" class="img" /> <img src="../../assets/img/小标题栏.png" class="img" />
@ -158,7 +158,7 @@ export default {
res: "月", res: "月",
click1: "", click1: "",
click2: "", click2: "",
flag: true, flag: false,
option1: { option1: {
xAxis: { xAxis: {
type: "category", type: "category",
@ -339,7 +339,6 @@ export default {
goOne(a) { goOne(a) {
this.click2 = ""; this.click2 = "";
this.click1 = a; this.click1 = a;
this.flag = false;
if (this.click1 == "配电室") { if (this.click1 == "配电室") {
this.$router.replace( this.$router.replace(
"/area/nyjcd/pds", "/area/nyjcd/pds",
@ -357,7 +356,6 @@ export default {
goTwo(a) { goTwo(a) {
this.click1 = ""; this.click1 = "";
this.click2 = a; this.click2 = a;
this.flag = false;
this.$router.replace( this.$router.replace(
`/area/nyjcd/scx1?type=${this.click2}`, `/area/nyjcd/scx1?type=${this.click2}`,
() => {}, () => {},
@ -621,8 +619,20 @@ export default {
this.defineEcharts("yrfd", option); this.defineEcharts("yrfd", option);
}, },
}, },
created() { created() {},
watch: {
// ,
$route: {
handler(to, from) {
if (to.path == "/area/nyjcd") {
this.flag = true; this.flag = true;
} else {
this.flag = false;
}
},
deep: true, //
immediate: true, //
},
}, },
mounted() { mounted() {
this.defineEcharts("qcssdh", this.option1); this.defineEcharts("qcssdh", this.option1);