From 92a944f71598c2a7e995726fa2c2b80c239c268d Mon Sep 17 00:00:00 2001 From: xusd Date: Mon, 17 Jun 2024 14:20:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=B7=BB=E5=8A=A0=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=BF=AB=E6=8D=B7=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/equip/equip.js | 8 ++++++++ pages/index.vue | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) 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;