首页添加设备快捷按钮

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",
});
}
// 查询设备详情
export function getEquipCount() {
return request({
url: "/equip/info/equipCount",
method: "get",
});
}

View File

@ -26,6 +26,22 @@
<swiper class="swiper-box">
<swiper-item>
<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-container">
<view class="content-icon-wrap">
@ -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;