Jelajahi Sumber

预处理结果直接展示曲线、进度条问题、解决报错会关闭对话框问题

Rmengdi 6 bulan lalu
induk
melakukan
4360388c95

+ 3 - 0
src/views/als/MDCData/index.vue

@@ -383,9 +383,12 @@ export default {
 
     handUpdate(row) {
       this.dialogTitle = '编辑'
+
       const matchedItem = this.aircaftCatalogAll.find((item) => row.aircraftId.trim() === item.aircaftCatalogId.trim())
+
       this.getSortieNoAPI(matchedItem.aircaftCatalogCode)
       this.form = deepClone(row)
+      console.log('this.form', this.form)
       this.dialogVisible = true
     },
 

+ 3 - 2
src/views/als/airConfiguration/index.vue

@@ -307,6 +307,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getAirConfigurationAPI({ aircraftType: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -320,6 +321,8 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+
+          this.handleClose()
           this.getAirConfigurationAPI({ aircraftType: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -373,11 +376,9 @@ export default {
       switch (this.dialogTitle) {
         case '编辑':
           this.updateAirConfigurationAPI()
-          this.handleClose()
           break
         case '新增':
           this.addAirConfigurationAPI()
-          this.handleClose()
           break
       }
     },

+ 2 - 2
src/views/als/aircraft/index.vue

@@ -233,6 +233,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getAircraftAPI({ aircaftModelIdList: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -246,6 +247,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getAircraftAPI({ aircaftModelIdList: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -295,11 +297,9 @@ export default {
       switch (this.dialogTitle) {
         case '编辑':
           this.updateAircraftAPI()
-          this.handleClose()
           break
         case '新增':
           this.addAircraftAPI()
-          this.handleClose()
           break
       }
     },

+ 12 - 9
src/views/als/components/Charts/playBackChart.vue

@@ -37,15 +37,18 @@ export default {
       chart: null
     }
   },
-  // watch: {
-  //   chartData: {
-  //     deep: true,
-  //     handler(val) {
-  //       this.initChart()
-  //       this.setOptions(val)
-  //     }
-  //   }
-  // },
+  watch: {
+    chartData: {
+      deep: true,
+      handler(val) {
+        // this.initChart()
+        this.$nextTick(() => {
+          this.initChart()
+          this.setOptions(val)
+        })
+      }
+    }
+  },
   mounted() {
     this.$nextTick(() => {
       this.initChart()

+ 36 - 28
src/views/als/falseAlarm/index.vue

@@ -49,9 +49,10 @@
           </el-form-item>
           <el-form-item label="警告列表" prop="warningIds">
             <el-table ref="warningTableRef" :data="warningIdsList" @current-change="warningSelection" style="width: 100%; height: 200px" highlight-current-row>
-              <el-table-column prop="id" label="警告ID"> </el-table-column>
-              <el-table-column prop="name" label="名称"> </el-table-column>
-              <el-table-column prop="describe" label="描述"> </el-table-column>
+              <!-- <el-table-column prop="id" label="警告ID"> </el-table-column> -->
+              <el-table-column prop="name" label="警告名称" align="center"> </el-table-column>
+              <el-table-column prop="code" label="警告代码" align="center"> </el-table-column>
+              <el-table-column prop="describe" label="描述" align="center"> </el-table-column>
             </el-table>
           </el-form-item>
 
@@ -495,6 +496,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getFalseAlarmAPI({ aircraftId: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -571,34 +573,41 @@ export default {
         return
       }
       this.progressVisible = true
+      let myTimer = setInterval(() => {
+        if (this.percentage < 100) {
+          this.percentage += 1
+        } else {
+          clearInterval(myTimer)
+          this.$message({
+            type: 'error',
+            message: '执行有误'
+          })
+          this.progressVisible = false
+          this.percentage = 0
+        }
+      }, 30)
+
       try {
-        this.percentage += 1
         const res = await executeFalseAlarm(this.executeForm)
-        const myTimer = setInterval(() => {
-          if (res?.code === 200 && this.percentage == 100) {
-            this.progressVisible = false
-            clearInterval(myTimer)
-            this.percentage = 0
-            this.handleClose()
-            this.$message({
-              type: 'success',
-              message: '执行成功!'
-            })
-            const result = JSON.parse(res.data)[0]
-            const isfalseAlarm = result['是否虚警'] === 0 ? '否' : '是'
-            this.getFalseAlarmAPI({ aircraftId: this.aircaftModelIdList })
-            this.$alert(`故障编码为:${result['故障编码']},是否虚警:${isfalseAlarm},`, '虚警抑制结果', {
-              confirmButtonText: '确定'
-            })
-          } else {
-            this.percentage += 1
-          }
-        }, 30)
+        this.percentage = 100
+        clearInterval(myTimer)
+        if (res?.code === 200) {
+          this.$message({
+            type: 'success',
+            message: '执行成功!'
+          })
+          this.handleClose()
+          const result = JSON.parse(res.data)[0]
+          const isfalseAlarm = result['是否虚警'] === 0 ? '否' : '是'
+          this.getFalseAlarmAPI({ aircraftId: this.aircaftModelIdList })
+          this.$alert(`故障编码为:${result['故障编码']},是否虚警:${isfalseAlarm},`, '虚警抑制结果', {
+            confirmButtonText: '确定'
+          })
+        }
       } catch (error) {
+        clearInterval(myTimer)
+      } finally {
         this.progressVisible = false
-        if (myTimer) {
-          clearInterval(myTimer)
-        }
         this.percentage = 0
       }
     },
@@ -655,7 +664,6 @@ export default {
       switch (this.dialogTitle) {
         case '编辑':
           this.updateFalseAlarmAPI()
-          this.handleClose()
           break
         case '新增':
           this.beginExecute()

+ 2 - 2
src/views/als/faultCase/index.vue

@@ -387,6 +387,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getFaultCaseAPI({ aircraftCodes: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -400,6 +401,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getFaultCaseAPI({ aircraftCodes: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -453,11 +455,9 @@ export default {
       switch (this.dialogTitle) {
         case '编辑':
           this.updateFaultCaseAPI()
-          this.handleClose()
           break
         case '新增':
           this.addFaultCaseAPI()
-          this.handleClose()
           break
       }
     },

+ 32 - 25
src/views/als/faultDiagnosis/index.vue

@@ -469,6 +469,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getFaultDiagnosisAPI({ aircraftId: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -557,34 +558,41 @@ export default {
     },
     async beginExecute() {
       this.progressVisible = true
-      this.percentage += 1
+
+      let myTimer = setInterval(() => {
+        if (this.percentage < 100) {
+          this.percentage += 1
+        } else {
+          clearInterval(myTimer)
+          this.$message({
+            type: 'error',
+            message: '执行有误'
+          })
+          this.progressVisible = false
+          this.percentage = 0
+        }
+      }, 30)
+
       try {
         const res = await executeFault(this.executeForm)
-        this.percentage += 1
-        const myTimer = setInterval(() => {
-          if (res?.code === 200 && this.percentage == 100) {
-            this.progressVisible = false
-            clearInterval(myTimer)
-            this.percentage = 0
-            this.handleClose()
-            this.$message({
-              type: 'success',
-              message: '执行成功!'
-            })
-            const result = res.data
-            this.$alert(`故障诊断结果为:${result}`, '故障诊断结果', {
-              confirmButtonText: '确定'
-            })
-            this.getFaultDiagnosisAPI({ aircraftId: this.aircaftModelIdList })
-          } else {
-            this.percentage += 1
-          }
-        }, 30)
+        this.percentage = 100
+        clearInterval(myTimer)
+        if (res?.code === 200) {
+          this.$message({
+            type: 'success',
+            message: '执行成功!'
+          })
+          this.handleClose()
+          const result = res.data
+          this.$alert(`故障诊断结果为:${result}`, '故障诊断结果', {
+            confirmButtonText: '确定'
+          })
+          this.getFaultDiagnosisAPI({ aircraftId: this.aircaftModelIdList })
+        }
       } catch (error) {
+        clearInterval(myTimer)
+      } finally {
         this.progressVisible = false
-        if (myTimer) {
-          clearInterval(myTimer)
-        }
         this.percentage = 0
       }
     },
@@ -633,7 +641,6 @@ export default {
       switch (this.dialogTitle) {
         case '编辑':
           this.updateFaultDiagnosisAPI()
-          this.handleClose()
           break
         case '新增':
           this.beginExecute()

+ 1 - 1
src/views/als/lifePrediction/index.vue

@@ -375,6 +375,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getLifePredictionAPI({ aircraftId: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -504,7 +505,6 @@ export default {
       switch (this.dialogTitle) {
         case '编辑':
           this.updateLifePredictionAPI()
-          this.handleClose()
           break
         case '新增':
           // this.addLifePredictionAPI()

+ 2 - 2
src/views/als/maintenance/index.vue

@@ -348,6 +348,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getMaintenanceAPI({ aircaftModelIdList: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -361,6 +362,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getMaintenanceAPI({ aircaftModelIdList: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -424,11 +426,9 @@ export default {
       switch (this.dialogTitle) {
         case '编辑':
           this.updateMaintenanceAPI()
-          this.handleClose()
           break
         case '新增':
           this.addMaintenanceAPI()
-          this.handleClose()
           break
       }
     },

+ 2 - 2
src/views/als/maintenanceask/index.vue

@@ -337,6 +337,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getMaintenanceaskAPI({ aircraftCodes: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -350,6 +351,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getMaintenanceaskAPI({ aircraftCodes: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -397,11 +399,9 @@ export default {
       switch (this.dialogTitle) {
         case '编辑':
           this.updateMaintenanceaskAPI()
-          this.handleClose()
           break
         case '新增':
           this.addMaintenanceaskAPI()
-          this.handleClose()
           break
       }
     },

+ 2 - 2
src/views/als/partReplacement/index.vue

@@ -295,6 +295,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getPartReplacementAPI({ aircraftCode: this.aircraftCodeIdList })
         }
       } catch (error) {}
@@ -308,6 +309,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getPartReplacementAPI({ aircraftCode: this.aircraftCodeIdList })
         }
       } catch (error) {}
@@ -363,11 +365,9 @@ export default {
       switch (this.dialogTitle) {
         case '编辑':
           this.updatePartReplacementAPI()
-          this.handleClose()
           break
         case '新增':
           this.addPartReplacementAPI()
-          this.handleClose()
           break
       }
     },

+ 56 - 36
src/views/als/preProcessing/index.vue

@@ -443,6 +443,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getPreProcessingAPI({ aircraftId: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -529,23 +530,35 @@ export default {
       }
       try {
         const { data } = await getOssIdPlaybackDataAPI(row.ossId)
-        const { contentData, headData } = this.handleResultData(JSON.parse(data))
-        this.chartData.legendData = headData
-        for (var key in contentData) {
-          if (key === '时间') {
-            this.chartData.xAxisData = contentData['时间']
-          } else {
-            this.chartData.seriesData.push({
-              name: key,
-              type: 'line',
-              data: contentData[key],
-              connectNulls: true
-            })
-          }
-        }
-        this.resultVisible = true
+        this.getResultData(data)
       } catch (error) {}
     },
+
+    getResultData(data) {
+      this.chartData = {
+        title: '',
+        legendData: [],
+        xAxisData: [],
+        yAxisData: [],
+        seriesData: []
+      }
+      const { contentData, headData } = this.handleResultData(JSON.parse(data))
+      this.chartData.legendData = headData
+      for (var key in contentData) {
+        if (key === '时间') {
+          this.chartData.xAxisData = contentData['时间']
+        } else {
+          this.chartData.seriesData.push({
+            name: key,
+            type: 'line',
+            data: contentData[key],
+            connectNulls: true
+          })
+        }
+      }
+      this.resultVisible = true
+    },
+
     handleResultData(resultData) {
       const headData = Object.keys(resultData[0])
       const contentData = {}
@@ -567,30 +580,38 @@ export default {
     },
     async beginExecute() {
       this.progressVisible = true
-      this.percentage += 1
+
+      let myTimer = setInterval(() => {
+        if (this.percentage < 100) {
+          this.percentage += 1
+        } else {
+          clearInterval(myTimer)
+          this.$message({
+            type: 'error',
+            message: '执行有误'
+          })
+          this.progressVisible = false
+          this.percentage = 0
+        }
+      }, 30)
+
       try {
         const res = await executePreProcessing(this.executeForm)
-        this.percentage += 1
-        const myTimer = setInterval(() => {
-          if (res?.code === 200 && this.percentage == 100) {
-            this.progressVisible = false
-            clearInterval(myTimer)
-            this.percentage = 0
-            this.handleClose()
-            this.$message({
-              type: 'success',
-              message: '执行成功!'
-            })
-            this.getPreProcessingAPI({ aircraftId: this.aircaftModelIdList })
-          } else {
-            this.percentage += 1
-          }
-        }, 30)
+        this.percentage = 100
+        clearInterval(myTimer)
+        if (res?.code === 200) {
+          this.$message({
+            type: 'success',
+            message: '执行成功!'
+          })
+          this.handleClose()
+          this.getResultData(res.data)
+          this.getPreProcessingAPI({ aircraftId: this.aircaftModelIdList })
+        }
       } catch (error) {
+        clearInterval(myTimer)
+      } finally {
         this.progressVisible = false
-        if (myTimer) {
-          clearInterval(myTimer)
-        }
         this.percentage = 0
       }
     },
@@ -638,7 +659,6 @@ export default {
       switch (this.dialogTitle) {
         case '编辑':
           this.updatePreProcessingAPI()
-          this.handleClose()
           break
         case '新增':
           this.beginExecute()

+ 0 - 2
src/views/als/smTask/index.vue

@@ -403,11 +403,9 @@ export default {
       switch (this.dialogTitle) {
         case '编辑':
           this.updateSmTaskAPI()
-          this.handleClose()
           break
         case '新增':
           this.addSmTaskAPI()
-          this.handleClose()
           break
       }
     },

+ 2 - 2
src/views/als/smaskRecord/index.vue

@@ -268,6 +268,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getSmaskRecordAPI({ aircaftModelIdList: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -281,6 +282,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getSmaskRecordAPI({ aircaftModelIdList: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -334,11 +336,9 @@ export default {
       switch (this.dialogTitle) {
         case '编辑':
           this.updateSmaskRecordAPI()
-          this.handleClose()
           break
         case '新增':
           this.addSmaskRecordAPI()
-          this.handleClose()
           break
       }
     },

+ 12 - 4
src/views/als/warning/index.vue

@@ -322,10 +322,18 @@ export default {
     },
 
     async getSortieNoAPI(aircaftCatalogCode) {
-      const res = await getSortieNo({ aircaftCatalogCode })
-      this.sortieNoList = res.data.filter((item) => {
-        return item.taskName
-      })
+      try {
+        this.sortieNoList = []
+        const catalogRes = await getDataImport({ aircraftId: this.currentNodeKey })
+        const res = await getSortieNo({ aircaftCatalogCode })
+        catalogRes.data.list.forEach((catalogItem) => {
+          res.data.forEach((item) => {
+            if (catalogItem.sortieNo === item.taskId && !this.sortieNoList.includes(item)) {
+              this.sortieNoList.push(item)
+            }
+          })
+        })
+      } catch (error) {}
     },
 
     openDialog() {