Rmengdi 1 rok pred
rodič
commit
b388218e1e

+ 57 - 56
PHM-web/src/views/manage/faultDiagnosis/index.vue

@@ -109,7 +109,7 @@
         </el-form-item>
         <el-form-item label="参数选择" v-if="!(selectModelVal==='')">
           <el-transfer v-model="selectSortieParams" :props="{ key: 'value', label: 'desc' }" :data="parameterList"
-            filterable filter-placeholder="请输入参数名称" :titles="['所有参数', '展示参数']">
+            filterable filter-placeholder="请输入参数名称" :titles="['所有参数', '处理参数']">
           </el-transfer>
         </el-form-item>
       </el-form>
@@ -121,9 +121,11 @@
     </el-dialog>
     <!-- 虚警抑制清单 -->
     <el-dialog :title="title" :visible.sync="dialogResult" width="800" :close-on-click-modal="false" append-to-body>
-      <falseAlarmResult v-if="showFlag=='3'" :resultList='falseAlarmResultList' :parameterData='parameterData'/>
-      <groundDiagnosisResult v-if="showFlag=='4'" :resultText='groundDiagnosisResultText'/>
-      <deepIsolationResult v-if="showFlag=='5'"  :resultText='deepIsolationResultText'/>
+      <div style="max-height: 380px; overflow-y: auto; overflow-x: hidden;">
+        <falseAlarmResult v-if="showFlag=='3'" :resultList='falseAlarmResultList' :parameterData='parameterData' />
+        <groundDiagnosisResult v-if="showFlag=='4'" :resultText='groundDiagnosisResultText' />
+        <deepIsolationResult v-if="showFlag=='5'" :resultText='deepIsolationResultText' />
+      </div>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="next">{{ FABtnText }}</el-button>
         <el-button type="success" @click="reportHandel" v-if="showFlag==('4' && '5')">上报</el-button>
@@ -134,7 +136,12 @@
 </template>
 
 <script>
-import { listSortie, getSortie, getSortieParams,getSortieDataByName } from '@/api/manage/sortie'
+import {
+  listSortie,
+  getSortie,
+  getSortieParams,
+  getSortieDataByName,
+} from '@/api/manage/sortie'
 import {
   beginModel,
   listSortieParameterAll,
@@ -151,7 +158,7 @@ export default {
   components: {
     falseAlarmResult,
     groundDiagnosisResult,
-    deepIsolationResult
+    deepIsolationResult,
   },
   dicts: ['data_type'],
   data() {
@@ -212,7 +219,7 @@ export default {
       ],
       selectSortieId: '',
       radio: '0',
-      checkList: ['3','4','5'],
+      checkList: ['3', '4', '5'],
       // 进度条是否显示弹出框
       dialogProgress: false,
       percentageVal: 50,
@@ -232,25 +239,25 @@ export default {
       modelId: null,
       batchNo: '',
       // 虚警抑制结果的按钮
-      FABtnText:'下一步',
-      showFlag:'',
+      FABtnText: '下一步',
+      showFlag: '',
       // 获取数据的参数数值
-      parameterData:[],
+      parameterData: [],
       // 模型运行结果
-      falseAlarmResultList:[],
-      groundDiagnosisResultText:'',
-      deepIsolationResultText:''
+      falseAlarmResultList: [],
+      groundDiagnosisResultText: '',
+      deepIsolationResultText: '',
     }
   },
   watch: {
     checkList: {
       handler(newValue, oldValue) {
-        if (newValue.length===0) {
+        if (newValue.length === 0) {
           this.FABtnText = '完成'
         }
       },
       deep: true,
-    }
+    },
   },
   created() {
     this.getList()
@@ -293,7 +300,10 @@ export default {
         this.title = '故障诊断信息'
       })
       listSortieParameterAll({ sortieNo: row.sortieNumber }).then(response => {
-        this.sortieParameterAllList = response.data
+        this.sortieParameterAllList = response.data.filter(item => {
+          return item.type === 0 || item.type === 1 || item.type === 2
+        })
+        // this.sortieParameterAllList = response.data
         this.loading = false
       })
     },
@@ -302,8 +312,7 @@ export default {
       this.open = false
       this.reset()
       // this.radio = 0
-      this.checkList=['3','4','5'],
-      this.selectedSortieDataType = ''
+      ;(this.checkList = ['3', '4', '5']), (this.selectedSortieDataType = '')
       this.batchNo = ''
     },
     cancelSelectModel() {
@@ -338,9 +347,9 @@ export default {
       if (this.selectedSortieDataType === '') {
         this.$message.error(`请选择架次数据`)
       } else {
-        this.checkList = this.checkList.map(str => parseInt(str, 10));
-        console.log("checkList",this.checkList);
-        console.log("checkList[0]",this.checkList[0]);
+        this.checkList = this.checkList.map(str => parseInt(str, 10))
+        console.log('checkList', this.checkList)
+        console.log('checkList[0]', this.checkList[0])
         this.open = false
         this.dialogSelectModel = true
         if (this.checkList[0] === 3) {
@@ -387,7 +396,7 @@ export default {
     },
     begin() {
       this.dialogResult = false
-      this.checkList = this.checkList.map(str => parseInt(str, 10));
+      this.checkList = this.checkList.map(str => parseInt(str, 10))
       if (this.checkList[0] === 3) {
         this.falseAlarmBegin()
       } else if (this.checkList[0] === 4) {
@@ -397,7 +406,7 @@ export default {
       }
     },
     // 虚警抑制模型执行
-    falseAlarmBegin(){
+    falseAlarmBegin() {
       this.dialogSelectModel = false
       this.title = '虚警抑制模型执行中'
       this.dialogProgress = true
@@ -411,13 +420,13 @@ export default {
         dataParams: this.selectSortieParams,
       }
       console.log('data', data)
-      const data1={
+      const data1 = {
         sortieNo: this.form.sortieNumber,
         parameters: this.selectSortieParams,
       }
       getSortieDataByName(data1).then(response => {
-        this.parameterData = JSON.parse(response.data);
-        console.log("this.parameterData",this.parameterData)
+        this.parameterData = JSON.parse(response.data)
+        console.log('this.parameterData', this.parameterData)
       })
       if (!this.timer) {
         this.timer = setInterval(() => {
@@ -425,28 +434,20 @@ export default {
           if (this.percentageVal == 98) {
             clearInterval(this.timer)
             this.timer = null
-            // this.dialogProgress = false
-            // this.dialogResult = true
-            // this.title = '虚警抑制结果'
-            // // 选择模型页面数据清空
-            // this.selectModelVal = ''
-            // this.showFlag=this.checkList[0]
-            // // 删除数组中第一个元素
-            // this.checkList.shift()
             beginModel(data).then(response => {
-              if(response.code===200){
+              if (response.code === 200) {
                 this.falseAlarmResultList = JSON.parse(response.data)
-                this.$message.success("执行成功")
+                this.$message.success('执行成功')
                 this.dialogProgress = false
-                this.percentageVal=50
+                this.percentageVal = 50
                 this.dialogResult = true
                 this.title = '虚警抑制结果'
                 // 选择模型页面数据清空
                 this.selectModelVal = ''
-                this.showFlag=this.checkList[0]
+                this.showFlag = this.checkList[0]
                 // 删除数组中第一个元素
                 this.checkList.shift()
-              }else{
+              } else {
                 this.$message.error(response.msg)
               }
             })
@@ -455,7 +456,7 @@ export default {
       }
     },
     // 地面诊断模型执行
-    groundDiagnosisBegin(){
+    groundDiagnosisBegin() {
       this.dialogSelectModel = false
       this.title = '地面诊断模型执行中'
       this.dialogProgress = true
@@ -476,19 +477,19 @@ export default {
             clearInterval(this.timer)
             this.timer = null
             beginModel(data).then(response => {
-              if(response.code===200){
-                this.$message.success("执行成功")
+              if (response.code === 200) {
+                this.$message.success('执行成功')
                 this.groundDiagnosisResultText = response.data
-                this.percentageVal=50
+                this.percentageVal = 50
                 this.dialogProgress = false
                 this.dialogResult = true
                 this.title = '地面诊断结果'
-                this.showFlag=this.checkList[0]
+                this.showFlag = this.checkList[0]
                 // 选择模型页面数据清空
                 this.selectModelVal = ''
                 // 删除数组中第一个元素
                 this.checkList.shift()
-              }else{
+              } else {
                 this.$message.error(response.msg)
               }
             })
@@ -497,7 +498,7 @@ export default {
       }
     },
     // 深度隔离模型执行
-    deepIsolationBegin(){
+    deepIsolationBegin() {
       this.dialogSelectModel = false
       this.title = '深度隔离模型执行中'
       this.dialogProgress = true
@@ -518,19 +519,19 @@ export default {
             clearInterval(this.timer)
             this.timer = null
             beginModel(data).then(response => {
-              if(response.code===200){
-                this.$message.success("执行成功")
+              if (response.code === 200) {
+                this.$message.success('执行成功')
                 this.deepIsolationResultText = response.data
-                this.percentageVal=50
+                this.percentageVal = 50
                 this.dialogProgress = false
                 this.dialogResult = true
                 this.title = '深度隔离结果'
-                this.showFlag=this.checkList[0]
+                this.showFlag = this.checkList[0]
                 // 选择模型页面数据清空
                 this.selectModelVal = ''
                 // 删除数组中第一个元素
                 this.checkList.shift()
-              }else{
+              } else {
                 this.$message.error(response.msg)
               }
             })
@@ -539,18 +540,18 @@ export default {
       }
     },
     next() {
-      if(this.FABtnText === '完成'){
+      if (this.FABtnText === '完成') {
         this.dialogResult = false
         this.cancelSelectModel()
         this.FABtnText = '下一步'
-      }else{
+      } else {
         this.submitForm()
       }
     },
     // 上报
-    reportHandel(){
-      console.log("上报");
-    }
+    reportHandel() {
+      console.log('上报')
+    },
   },
 }
 </script>

+ 41 - 0
PHM-web/src/views/manage/preHandleResult/delAbnormalResult.vue

@@ -0,0 +1,41 @@
+<template>
+  <div>
+    <el-table :data="resultList" style="width: 100%">
+      <el-table-column v-for="(item,index) in keyList" :key="index" align="center" :label="item" :prop="item">
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'delAbnormalResult',
+  props: ['resultList'],
+  data() {
+    return {
+      keyList: [],
+    }
+  },
+  created() {
+    this.init()
+  },
+  methods: {
+    init() {
+      this.keyList = Object.keys(this.resultList[0])
+    },
+    cellClassName(data) {
+      const { columnIndex, rowIndex } = data
+      // console.log(rowIndex,columnIndex);
+      if (!this.resultList[rowIndex][columnIndex]) {
+        return 'red-background'
+      }
+    },
+  },
+}
+</script>
+
+<style scoped>
+::v-deep .el-table__row .red-background {
+  background-color: red;
+}
+</style>

+ 76 - 31
PHM-web/src/views/manage/preHandleResult/index.vue

@@ -77,25 +77,36 @@
               </el-table-column>
             </el-table>
           </el-form-item>
-          <el-form-item label="模型选择">
-            <!-- <el-input v-model="form.sortieNumber" placeholder="请输入架次号" disabled/> -->
-            <el-select v-model="selectModelVal" placeholder="请选择模型" @change="modelSelectHandel">
-              <el-option v-for="item in modelOptions" :key="item.id" :label="item.name" :value="item">
-              </el-option>
-            </el-select>
-          </el-form-item>
-          <el-form-item label="参数选择" v-if="!(selectModelVal==='')">
-            <el-transfer v-model="selectSortieParams" :props="{ key: 'value', label: 'desc' }" :data="parameterList"
-              filterable filter-placeholder="请输入参数名称" :titles="['所有参数', '展示参数']">
-            </el-transfer>
-          </el-form-item>
         </el-form>
       </div>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm" :disabled="selectModelVal===''">确 定</el-button>
+        <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+    <!-- 选择模型 -->
+    <el-dialog :title="title" :visible.sync="dialogSelectModel" width="800" :close-on-click-modal="false"
+      append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="模型选择">
+          <!-- <el-input v-model="form.sortieNumber" placeholder="请输入架次号" disabled/> -->
+          <el-select v-model="selectModelVal" placeholder="请选择模型" @change="modelSelectHandel">
+            <el-option v-for="item in modelOptions" :key="item.id" :label="item.name" :value="item">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="参数选择" v-if="!(selectModelVal==='')">
+          <el-transfer v-model="selectSortieParams" :props="{ key: 'value', label: 'desc' }" :data="parameterList"
+            filterable filter-placeholder="请输入参数名称" :titles="['所有参数', '处理参数']">
+          </el-transfer>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="back">返回</el-button>
+        <el-button type="primary" :disabled="selectModelVal===''" @click="begin">开始执行</el-button>
+        <el-button @click="cancelSelectModel">取 消</el-button>
+      </div>
+    </el-dialog>
 
     <!-- 进度条 -->
     <el-dialog :title="title" :visible.sync="dialogProgress" class="progress" width="800" :close-on-click-modal="false"
@@ -103,9 +114,12 @@
       <el-progress :text-inside="true" :stroke-width="24" :percentage="percentageVal" status="success"></el-progress>
     </el-dialog>
     <el-dialog :title="title" :visible.sync="dialogResult" width="800" :close-on-click-modal="false" append-to-body>
-      结果
+      <div style="max-height: 380px; overflow-y: auto; overflow-x: hidden;">
+        <delAbnormalResult v-if="showFlag=='1'" :resultList='delAbnormalResultList' />
+        <missValCompletionResult v-if="showFlag=='2'" :resultList='missValCompletionResultList' />
+      </div>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="cancel">完成</el-button>
+        <el-button type="primary" @click="next">{{ FABtnText }}</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -121,17 +135,29 @@ import {
   updatePreHandleResult,
 } from '@/api/manage/preHandleResult'
 import { listAnalyzeResult } from '@/api/manage/analyzeResult'
-import { listSortie, getSortie, getSortieParams } from '@/api/manage/sortie'
+import {
+  listSortie,
+  getSortie,
+  getSortieParams,
+  getSortieDataName,
+  getSortieDataByName,
+} from '@/api/manage/sortie'
 import {
   beginModel,
   listSortieParameterAll,
   modelList,
   modelListAll,
 } from '@/api/manage/data'
+import delAbnormalResult from '@/views/manage/preHandleResult/delAbnormalResult'
+import missValCompletionResult from '@/views/manage/preHandleResult/missValCompletionResult'
 
 export default {
   name: 'PreHandleResult',
   dicts: ['data_type'],
+  components: {
+    delAbnormalResult,
+    missValCompletionResult,
+  },
   data() {
     return {
       // 按钮加载
@@ -177,10 +203,13 @@ export default {
       form: {},
       rules: {},
       checkList: ['1', '2'],
+      dialogSelectModel: false,
       // 进度条是否显示弹出框
       dialogProgress: false,
       percentageVal: 50,
       timer: null,
+      // 获取数据的参数数值
+      parameterData: [],
       // 结果弹出框
       dialogResult: false,
       modelOptions: [],
@@ -193,7 +222,9 @@ export default {
       modelId: null,
       batchNo: '',
       showFlag: '',
-      faultPredictionResult: [],
+      delAbnormalResultList: [],
+      missValCompletionResultList: [],
+      FABtnText: '下一步',
     }
   },
   created() {
@@ -223,7 +254,8 @@ export default {
     cancel() {
       this.open = false
       this.reset()
-      ;(this.checkList = ['1', '2']), (this.selectedSortieDataType = '')
+      this.checkList = ['1', '2']
+      this.selectedSortieDataType = ''
       this.batchNo = ''
     },
     cancelSelectModel() {
@@ -259,17 +291,23 @@ export default {
       this.multiple = !selection.length
       this.currentSelection = selection
     },
-    handle(row) {
-      console.log('故障诊断', row)
+    async handle(row) {
+      console.log('数据处理', row)
+      let res = await getSortieDataName(row.sortieNumber)
+      if (!res.data) {
+        return
+      }
       this.reset()
       const id = row.id
       getSortie(id).then(response => {
         this.form = response.data
         this.open = true
-        this.title = '故障诊断信息'
+        this.title = '数据处理'
       })
       listSortieParameterAll({ sortieNo: row.sortieNumber }).then(response => {
-        this.sortieParameterAllList = response.data
+        this.sortieParameterAllList = response.data.filter(item => {
+          return item.type === 0
+        })
         this.loading = false
       })
     },
@@ -288,7 +326,6 @@ export default {
         this.dialogSelectModel = true
         if (this.checkList[0] === 1) {
           this.title = '请选择异常值剔除模型'
-          // this.FABtnText = '完成'
         } else {
           this.title = '请选择缺失值补全模型'
         }
@@ -321,20 +358,27 @@ export default {
     back() {
       this.dialogSelectModel = false
       this.open = true
-      this.title = '故障诊断信息'
+      this.title = '数据处理'
       this.selectModelVal = ''
       this.parameterList = []
       this.selectSortieParams = []
+      this.checkList = ['1', '2']
     },
     begin() {
       this.dialogResult = false
       this.checkList = this.checkList.map(str => parseInt(str, 10))
-      if (this.checkList[0] === 3) {
-        this.falseAlarmBegin()
-      } else if (this.checkList[0] === 4) {
-        this.groundDiagnosisBegin()
+      const data1 = {
+        sortieNo: this.form.sortieNumber,
+        parameters: this.selectSortieParams,
+      }
+      getSortieDataByName(data1).then(response => {
+        this.parameterData = JSON.parse(response.data)
+        console.log('this.parameterData', this.parameterData)
+      })
+      if (this.checkList[0] === 1) {
+        this.delAbnormalBegin()
       } else {
-        this.deepIsolationBegin()
+        this.missValCompletion()
       }
     },
     delAbnormalBegin() {
@@ -359,7 +403,8 @@ export default {
             beginModel(data).then(response => {
               if (response.code === 200) {
                 this.$message.success('执行成功')
-                this.groundDiagnosisResultText = response.data
+                this.delAbnormalResultList = JSON.parse(response.data)
+                console.log(this.delAbnormalResultList)
                 this.percentageVal = 50
                 this.dialogProgress = false
                 this.dialogResult = true
@@ -397,7 +442,7 @@ export default {
             beginModel(data).then(response => {
               if (response.code === 200) {
                 this.$message.success('执行成功')
-                this.groundDiagnosisResultText = response.data
+                this.missValCompletionResultList = JSON.parse(response.data)
                 this.percentageVal = 50
                 this.dialogProgress = false
                 this.dialogResult = true

+ 42 - 0
PHM-web/src/views/manage/preHandleResult/missValCompletionResult.vue

@@ -0,0 +1,42 @@
+<template>
+  <div>
+    <!--  :cell-class-name="cellClassName" -->
+    <el-table :data="resultList" style="width: 100%">
+      <el-table-column v-for="(item,index) in keyList" :key="index" align="center" :label="item" :prop="item">
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'missValCompletionResult',
+  props: ['resultList'],
+  data() {
+    return {
+      keyList: [],
+    }
+  },
+  created() {
+    this.init()
+  },
+  methods: {
+    init() {
+      this.keyList = Object.keys(this.resultList[0])
+    },
+    cellClassName(data) {
+      const { columnIndex, rowIndex } = data
+      // console.log(rowIndex,columnIndex);
+      if (!this.resultList[rowIndex][columnIndex]) {
+        return 'red-background'
+      }
+    },
+  },
+}
+</script>
+
+<style scoped>
+::v-deep .el-table__row .red-background {
+  background-color: red;
+}
+</style>