预警总数

master
许宏杰 11 months ago
parent f85bb32804
commit c3168964f0

@ -69,3 +69,11 @@ export function exportBlock(query) {
params: query, params: query,
}); });
} }
export function getYj(params) {
return request({
url: "/taicangpop/tc/getYj",
method: "get",
params,
});
}

@ -2,7 +2,7 @@
<div class="navigation-bar"> <div class="navigation-bar">
<div class="navigation-left" v-show="showLeft"> <div class="navigation-left" v-show="showLeft">
<el-badge <el-badge
:value="item.badge ? item.badge : ''" :value="item.title == '预警中心' ? yjTotal : ''"
class="item" class="item"
v-for="(item, index) in leftBtnList" v-for="(item, index) in leftBtnList"
:key="index" :key="index"
@ -75,12 +75,17 @@ export default {
open: false, open: false,
leftBtnList: [ leftBtnList: [
{ title: "搜索中心", isShow: true }, { title: "搜索中心", isShow: true },
{ title: "预警中心", isShow: true, badge: 100 }, { title: "预警中心", isShow: true },
{ title: "回收中心", isShow: true }, { title: "回收中心", isShow: true },
{ title: "日志中心", isShow: true }, { title: "日志中心", isShow: true },
], ],
}; };
}, },
mounted() {
if (this.showLeft) {
this.$store.dispatch("GetYjtotal", {});
}
},
methods: { methods: {
/** /**
* 是个中心 * 是个中心
@ -91,7 +96,7 @@ export default {
}, },
}, },
computed: { computed: {
...mapGetters(["name"]), ...mapGetters(["name", "yjTotal"]),
}, },
}; };
</script> </script>

@ -298,7 +298,6 @@ export default {
list.map((item) => { list.map((item) => {
this.queryParams[item.value] = undefined; this.queryParams[item.value] = undefined;
}); });
this[key] = handleTreeId(e, this.deptList); this[key] = handleTreeId(e, this.deptList);
}, },

@ -17,5 +17,6 @@ const getters = {
sidebarRouters: (state) => state.permission.sidebarRouters, sidebarRouters: (state) => state.permission.sidebarRouters,
leftColor: (state) => state.taicang.leftColor, leftColor: (state) => state.taicang.leftColor,
rightTopColor: (state) => state.taicang.rightTopColor, rightTopColor: (state) => state.taicang.rightTopColor,
yjTotal: (state) => state.taicang.yjTotal,
}; };
export default getters; export default getters;

@ -1,9 +1,8 @@
const state = {}; import { getYj } from "@/api/taicangpop/block.js";
const mutations = {};
const actions = {};
const taicang = { const taicang = {
state: { state: {
yjTotal: 0,
leftColor: { leftColor: {
HZ: "#008c5e", HZ: "#008c5e",
HL: "#008c5e", HL: "#008c5e",
@ -25,8 +24,21 @@ const taicang = {
NF: "#008c5e", NF: "#008c5e",
}, },
}, },
mutations: {}, mutations: {
actions: {}, SET_YJ_TOTAL: (state, total) => {
state.yjTotal = total;
},
},
actions: {
GetYjtotal({ commit }, queryParams) {
return new Promise((resolve, reject) => {
getYj().then((res) => {
commit("SET_YJ_TOTAL", res.data);
resolve();
});
});
},
},
}; };
export default taicang; export default taicang;

Loading…
Cancel
Save