报警列表页面显示微标

This commit is contained in:
xusd 2024-06-12 17:28:11 +08:00
parent 53853c4c9f
commit 05c14ae118

View File

@ -1,7 +1,7 @@
<template>
<view class="card-group">
<u-tabs :list="tabList" @click="tabListClick"></u-tabs>
<u-popup :show="show" mode="bottom" :closeable = "closeable" @open= "openPopup" @close="closePopup">
<u-popup :show="show" mode="bottom" :closeable="closeable" @open="openPopup" @close="closePopup">
<ly-tree :tree-data="treeData" :ready="ready" node-key="id" :props="props"
:expandOnClickNode="expandOnClickNode" @node-click="handleNodeClick"></ly-tree>
</u-popup>
@ -54,7 +54,8 @@
<script>
import {
listRecord
listRecord,
getAlarmCount
} from "@/api/alarm/alarm.js";
import {
@ -94,10 +95,19 @@
equipList: [],
tabList: [{
name: '全部',
badge: {
value: 0,
}
}, {
name: '未处理',
badge: {
value: 5,
}
}, {
name: '已处理'
name: '已处理',
badge: {
value: 5,
}
}]
}
},
@ -114,16 +124,27 @@
onShow() {
this.alarmList = [];
this.getAlarmList();
this.getAlarmCount();
// this.getEquipList();
},
// onLoad(opts) {
// this.flag = opts.flag;
// },
methods: {
openPopup(){
getAlarmCount() {
getAlarmCount().then((res) => {
//
this.tabList[0].badge.value = res.allCount;
//
this.tabList[1].badge.value = res.untreatedCount;
//
this.tabList[2].badge.value = res.processedCount;
})
},
openPopup() {
this.getEquipList();
},
closePopup(){
closePopup() {
this.show = false;
},
handleNodeClick(obj) {
@ -161,12 +182,10 @@
// })
// })
this.ready = false;
this.treeData = [
{
"id":null,
"equipName": "所有设备"
}
];
this.treeData = [{
"id": null,
"equipName": "所有设备"
}];
getEquipTree().then((res) => {
this.treeData = this.treeData.concat(res);
this.ready = true;