diff --git a/api/equip/equip.js b/api/equip/equip.js index 89e9dd0..11de656 100644 --- a/api/equip/equip.js +++ b/api/equip/equip.js @@ -23,4 +23,12 @@ export function getEquipInfoById(id) { url: "/equip/info/" + id, method: "get", }); +} + +// 查询设备详情 +export function getEquipCount() { + return request({ + url: "/equip/info/equipCount", + method: "get", + }); } \ No newline at end of file diff --git a/pages/index.vue b/pages/index.vue index 6bc4418..bc4431b 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -26,6 +26,22 @@ + + + + + + + + + 设备管理 + + {{equipCount}} + 台 + + + + @@ -296,6 +312,10 @@ getAlarmCount } from "@/api/alarm/alarm.js"; + import { + getEquipCount + } from "@/api/equip/equip.js"; + import { getPatrolCount } from "@/api/patrol/patrol.js" @@ -314,6 +334,8 @@ data() { return { XDATA: [], + //设备总数 + equipCount: 0, //巡检任务总数 patrolCount: 0, //报警总数 @@ -409,10 +431,12 @@ created() { this.getAlarmCount(); this.getPatrolCount(); + this.getEquipCount(); }, onShow() { this.getAlarmCount(); this.getPatrolCount(); + this.getEquipCount(); }, mounted() { this.queryBottomCylDataInit(); @@ -422,9 +446,17 @@ }, 10000); }, methods: { + handleClickAllEquip() { + this.$tab.navigateTo("/pages/work/equipInfo/listEquipInfo"); + }, handleClickPatrolCount() { this.$tab.navigateTo("/pages/work/patrol/listPatrol"); }, + getEquipCount() { + getEquipCount().then((res) => { + this.equipCount = res; + }) + }, getPatrolCount() { getPatrolCount().then((res) => { this.patrolCount = res;