From a4bcd1eb9305e2c1b77c7847c2f4a979c0e95e93 Mon Sep 17 00:00:00 2001
From: batman <978517621@qq.com>
Date: 星期一, 13 三月 2023 19:45:50 +0800
Subject: [PATCH] 新修改添加页面

---
 src/views/intellectInspect/intelligentLine/index.vue |   89 ++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 84 insertions(+), 5 deletions(-)

diff --git a/src/views/intellectInspect/intelligentLine/index.vue b/src/views/intellectInspect/intelligentLine/index.vue
index ae41abf..de17046 100644
--- a/src/views/intellectInspect/intelligentLine/index.vue
+++ b/src/views/intellectInspect/intelligentLine/index.vue
@@ -20,6 +20,36 @@
         </div>
         <div class="blocks">
             <div>
+            <div class="warning-part">
+              <div class="warn-tit">异常警报:</div>
+              <div class="warn-msg" v-if="excepOrder && excepOrder.length>0">
+                <div class="warn-item" v-for="(item,index) in excepOrder" :key="index">
+                  <div class="i-tit">
+                    编号{{item.pointCode}} 巡检异常!
+                  </div>
+                  <div v-if="item.dataReportType == 2 || item.dataReportType == 3">
+                    正常值:<span>{{(item.secondReferenceSign==1?'>':'>=') + item.secondReferenceValue + ',' + (item.thirdReferenceSign==3?'<':'<=') + item.thirdReferenceValue}}</span>
+                  </div>
+                  <div>
+                    巡检值:
+                    <span v-if="item.dataReportType == 1">{{ item.firstReferenceResult==1?'正常':item.firstReferenceResult==2?'异常':'备'}}</span>
+                    <span v-if="item.dataReportType == 2">{{ item.secondReferenceResult}}</span>
+                  </div>
+                  <div>
+                    已通知负责人:<span>{{item.hiddenDangerHandlerName}}</span>
+                  </div>
+                  <div>
+                    负责人电话:<span>{{item.hiddenDangerHandlerPhone}}</span>
+                  </div>
+                  <div>
+                    工单回执状态:<span>{{item.handlerStatus==1?'待响应':item.handlerStatus==2?'标记误报':item.handlerStatus==3?'自查处理中':item.handlerStatus==4?'已移交上报':item.handlerStatus==5?'待验收':'已完成'}}</span>
+                  </div>
+                </div>
+              </div>
+              <div v-else>
+                暂无异常警报
+              </div>
+            </div>
             <div class="star-pic">
                 <dv-decoration-12 scanDur="5" haloDur="4" class="scan"/>
                 <div class="star-bg"><img src="../../../assets/loginPage/star-bg.png" /></div>
@@ -109,6 +139,7 @@
     socket: any;
     socketData: string;
     data: Array<any>;
+    excepOrder: Array<any>;
     id: string;
     defaultImg: string
 }
@@ -125,6 +156,7 @@
             socketData: '',
             socket: null,
             data: [],
+            excepOrder: [],
             id: '',
             defaultImg: new URL('../../../assets/default-img.jpg',import.meta.url).href
         });
@@ -158,9 +190,7 @@
                     // 实例化socket
                     let uid =  userInfos.value.uid.toString()
                     var url = state.path + uid + '*' + id;
-                    console.log(url,'url',uid,'uid')
                     url = url.replace('https', 'ws').replace('http', 'ws');
-                    console.log(url, '获取地址');
                     state.socket = new WebSocket(url);
                     // 监听socket连接
                     state.socket.onopen = () => {
@@ -172,9 +202,11 @@
                     };
                     // 监听socket消息
                     state.socket.onmessage = (msg) => {
+                      console.log(msg.data,'msg.data')
+                      console.log(msg.data.rfidInfos,'rfidInfos')
                         if (msg.data === '连接成功') return;
-                        console.log(msg.data,'data')
-                        userInfos.value.dataList = JSON.parse(msg.data);
+                        userInfos.value.dataList = JSON.parse(msg.data.rfidInfos);
+                        state.excepOrder = JSON.parse(msg.data.excepOrder);
                     };
                 }
             } else {
@@ -193,7 +225,12 @@
         const getLine = async (id:string) => {
             let res = await lineApi().getLine({ id: id });
             if (res.data.code === '200') {
-                userInfos.value.dataList = res.data.data
+                userInfos.value.dataList = res.data.data.rfidInfos
+              if(res.data.data.excepOrder){
+                state.excepOrder = res.data.data.excepOrder
+              }else{
+                state.excepOrder = []
+              }
             } else {
                 ElMessage({
                     type: 'warning',
@@ -1360,6 +1397,48 @@
                     }
                 }
             }
+            .warning-part{
+              position: absolute;
+              width: calc((100vw - 120px) / 7);
+              height: calc((100vw - 120px) / 7);
+              background-image: linear-gradient(to right, rgba(8, 109, 209, 0.4), rgba(11, 255, 255, 0.2));
+              border: 1px solid #36fcfc;
+              z-index: 99999;
+              top: 100px;
+              right: 60px;
+              padding: 10px;
+              color: rgb(0, 255, 255);
+
+              .warn-tit{
+                height: 26px;
+                padding-bottom: 5px;
+                font-weight: bolder;
+                border-bottom: 1px solid rgb(0, 255, 255);
+              }
+              .warn-msg{
+                width: 100%;
+                margin-top: 10px;
+                height: calc(100% - 36px);
+                overflow: hidden;
+                overflow-y: scroll;
+                scrollbar-width: none; /* firefox */
+                -ms-overflow-style: none; /* IE 10+ */
+
+                &::-webkit-scrollbar {
+                  display: none; /* Chrome Safari */
+                }
+                .warn-item{
+                  padding: 0 0 10px;
+                  margin-bottom: 10px;
+                  border-bottom: 1px solid rgb(0, 255, 255);
+
+                  &:last-of-type{
+                    border-bottom: none;
+                    margin-bottom: 0;
+                  }
+                }
+              }
+            }
             .star-pic {
                 position: absolute;
                 width: calc((100vw - 120px) / 7);

--
Gitblit v1.9.2