From 28ea77ec45bd860e23c0edfb6ee81a7d6599b25f Mon Sep 17 00:00:00 2001
From: web <candymxq888@outlook.com>
Date: 星期六, 12 四月 2025 19:11:02 +0800
Subject: [PATCH] fix:修改配置文件

---
 src/views/screen/home/index.vue |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/src/views/screen/home/index.vue b/src/views/screen/home/index.vue
index ff685fe..7727726 100644
--- a/src/views/screen/home/index.vue
+++ b/src/views/screen/home/index.vue
@@ -86,12 +86,16 @@
 <script setup lang="ts">
 import {onMounted, onUnmounted, ref} from "vue";
 import {getPumpData, getPumpWarning} from '@/api/screen/index.js'
+import { ElMessageBox } from 'element-plus'
 
 const tucengVal = ref(0);
 const warnList = ref([])
 const showMsg = ref(0)
 const pointList = ref([])
+const dislogOpen = ref(false)
 let timer = null;
+
+const warnCode = ['B001StartNumber', 'B002StartNumber', 'B003StartNumber', 'B004StartNumber']
 
 const clickMsgFun = (index: number) => {
     showMsg.value = showMsg.value === index ? null : index;
@@ -101,6 +105,17 @@
 const getWarning = () => {
     getPumpWarning({limit: 10, page:1}).then(res => {
         warnList.value = res.data.list
+        const warnDialogList = res.data.list.filter(el => warnCode.includes(el.code))
+        if(!dislogOpen.value && warnDialogList.length > 0) {
+            dislogOpen.value=true
+            ElMessageBox.confirm(warnDialogList[0].facilityName, warnDialogList[0].description, {
+                showCancelButton: false,
+                confirmButtonText: '关闭',
+                type: 'error'
+            }).then(() => {
+                console.log('关闭')
+            })
+        }
     })
 }
 
@@ -143,7 +158,7 @@
     // 定时获取报警信息
     timer = setInterval(() => {
         getWarning()
-    }, 3000)
+    }, 5000)
 })
 onUnmounted(() => {
     if(timer){
@@ -255,6 +270,8 @@
             transition: all .5s;
             &-t {
                 background-image: url('@/assets/images_lc/title_font.png');
+                background-repeat: no-repeat;
+                background-size: 100% 100%;
                 padding-left: 16%;
                 font-size: 1.2rem;
             }
@@ -325,6 +342,8 @@
             flex-direction: column;
             .warnRecord-title {
                 background-image: url('@/assets/images_lc/title_font.png');
+                background-repeat: no-repeat;
+                background-size: 100% 100%;
                 padding-left: 16%;
                 font-size: 1.3rem;
             }

--
Gitblit v1.9.3