首页添加设备快捷按钮

This commit is contained in:
xusd 2024-06-17 14:20:59 +08:00
parent 30e0db4748
commit 92a944f715
2 changed files with 40 additions and 0 deletions

View File

@ -24,3 +24,11 @@ export function getEquipInfoById(id) {
method: "get", method: "get",
}); });
} }
// 查询设备详情
export function getEquipCount() {
return request({
url: "/equip/info/equipCount",
method: "get",
});
}

View File

@ -26,6 +26,22 @@
<swiper class="swiper-box"> <swiper class="swiper-box">
<swiper-item> <swiper-item>
<view class="content-card-container"> <view class="content-card-container">
<view class="content-card-wrap" @click="handleClickAllEquip">
<view class="content-container">
<view class="content-icon-wrap">
<view class="content-icon-wrap">
<uni-icons type="flag-filled" size="40" color="#4eb562"></uni-icons>
</view>
</view>
<view class="content-title-wrap">
<view class="content-title">设备管理</view>
<view class="content-subTitle">
<text class="content-count">{{equipCount}}</text>
</view>
</view>
</view>
</view>
<view class="content-card-wrap" @click="handleClickPatrolCount"> <view class="content-card-wrap" @click="handleClickPatrolCount">
<view class="content-container"> <view class="content-container">
<view class="content-icon-wrap"> <view class="content-icon-wrap">
@ -296,6 +312,10 @@
getAlarmCount getAlarmCount
} from "@/api/alarm/alarm.js"; } from "@/api/alarm/alarm.js";
import {
getEquipCount
} from "@/api/equip/equip.js";
import { import {
getPatrolCount getPatrolCount
} from "@/api/patrol/patrol.js" } from "@/api/patrol/patrol.js"
@ -314,6 +334,8 @@
data() { data() {
return { return {
XDATA: [], XDATA: [],
//
equipCount: 0,
// //
patrolCount: 0, patrolCount: 0,
// //
@ -409,10 +431,12 @@
created() { created() {
this.getAlarmCount(); this.getAlarmCount();
this.getPatrolCount(); this.getPatrolCount();
this.getEquipCount();
}, },
onShow() { onShow() {
this.getAlarmCount(); this.getAlarmCount();
this.getPatrolCount(); this.getPatrolCount();
this.getEquipCount();
}, },
mounted() { mounted() {
this.queryBottomCylDataInit(); this.queryBottomCylDataInit();
@ -422,9 +446,17 @@
}, 10000); }, 10000);
}, },
methods: { methods: {
handleClickAllEquip() {
this.$tab.navigateTo("/pages/work/equipInfo/listEquipInfo");
},
handleClickPatrolCount() { handleClickPatrolCount() {
this.$tab.navigateTo("/pages/work/patrol/listPatrol"); this.$tab.navigateTo("/pages/work/patrol/listPatrol");
}, },
getEquipCount() {
getEquipCount().then((res) => {
this.equipCount = res;
})
},
getPatrolCount() { getPatrolCount() {
getPatrolCount().then((res) => { getPatrolCount().then((res) => {
this.patrolCount = res; this.patrolCount = res;