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 @@
-
-
-
-
-
- 批量处理
-
-
-
-
-
- 批量删除
-
+
+
+
+
+
+
+
+ 批量处理
+
+
+
+
+
+ 批量删除
+
+
-
+
+
+
+
+
+
+
+ {{ row.created ? dayjs(row.created * 1000).format('YYYY-MM-DD HH:mm:ss') : '' }}
+
+
+
+
+
+
+
+
@@ -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;
+ }
+ }
+ }
}