diff --git a/src/components/NavigationBar/index.vue b/src/components/NavigationBar/index.vue index 3be72c0..b135d37 100644 --- a/src/components/NavigationBar/index.vue +++ b/src/components/NavigationBar/index.vue @@ -90,11 +90,7 @@ export default { ], }; }, - mounted() { - if (this.showLeft) { - this.$store.dispatch("GetYjtotal", {}); - } - }, + mounted() {}, methods: { /** * 是个中心 diff --git a/src/store/modules/taicang.js b/src/store/modules/taicang.js index 6007b92..fefdca3 100644 --- a/src/store/modules/taicang.js +++ b/src/store/modules/taicang.js @@ -109,7 +109,7 @@ const taicang = { /**预警总数 */ GetYjtotal({ commit }, queryParams) { return new Promise((resolve, reject) => { - getYj().then((res) => { + getYj(queryParams).then((res) => { commit("SET_YJ_TOTAL", res.data); resolve(); }); diff --git a/src/views/index.vue b/src/views/index.vue index 13a11f6..db307bf 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -83,12 +83,16 @@ export default { }, mounted() { this.getCommunity(); + this.$store.dispatch("GetYjtotal"); this.$store.dispatch("GetXiaoquInfo", this.dept.deptId); this.$store.dispatch("getThreeCell"); this.$store.dispatch("GetcolorList"); }, methods: { handleChange(e) { + this.$store.dispatch("GetYjtotal", { + shequId: e == 100 ? undefined : e, + }); this.$store.commit("SET_QUERY_PARAMS", { shequId: e }); this.$store.dispatch("GetXiaoquInfo", e);