From b6c5b6960d1bfb3e192c82bd87272c1de71e30d0 Mon Sep 17 00:00:00 2001 From: Lufaneng Date: Mon, 22 Dec 2025 14:17:47 +0800 Subject: [PATCH] 1 --- src/views/AlarmInformation/index.vue | 133 +++++++++++++++++++++++---- 1 file changed, 115 insertions(+), 18 deletions(-) diff --git a/src/views/AlarmInformation/index.vue b/src/views/AlarmInformation/index.vue index 5b4fe34..7de1934 100644 --- a/src/views/AlarmInformation/index.vue +++ b/src/views/AlarmInformation/index.vue @@ -17,21 +17,42 @@
-
- - - - - 批量处理 - - - - - - 批量删除 - +
+
+
重大预警
+
一般预警
+
+
+ + + + + 批量处理 + + + + + + 批量删除 + +
- + + + + + + + + + + + + + + @@ -106,12 +127,29 @@ const loading = ref(false) const total = ref(0) const pageSize = ref(8) const currentPage = ref(1) +const type = ref('重大预警') +const changeTab = (tab) => { + type.value = tab + if (type.value === '重大预警') { + getBigData() + } else { + getData() + } +} const handleSizeChange = () => { currentPage.value = 1 - getData() + if (type.value === '重大预警') { + getBigData() + } else { + getData() + } } const handleCurrentChange = () => { - getData() + if (type.value === '重大预警') { + getBigData() + } else { + getData() + } } const tableData = ref([]) @@ -193,11 +231,51 @@ const getData = () => { loading.value = false }) } -getData() +// getData() + +const bigTableData = ref([]) +const getBigData = () => { + loading.value = true + RPC.post('/eventcenter/type/list', { page: 1, limit: 20, and: { is_fault: [true] } }).then(res => { + const faultList = res.rows || [] + if (faultList.length > 0) { + const params = { + "limit": pageSize.value, + "page": currentPage.value, + "and": { + "device_id": [ + commit_uid + ], + event_type_id: faultList.map(item => item.id) + }, + "like": {}, + } + RPC.post('/eventcenter/list', params).then(res => { + total.value = res.count || 0 + bigTableData.value = res.rows || [] + }).finally(() => { + loading.value = false + }) + } else { + loading.value = false + total.value = 0 + bigTableData.value = [] + faults.value = [] + } + }).catch(() => { + loading.value = false + }) + +} +getBigData() const reflesh = () => { currentPage.value = 1 - getData() + if (type.value === '重大预警') { + getBigData() + } else { + getData() + } } @@ -307,6 +385,25 @@ onUnmounted(() => { color: #fff; } } + + .tabBox { + display: flex; + align-items: center; + gap: 10px; + + .tab { + color: #fff; + padding: 4px 10px; + border-radius: 4px; + border: 1px solid #fff; + cursor: pointer; + + &.select { + color: #0881FE; + border: 1px solid #0881FE; + } + } + } }