预警总数

master
许宏杰 2 months ago
parent f85bb32804
commit c3168964f0

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

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

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

@ -1,9 +1,8 @@
const state = {};
const mutations = {};
const actions = {};
import { getYj } from "@/api/taicangpop/block.js";
const taicang = {
state: {
yjTotal: 0,
leftColor: {
HZ: "#008c5e",
HL: "#008c5e",
@ -25,8 +24,21 @@ const taicang = {
NF: "#008c5e",
},
},
mutations: {},
actions: {},
mutations: {
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;

Loading…
Cancel
Save