From 0ecf7b3bc6d6a008a804d55c859833bf2cf6473a Mon Sep 17 00:00:00 2001
From: zmc <zmc_li@foxmail.com>
Date: 星期三, 22 十一月 2023 10:06:29 +0800
Subject: [PATCH] 1.增加了有效率异常展示页面 2.风险模型的所属场景和运维商的详细信息,以及1个跳转页面链接 3.飞行巡检页面增加增加地址和运维商的筛选条件 4.飞行巡检页面是最新当日日期时,每类异常右上角增加一个“辅助审核” 5.历史数据管理增加 站点总数

---
 src/views/exception/SiteAuditAssistance.vue |  233 +++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 188 insertions(+), 45 deletions(-)

diff --git a/src/views/exception/SiteAuditAssistance.vue b/src/views/exception/SiteAuditAssistance.vue
index e575a35..333691e 100644
--- a/src/views/exception/SiteAuditAssistance.vue
+++ b/src/views/exception/SiteAuditAssistance.vue
@@ -13,6 +13,13 @@
 import ButtonClick from '@/sfc/ButtonClick.vue'
 import index from '@/utils/exception_common_function/index.js'
 import DaySelect from '@/sfc/DaySelect.vue';
+// import {useLoginUserStore} from '@/stores/user.js'
+import { useLoginUserStore } from '@/stores/user'
+import historyApi from '@/api/historyApi.js'
+import time from '@/utils/time.js'
+import lineChart from '@/utils/chartFunction/lineChart.js'
+import exceptionOption from '@/utils/chartFunction/exceptionOption.js'
+
 export default {
   components: {
     ExceptionType,
@@ -114,8 +121,10 @@
   },
   setup() {
     const { isExceedOneMonth } = useCommonFunction()
+    const userName = useLoginUserStore()
+
     return {
-      isExceedOneMonth
+      isExceedOneMonth,userName
     }
   },
   // 鐩戝惉  鍒ゆ柇鎸夐挳鏄惁鍙偣鍑�
@@ -190,15 +199,63 @@
   mounted() {
     this.backExceptionDataAWeekAgo()
     this.calTableHeight()
+ 
   },
 
   methods: {
+        /**
+     * 鏈夋晥鐜囧紓甯� 璁剧疆鎶樼嚎鍥鹃厤缃」
+     * @param锛� 
+     * @returns锛�
+     */
+    validProcess() {
+      // x杞存暟鎹�
+      let xList = time.ascTime(
+        this.tableCurrentRowData.beginTime,
+        this.tableCurrentRowData.endTime,
+        15
+      )
+
+      // y杞存暟鎹�
+      let yList = []
+      xList.forEach((item) => {
+        // 鏌ユ壘璇ユ椂闂寸殑鏁版嵁
+        let r = lineChart.findDate(this.dialog.historyData, item)
+        if (r) {
+          yList.push(r.dustValue)
+        } else {
+          yList.push(null)
+        }
+      })
+      // 棰滆壊鑳屾櫙鍖洪棿
+      // 寰楀埌鏃犳暟鎹殑鏃堕棿鐐规垨flag涓嶇瓑浜嶯鐨勬椂闂寸偣
+      let noDataTime = time.invalidTime(this.dialog.historyData, xList)
+      let rangeTime = time.seriesTime(noDataTime, 15)
+      // let rangeTime_1 = time.splitTime(rangeTime)
+      // 寰楀埌鑳屾櫙鍖洪棿鐨勯厤缃�
+      let areaObj = lineChart.getMarkArea(rangeTime, '寮傚父')
+
+      // 浼犲叆鍙傛暟
+      this.dialog.option = exceptionOption.setExceptionChartOption(
+        xList,
+        yList,
+        '',
+        '',
+        '',
+        '',
+        this.tableCurrentRowData.exception,
+        areaObj,
+        this.tableCurrentRowData.exceptionType
+      )
+    },
+
     giveDay(val){
       // 灏嗕腑鍥芥爣鍑嗘椂闂磋浆涓烘寚瀹氭牸寮�(璇ョ粍浠惰繑鍥炵殑鏍囧噯鏃堕棿鐨勬牸寮忥紝鎵�浠ュ繀椤荤殑鍔犺繖涓嚱鏁�)
 
         this.beginTime = dayjs(val).format('YYYY-MM-DD 00:00:00');
         this.endTime = dayjs(val).format('YYYY-MM-DD 23:59:59');
     },
+
     /**
      * 瀹¤鍐呭淇濆瓨涓鸿崏绋�
      * @param锛�
@@ -220,6 +277,7 @@
         this.auditData = res.data.data
       })
     },
+
     /**
      * 澶氶�夊垪锛堝凡瀹℃牳鐨勮涓嶄細鍔犲叆鍏朵腑锛�
      * @param
@@ -359,6 +417,10 @@
     submitAudit() {
       // 鍚屾椂濉啓浜嗗鏍镐汉鍛樺拰浼佷笟鐨勫娉�
       this.loading.submitAudit = true
+      // 鎶婄櫥闄嗙殑鐢ㄦ埛濮撳悕缁欏鏍镐汉
+      if(this.userName.getUserName != '-1'){
+        this.auditDialog.checker = this.userName.getUserName
+      }
       if (this.auditDialog.checkerNotes && this.auditDialog.enterpriseNotes) {
         this.sendAudit(
           this.auditDialog.checker,
@@ -429,11 +491,21 @@
     openAuditDiag(row) {
       this.auditDialog.visible = true
       this.tableCurrentRowData = row
-
       // 杩涘叆瀹℃牳椤垫椂锛屽皢琛ㄦ牸褰撳墠琛岀殑瀹℃牳淇℃伅缁欒緭鍏ユ
       this.auditDialog.checkerNotes = this.tableCurrentRowData.checkerContent
       this.auditDialog.enterpriseNotes = this.tableCurrentRowData.enterpriseContent
+      
+      // // 鏈鏍�  灏辨妸褰撳墠鐧婚檰鍚嶇粰瀹℃牳浜�
+      // if(this.tableCurrentRowData.uiRealName == null){
+      //   this.auditDialog.checker = this.userName.getUserName
+      // }
+      // // 宸插鏍�
+      // else{
+      //   this.auditDialog.checker = this.tableCurrentRowData.uiRealName
+      // }
+
     },
+
 
     /**
      * description锛氱偣鍑诲紓甯哥珯鐐瑰悕瀛楁椂 杩斿洖鐨勬暟鎹�
@@ -1044,20 +1116,42 @@
 
         // 寰楀埌涓婁竴琛岀殑鏁版嵁
         this.tableCurrentRowData = this.displayData[this.selectedRowIndex]
-        let params = index.requestGetParms(
-          this.tableCurrentRowData.name,
-          this.tableCurrentRowData.beginTime,
-          this.tableCurrentRowData.endTime
-        )
         this.loading.preButton = true
-        this.$http.get('/dust/history', { params: params }).then((response) => {
+
+        historyApi.queryHistoryData({
+          siteName:this.tableCurrentRowData.name,
+          beginTime:this.tableCurrentRowData.beginTime,
+          endTime:this.tableCurrentRowData.endTime
+        }).then(response => {
           // 淇濆瓨杩斿洖鐨勮秴鏍囨暟鎹�
           this.dialog.historyData = response.data.data
           this.dialog.exceptionTotal = response.data.data.length
           // 閫昏緫澶勭悊
-          this.timeAndDataProcessed()
+
+          if (this.tableCurrentRowData.exceptionType != '8') {
+            this.timeAndDataProcessed()
+          } else {
+            this.loading.lineChart = true
+            this.validProcess()
+            this.loading.lineChart = false
+            this.flag.banTouch = 0
+          }
           this.loading.preButton = false
         })
+        
+        // let params = index.requestGetParms(
+        //   this.tableCurrentRowData.name,
+        //   this.tableCurrentRowData.beginTime,
+        //   this.tableCurrentRowData.endTime
+        // )
+        // this.$http.get('/dust/history', { params: params }).then((response) => {
+        //   // 淇濆瓨杩斿洖鐨勮秴鏍囨暟鎹�
+        //   this.dialog.historyData = response.data.data
+        //   this.dialog.exceptionTotal = response.data.data.length
+        //   // 閫昏緫澶勭悊
+        //   this.timeAndDataProcessed()
+        //   this.loading.preButton = false
+        // })
       }
     },
     /**
@@ -1075,21 +1169,44 @@
 
         // 寰楀埌涓婁竴琛岀殑鏁版嵁
         this.tableCurrentRowData = this.displayData[this.selectedRowIndex]
-
-        let params = index.requestGetParms(
-          this.tableCurrentRowData.name,
-          this.tableCurrentRowData.beginTime,
-          this.tableCurrentRowData.endTime
-        )
         this.loading.afterButton = true
-        this.$http.get('/dust/history', { params: params }).then((response) => {
+
+        historyApi.queryHistoryData({
+          siteName:this.tableCurrentRowData.name,
+          beginTime:this.tableCurrentRowData.beginTime,
+          endTime:this.tableCurrentRowData.endTime
+        }).then(response => {
           // 淇濆瓨杩斿洖鐨勮秴鏍囨暟鎹�
           this.dialog.historyData = response.data.data
           this.dialog.exceptionTotal = response.data.data.length
           // 閫昏緫澶勭悊
-          this.timeAndDataProcessed()
+
+          if (this.tableCurrentRowData.exceptionType != '8') {
+            this.timeAndDataProcessed()
+          } else {
+            this.loading.lineChart = true
+            this.validProcess()
+            this.loading.lineChart = false
+            this.flag.banTouch = 0
+          }
           this.loading.afterButton = false
         })
+
+
+        // let params = index.requestGetParms(
+        //   this.tableCurrentRowData.name,
+        //   this.tableCurrentRowData.beginTime,
+        //   this.tableCurrentRowData.endTime
+        // )
+        
+        // this.$http.get('/dust/history', { params: params }).then((response) => {
+        //   // 淇濆瓨杩斿洖鐨勮秴鏍囨暟鎹�
+        //   this.dialog.historyData = response.data.data
+        //   this.dialog.exceptionTotal = response.data.data.length
+        //   // 閫昏緫澶勭悊
+        //   this.timeAndDataProcessed()
+        //   this.loading.afterButton = false
+        // })
       }
     },
 
@@ -1112,24 +1229,44 @@
       // 瀵硅姹傚埌鐨勬暟鎹繘琛岄灏炬嫾鎺�
       // 寰楀埌鍓嶅悗瀹屾暣鏁版嵁杩涜缁樺埗鍥惧舰
 
-      let params = {}
-      if (row.name) {
-        params['siteName'] = row.name
-      }
-      if (row.beginTime) {
-        params['beginTime'] = row.beginTime
-      }
-      if (row.endTime) {
-        params['endTime'] = row.endTime
-      }
+      historyApi.queryHistoryData({
+          siteName:row.name,
+          beginTime:row.beginTime,
+          endTime:row.endTime
+        }).then(response => {
+          // 淇濆瓨杩斿洖鐨勮秴鏍囨暟鎹�
+          this.dialog.historyData = response.data.data
+          this.dialog.exceptionTotal = response.data.data.length
+          // 閫昏緫澶勭悊
 
-      this.$http.get('/dust/history', { params: params }).then((response) => {
-        // 淇濆瓨杩斿洖鐨勮秴鏍囨暟鎹�
-        this.dialog.historyData = response.data.data
-        this.dialog.exceptionTotal = response.data.data.length
-        // 閫昏緫澶勭悊
-        this.timeAndDataProcessed()
-      })
+          if (this.tableCurrentRowData.exceptionType != '8') {
+            this.timeAndDataProcessed()
+          } else {
+            this.loading.lineChart = true
+            this.validProcess()
+            this.loading.lineChart = false
+            this.flag.banTouch = 0
+          }
+        })
+
+      // let params = {}
+      // if (row.name) {
+      //   params['siteName'] = row.name
+      // }
+      // if (row.beginTime) {
+      //   params['beginTime'] = row.beginTime
+      // }
+      // if (row.endTime) {
+      //   params['endTime'] = row.endTime
+      // }
+
+      // this.$http.get('/dust/history', { params: params }).then((response) => {
+      //   // 淇濆瓨杩斿洖鐨勮秴鏍囨暟鎹�
+      //   this.dialog.historyData = response.data.data
+      //   this.dialog.exceptionTotal = response.data.data.length
+      //   // 閫昏緫澶勭悊
+      //   this.timeAndDataProcessed()
+      // })
     },
 
     /**
@@ -1141,12 +1278,12 @@
         alert('鏃堕棿璺ㄥ害涓嶈兘瓒呰繃涓�涓湀')
         return
       }
-
       this.flag.originClick = 0
-
+      
       let params = {}
       params['page'] = this.currentPage
       params['pageSize'] = this.pageSize
+      
       if (this.form.name) {
         params['siteName'] = this.form.name
       }
@@ -1157,6 +1294,9 @@
       params['endTime'] = this.endTime
       this.loading.tableLoading = true
       this.loading.queryButton = true
+
+      console.log('绔欑偣锛�',params['siteName']);
+      console.log('绫诲瀷',params['exceptionType']);
       this.$http.get('/dust/exceptiondata', { params: params }).then((response) => {
         // 淇濆瓨杩斿洖鐨�
         // this.tableData = response.data.data.rows;
@@ -1186,6 +1326,8 @@
       if (this.form.name) {
         params['siteName'] = this.form.name
       }
+
+
       if (this.form.exceptionName) {
         params['exceptionType'] = this.form.exceptionName
       }
@@ -1224,7 +1366,7 @@
       const h2 = this.$refs.h2.$el.offsetHeight
       const h4 = this.$refs.h4.$el.offsetHeight
       // 鍏朵腑涓�涓�40鏄洅瀛愮殑鎬诲杈硅窛
-      this.tableHeight = `calc(100vh - ${h1}px - ${h2}px  - ${h4}px - 20px - 100px - var(--el-main-padding) * 2)`
+      this.tableHeight = `calc(100vh - ${h1}px - ${h2}px  - ${h4}px - 20px - 10px - var(--el-main-padding) * 2)`
       // this.tableHeight = `calc(100vh - ${h1}px  - ${h4}px - 100px - var(--el-main-padding) * 2)`;
     },
 
@@ -1300,8 +1442,7 @@
             </el-form-item>
 
             <el-form-item>
-              <!-- <el-button type="warning" :loading="loading.queryButton" @click="handleSubmit"><el-icon
-                style="margin-right: 6px;font-size: 1.2em;"><i-ep-Search /></el-icon>鏌ヨ</el-button> -->
+             
               <ButtonClick
                 content="鎼滅储"
                 type="warning"
@@ -1369,10 +1510,10 @@
           fixed
           :index="indexMethod1"
         />
-        <el-table-column prop="name" label="绔欑偣鍚嶇О" show-overflow-tooltip />
-        <el-table-column prop="mnCode" label="璁惧缂栧彿" align="center" show-overflow-tooltip />
+        <el-table-column prop="name" label="鐐逛綅鍚嶇О" show-overflow-tooltip />
+        <el-table-column prop="mnCode" label="璁惧缂栫爜" align="center" show-overflow-tooltip />
         <el-table-column prop="exception" label="寮傚父绫诲瀷" align="center" show-overflow-tooltip />
-        <el-table-column prop="region" label="鍖哄煙" align="center" show-overflow-tooltip />
+        <el-table-column prop="region" label="鍖哄幙" align="center" show-overflow-tooltip />
         <el-table-column prop="beginTime" label="寮�濮嬫椂闂�" align="center" show-overflow-tooltip />
         <el-table-column prop="endTime" label="缁撴潫鏃堕棿" align="center" show-overflow-tooltip />
         <el-table-column prop="typename" label="鍦烘櫙" align="center" width="82" show-overflow-tooltip />
@@ -1453,7 +1594,7 @@
 
     <el-form label-position="top">
       <el-form-item label="瀹℃牳浜�">
-        <el-input v-model="auditDialog.checker"></el-input>
+        <el-input v-model="userName.getUserName"></el-input>
       </el-form-item>
       <el-form-item label="瀹℃牳鎯呭喌">
         <el-input
@@ -1511,7 +1652,7 @@
     <template #header>
       <div class="diag-head">
         <div class="diag-head-text">
-          <div><span class="diag-head-text1">绔欑偣鍚嶇О锛�</span>{{ tableCurrentRowData.name }}</div>
+          <div><span class="diag-head-text1">鐐逛綅鍚嶇О锛�</span>{{ tableCurrentRowData.name }}</div>
           <div><span class="diag-head-text1">璁惧缂栧彿锛�</span>{{ tableCurrentRowData.mnCode }}</div>
           <div><span class="diag-head-text1">杩愮淮鍟嗭細</span>{{ tableCurrentRowData.dutyCompany }}</div>
  
@@ -1564,10 +1705,11 @@
         <el-table-column prop="lst" label="閲囬泦鏃堕棿" align="center" show-overflow-tooltip />
         <el-table-column
           prop="dustValue"
-          label="棰楃矑鐗╂祿搴�(mg/m鲁)"
+          label="TSP(mg/m鲁)"
           align="center"
           show-overflow-tooltip
         />
+        <el-table-column prop="flag" label="flag" align="center" show-overflow-tooltip />
       </el-table>
     </div>
     <template #footer>
@@ -1624,6 +1766,7 @@
 }
 .el-tag {
   font-size: 14px;
+  vertical-align: baseline;
 }
 
 .checknum-rate {

--
Gitblit v1.9.3