| | |
| | | <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; |
| | |
| | | const getWarning = () => { |
| | | getPumpWarning({limit: 10, page:1}).then(res => { |
| | | warnList.value = res.data.list |
| | | }).catch(err => { |
| | | if(err.message.includes("timeout")){ |
| | | clearInterval(timer) |
| | | 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('关闭') |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | |
| | | // 定时获取报警信息 |
| | | timer = setInterval(() => { |
| | | getWarning() |
| | | }, 3000) |
| | | }, 5000) |
| | | }) |
| | | onUnmounted(() => { |
| | | if(timer){ |
| | |
| | | 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; |
| | | } |
| | |
| | | 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; |
| | | } |