报警列表页面显示微标

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