Преглед изворни кода

故障预测、故障诊断等

Rmengdi пре 1 година
родитељ
комит
79a4694cd2

+ 14 - 14
PHM-web/src/views/manage/aircraft/index.vue

@@ -1,11 +1,11 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="名称" prop="name">
-        <el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter.native="handleQuery" />
+      <el-form-item label="机型" prop="airModel">
+        <el-input v-model="queryParams.airModel" placeholder="请输入机型" clearable @keyup.enter.native="handleQuery" />
       </el-form-item>
-      <el-form-item label="机号" prop="number">
-        <el-input v-model="queryParams.number" placeholder="请输入机号" clearable @keyup.enter.native="handleQuery" />
+      <el-form-item label="机号" prop="airNumber">
+        <el-input v-model="queryParams.airNumber" placeholder="请输入机号" clearable @keyup.enter.native="handleQuery" />
       </el-form-item>
       <el-form-item label="归属机队" prop="fleetId">
         <el-input v-model="queryParams.fleetId" placeholder="请输入归属机队" clearable @keyup.enter.native="handleQuery" />
@@ -38,8 +38,8 @@
 
     <el-table v-loading="loading" border :data="aircraftList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="名称" align="center" prop="name" />
-      <el-table-column label="机号" align="center" prop="number" />
+      <el-table-column label="机型" align="center" prop="airModel" />
+      <el-table-column label="机号" align="center" prop="airNumber" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
@@ -56,11 +56,11 @@
     <!-- 添加或修改单机信息对话框 -->
     <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="100px">
-        <el-form-item label="名称" prop="name">
-          <el-input v-model="form.name" placeholder="请输入名称" />
+        <el-form-item label="机型" prop="airModel">
+          <el-input v-model="form.airModel" placeholder="请输入机型" />
         </el-form-item>
-        <el-form-item label="机号" prop="number">
-          <el-input v-model="form.number" placeholder="请输入机号" />
+        <el-form-item label="机号" prop="airNumber">
+          <el-input v-model="form.airNumber" placeholder="请输入机号" />
         </el-form-item>
         <el-form-item label="归属机队" prop="fleetId">
           <el-select v-model="form.fleetId" placeholder="请选择机队信息" style="width:100%">
@@ -126,8 +126,8 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        name: null,
-        number: null,
+        airModel: null,
+        airNumber: null,
         fleetId: null,
       },
       // 表单参数
@@ -174,8 +174,8 @@ export default {
     reset() {
       this.form = {
         id: null,
-        name: null,
-        number: null,
+        airModel: null,
+        airNumber: null,
         fleetId: null,
         isDelete: null,
         createBy: null,

+ 15 - 0
PHM-web/src/views/manage/faultDiagnosis/deepIsolationResult.vue

@@ -0,0 +1,15 @@
+<template>
+  <div>
+    深度隔离结果
+  </div>
+</template>
+
+<script>
+  export default {
+    name:'deepIsolationResult'
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 1
PHM-web/src/views/manage/faultDiagnosis/falseAlarmResult.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    123
+    虚警抑制结果
     <!-- <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>

+ 15 - 0
PHM-web/src/views/manage/faultDiagnosis/groundDiagnosisResult.vue

@@ -0,0 +1,15 @@
+<template>
+  <div>
+    地面诊断结果
+  </div>
+</template>
+
+<script>
+  export default {
+    name:'groundDiagnosisResult'
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 193 - 54
PHM-web/src/views/manage/faultDiagnosis/index.vue

@@ -46,10 +46,11 @@
     <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="800px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="100px">
         <el-form-item label="诊断类型">
-          <el-radio v-model="radio" label="0">全选</el-radio>
-          <el-radio v-model="radio" label="3">虚警抑制</el-radio>
-          <el-radio v-model="radio" label="4">深度隔离</el-radio>
-          <el-radio v-model="radio" label="5">地面诊断</el-radio>
+          <el-checkbox-group v-model="checkList" :min="1">
+            <el-checkbox label="3">虚警抑制</el-checkbox>
+            <el-checkbox label="5">深度隔离</el-checkbox>
+            <el-checkbox label="4">地面诊断</el-checkbox>
+          </el-checkbox-group>
         </el-form-item>
         <el-row :gutter="20">
           <el-col :span="10">
@@ -107,13 +108,8 @@
           </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 v-model="selectSortieParams" :props="{ key: 'value', label: 'desc' }" :data="parameterList"
+            filterable filter-placeholder="请输入参数名称" :titles="['所有参数', '展示参数']">
           </el-transfer>
         </el-form-item>
       </el-form>
@@ -124,10 +120,14 @@
       </div>
     </el-dialog>
     <!-- 虚警抑制清单 -->
-    <el-dialog :title="title" :visible.sync="dialogFalseAlarmResult" width="800" :close-on-click-modal="false" append-to-body>
-      <falseAlarmResult />
+    <el-dialog :title="title" :visible.sync="dialogResult" width="800" :close-on-click-modal="false"
+      append-to-body>
+      <falseAlarmResult v-if="showFlag=='3'"/>
+      <groundDiagnosisResult v-if="showFlag=='4'"/>
+      <deepIsolationResult v-if="showFlag=='5'"/>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="next">下一步</el-button>
+        <el-button type="primary" @click="falseAlarmResultNext">{{ FABtnText }}</el-button>
+        <el-button type="success" @click="reportHandel" v-if="showFlag==('4' && '5')">上报</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -135,7 +135,7 @@
 </template>
 
 <script>
-import { listSortie, getSortie,getSortieParams, } from '@/api/manage/sortie'
+import { listSortie, getSortie, getSortieParams } from '@/api/manage/sortie'
 import {
   beginModel,
   listSortieParameterAll,
@@ -143,10 +143,14 @@ import {
   modelListAll,
 } from '@/api/manage/data'
 import falseAlarmResult from '@/views/manage/faultDiagnosis/falseAlarmResult'
+import groundDiagnosisResult from '@/views/manage/faultDiagnosis/groundDiagnosisResult'
+import deepIsolationResult from '@/views/manage/faultDiagnosis/deepIsolationResult'
 export default {
   name: 'faultDiagnosis',
   components: {
     falseAlarmResult,
+    groundDiagnosisResult,
+    deepIsolationResult
   },
   dicts: ['data_type'],
   data() {
@@ -207,13 +211,14 @@ export default {
       ],
       selectSortieId: '',
       radio: '0',
+      checkList: ['3','4','5'],
       // 进度条是否显示弹出框
       dialogProgress: false,
-      percentageVal: 65,
+      percentageVal: 50,
       timer: null,
       dialogSelectModel: false,
-      // 虚警抑制弹出框
-      dialogFalseAlarmResult: false,
+      // 结果弹出框
+      dialogResult: false,
       modelOptions: [],
       // 步长
       // step: '',
@@ -221,10 +226,23 @@ export default {
       sortieParameterAllList: [],
       selectedSortieDataType: '',
       modelListAll: [],
-      parameterList:[],
-      selectSortieParams:[],
-      modelId:null,
-      batchNo:''
+      parameterList: [],
+      selectSortieParams: [],
+      modelId: null,
+      batchNo: '',
+      // 虚警抑制结果的按钮
+      FABtnText:'下一步',
+      showFlag:''
+    }
+  },
+  watch: {
+    checkList: {
+      handler(newValue, oldValue) {
+        if (newValue.length===0) {
+          this.FABtnText = '完成'
+        }
+      },
+      deep: true,
     }
   },
   created() {
@@ -276,16 +294,17 @@ export default {
     cancel() {
       this.open = false
       this.reset()
-      this.radio=0
+      // this.radio = 0
+      this.checkList=['3','4','5'],
       this.selectedSortieDataType = ''
       this.batchNo = ''
     },
-    cancelSelectModel(){
-      this.dialogSelectModel=false
+    cancelSelectModel() {
+      this.dialogSelectModel = false
       this.cancel()
-      this.selectModelVal=''
-      this.parameterList=[]
-      this.selectSortieParams=[]
+      this.selectModelVal = ''
+      this.parameterList = []
+      this.selectSortieParams = []
     },
     // 表单重置
     reset() {
@@ -297,45 +316,57 @@ export default {
         endTime: null,
         duration: null,
         isDelete: null,
-        step:null
+        step: null,
       }
       this.resetForm('form')
     },
     handleSortieData(value) {
       console.log('value', value)
-      this.selectSortieId=value.id
+      this.selectSortieId = value.id
       this.selectedSortieDataType = value.type
-      this.batchNo=value.batchNo
+      this.batchNo = value.batchNo
     },
     // 确定诊断按钮
     submitForm() {
       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.open = false
+        this.dialogSelectModel = true
+        if (this.checkList[0] === 3) {
+          this.title = '请选择虚警抑制模型'
+          // this.FABtnText = '完成'
+        } else if (this.checkList[0] === 4) {
+          this.title = '请选择地面诊断模型'
+        } else {
+          this.title = '请选择深度隔离模型'
+        }
         const data = {
           pageNum: 1,
           pageSize: 10,
-          type: this.radio,
+          type: this.checkList[0],
         }
         modelListAll(data).then(response => {
           this.modelOptions = response.data
           this.loading = false
         })
-        this.open = false
-        this.dialogSelectModel = true
-        this.title = '请选择虚警抑制模型'
       }
     },
-    modelSelectHandel(val){
+    modelSelectHandel(val) {
+      this.parameterList = []
+      this.selectSortieParams = []
       this.selectModelVal = val.name
       this.selectSortieParams = JSON.parse(val.dataParams)
-      this.modelId=val.id
+      this.modelId = val.id
       getSortieParams(this.selectSortieId).then(response => {
         response.data.forEach(item => {
           this.parameterList.push({
             value: item,
-            desc: item
-          });
+            desc: item,
+          })
         })
       })
     },
@@ -343,39 +374,147 @@ export default {
       this.dialogSelectModel = false
       this.open = true
       this.title = '故障诊断信息'
-      this.selectModelVal=''
-      this.parameterList=[]
-      this.selectSortieParams=[]
+      this.selectModelVal = ''
+      this.parameterList = []
+      this.selectSortieParams = []
     },
     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()
+      } else {
+        this.deepIsolationBegin()
+      }
+    },
+    // 虚警抑制模型执行
+    falseAlarmBegin(){
       this.dialogSelectModel = false
+      this.title = '虚警抑制模型执行中'
       this.dialogProgress = true
-      const data={
-        modelId:this.modelId,
-        sortieNo:this.form.sortieNumber,
+      const data = {
+        modelId: this.modelId,
+        sortieNo: this.form.sortieNumber,
         batchNo: this.batchNo,
-        dataType: this.radio,
-        dataId : this.selectSortieId,
-        dataParams: this.selectSortieParams
+        // dataType: this.radio,
+        dataType: this.checkList[0],
+        dataId: this.selectSortieId,
+        dataParams: this.selectSortieParams,
+      }
+      console.log('data', data)
+      if (!this.timer) {
+        this.timer = setInterval(() => {
+          this.percentageVal += 1
+          if (this.percentageVal == 100) {
+            this.percentageVal=50
+            clearInterval(this.timer)
+            this.timer = null
+            this.dialogProgress = false
+            this.dialogResult = true
+            this.title = '虚警抑制结果'
+            // 选择模型页面数据清空
+            this.selectModelVal = ''
+            this.showFlag=this.checkList[0]
+            // 删除数组中第一个元素
+            this.checkList.shift()
+          }
+        }, 50)
+      }
+    },
+    // 地面诊断模型执行
+    groundDiagnosisBegin(){
+      this.dialogSelectModel = false
+      this.title = '地面诊断模型执行中'
+      this.dialogProgress = true
+      const data = {
+        modelId: this.modelId,
+        sortieNo: this.form.sortieNumber,
+        batchNo: this.batchNo,
+        // dataType: this.radio,
+        dataType: this.checkList[0],
+        dataId: this.selectSortieId,
+        dataParams: this.selectSortieParams,
+      }
+      console.log('data', data)
+      if (!this.timer) {
+        this.timer = setInterval(() => {
+          this.percentageVal += 1
+          if (this.percentageVal == 100) {
+            this.percentageVal=50
+            clearInterval(this.timer)
+            this.timer = null
+            this.dialogProgress = false
+            this.dialogResult = true
+            this.title = '地面诊断结果'
+            this.showFlag=this.checkList[0]
+            // 选择模型页面数据清空
+            this.selectModelVal = ''
+            // 删除数组中第一个元素
+            this.checkList.shift()
+          }
+        }, 50)
       }
-      console.log("data",data);
-      beginModel(data).then(response => {
-        console.log(response);
-      })
     },
-    next() {
+    // 深度隔离模型执行
+    deepIsolationBegin(){
+      this.dialogSelectModel = false
+      this.title = '深度隔离模型执行中'
+      this.dialogProgress = true
+      const data = {
+        modelId: this.modelId,
+        sortieNo: this.form.sortieNumber,
+        batchNo: this.batchNo,
+        // dataType: this.radio,
+        dataType: this.checkList[0],
+        dataId: this.selectSortieId,
+        dataParams: this.selectSortieParams,
+      }
+      console.log('data', data)
+      if (!this.timer) {
+        this.timer = setInterval(() => {
+          this.percentageVal += 1
+          if (this.percentageVal == 100) {
+            this.percentageVal=50
+            clearInterval(this.timer)
+            this.timer = null
+            this.dialogProgress = false
+            this.dialogResult = true
+            this.title = '深度隔离结果'
+            this.showFlag=this.checkList[0]
+            // 选择模型页面数据清空
+            this.selectModelVal = ''
+            // 删除数组中第一个元素
+            this.checkList.shift()
+          }
+        }, 50)
+      }
+    },
+    falseAlarmResultNext() {
+      if(this.FABtnText === '完成'){
+        this.dialogResult = false
+        this.cancelSelectModel()
+        this.FABtnText = '下一步'
+      }else{
+        this.submitForm()
+      }
       // 先选择深度隔离模型
       // this.dialogProgress = true
       // this.title = '深度隔离诊断过程中'
       // this.timer = setInterval(() => {
       //   this.percentageVal=100
       //   this.dialogProgress = false
-      //   this.dialogFalseAlarmResult = true
+      //   this.dialogResult = true
       //   this.title = '深度隔离结果'
       //   clearInterval(this.timer)
       //   this.timer = null
       // },2000)
     },
+    // 上报
+    reportHandel(){
+      console.log("上报");
+    }
   },
 }
 </script>

+ 533 - 0
PHM-web/src/views/manage/faultPrediction/index.vue

@@ -0,0 +1,533 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="机号" prop="aircraftNumber">
+        <el-input v-model="queryParams.aircraftNumber" placeholder="请输入机号" clearable
+          @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item label="架次号" prop="sortieNumber">
+        <el-input v-model="queryParams.sortieNumber" placeholder="请输入架次号" clearable @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table v-loading="loading" border :data="sortieList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="机号" align="center" prop="aircraftNumber" />
+      <el-table-column label="架次号" align="center" prop="sortieNumber" />
+      <el-table-column label="开始时间" align="center" width="180">
+        <template slot-scope="scope">
+          <span>{{
+            parseTime(scope.row.startTime, "{y}-{m}-{d} {h}:{i}:{s}")
+          }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="结束时间" align="center" width="180">
+        <template slot-scope="scope">
+          <span>{{
+            parseTime(scope.row.endTime, "{y}-{m}-{d} {h}:{i}:{s}")
+          }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="飞行时长" align="center" prop="duration" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button type="text" size="mini" @click="handle(scope.row)"
+            v-hasPermi="['manage:faultDiagnosis:edit']">故障诊断</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
+      @pagination="getList" />
+
+    <!-- 故障诊断对话框 -->
+    <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="800px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="诊断类型">
+          <el-checkbox-group v-model="checkList" :min="1">
+            <el-checkbox label="3">虚警抑制</el-checkbox>
+            <el-checkbox label="5">深度隔离</el-checkbox>
+            <el-checkbox label="4">地面诊断</el-checkbox>
+          </el-checkbox-group>
+        </el-form-item>
+        <el-row :gutter="20">
+          <el-col :span="10">
+            <el-form-item label="机号" prop="aircraftNumber">
+              <el-input v-model="form.aircraftNumber" placeholder="请输入机号" disabled />
+            </el-form-item>
+          </el-col>
+          <el-col :span="10">
+            <el-form-item label="步长" prop="step">
+              <el-select v-model="form.step" placeholder="请选择步长">
+                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="10">
+            <el-form-item label="架次号" prop="sortieNumber">
+              <el-input v-model="form.sortieNumber" placeholder="请输入架次号" disabled />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item label="架次数据:" class="clearMargin" />
+        <el-table :data="sortieParameterAllList" style="width: 93%;margin-left:30px" highlight-current-row
+          @current-change="handleSortieData" max-height="250">
+          <el-table-column prop="sortieNo" label="架次号" align="center" />
+          <el-table-column prop="batchNo" label="批次号" align="center" />
+          <el-table-column prop="type" label="数据类型" align="center">
+            <template slot-scope="scope">
+              <dict-tag :options="dict.type.data_type" :value="scope.row.type" />
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!-- 进度条 -->
+    <el-dialog :title="title" :visible.sync="dialogProgress" class="progress" width="800" :close-on-click-modal="false"
+      append-to-body>
+      <el-progress :text-inside="true" :stroke-width="24" :percentage="percentageVal" status="success"></el-progress>
+    </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="dialogResult" width="800" :close-on-click-modal="false"
+      append-to-body>
+      <falseAlarmResult v-if="showFlag=='3'"/>
+      <groundDiagnosisResult v-if="showFlag=='4'"/>
+      <deepIsolationResult v-if="showFlag=='5'"/>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="falseAlarmResultNext">{{ FABtnText }}</el-button>
+        <el-button type="success" @click="reportHandel" v-if="showFlag==('4' && '5')">上报</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listSortie, getSortie, getSortieParams } from '@/api/manage/sortie'
+import {
+  beginModel,
+  listSortieParameterAll,
+  modelList,
+  modelListAll,
+} from '@/api/manage/data'
+import falseAlarmResult from '@/views/manage/faultDiagnosis/falseAlarmResult'
+import groundDiagnosisResult from '@/views/manage/faultDiagnosis/groundDiagnosisResult'
+import deepIsolationResult from '@/views/manage/faultDiagnosis/deepIsolationResult'
+export default {
+  name: 'faultDiagnosis',
+  components: {
+    falseAlarmResult,
+    groundDiagnosisResult,
+    deepIsolationResult
+  },
+  dicts: ['data_type'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      //选中的架次号
+      sortieIds: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 架次信息表格数据
+      sortieList: [],
+      // 弹出层标题
+      title: '',
+      // 是否显示弹出层
+      open: false,
+      startTime: '',
+      endTime: '',
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        aircraftNumber: null,
+        sortieNumber: null,
+        startTime: '',
+        endTime: '',
+        duration: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {},
+      options: [
+        {
+          value: '1',
+          label: '1帧/秒',
+        },
+        {
+          value: '2',
+          label: '2帧/秒',
+        },
+        {
+          value: '5',
+          label: '5帧/秒',
+        },
+        {
+          value: '10',
+          label: '10帧/秒',
+        },
+      ],
+      selectSortieId: '',
+      radio: '0',
+      checkList: ['3','4','5'],
+      // 进度条是否显示弹出框
+      dialogProgress: false,
+      percentageVal: 50,
+      timer: null,
+      dialogSelectModel: false,
+      // 结果弹出框
+      dialogResult: false,
+      modelOptions: [],
+      // 步长
+      // step: '',
+      selectModelVal: '',
+      sortieParameterAllList: [],
+      selectedSortieDataType: '',
+      modelListAll: [],
+      parameterList: [],
+      selectSortieParams: [],
+      modelId: null,
+      batchNo: '',
+      // 虚警抑制结果的按钮
+      FABtnText:'下一步',
+      showFlag:''
+    }
+  },
+  watch: {
+    checkList: {
+      handler(newValue, oldValue) {
+        if (newValue.length===0) {
+          this.FABtnText = '完成'
+        }
+      },
+      deep: true,
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    /** 查询架次信息列表 */
+    getList() {
+      this.loading = true
+      listSortie(this.queryParams).then(response => {
+        this.sortieList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1
+      this.getList()
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm('queryForm')
+      this.handleQuery()
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.sortieIds = selection.map(item => item.sortieNumber)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 故障诊断操作 */
+    handle(row) {
+      console.log('故障诊断', row)
+      this.reset()
+      const id = row.id
+      getSortie(id).then(response => {
+        this.form = response.data
+        this.open = true
+        this.title = '故障诊断信息'
+      })
+      listSortieParameterAll({ sortieNo: row.sortieNumber }).then(response => {
+        this.sortieParameterAllList = response.data
+        this.loading = false
+      })
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false
+      this.reset()
+      // this.radio = 0
+      this.checkList=['3','4','5'],
+      this.selectedSortieDataType = ''
+      this.batchNo = ''
+    },
+    cancelSelectModel() {
+      this.dialogSelectModel = false
+      this.cancel()
+      this.selectModelVal = ''
+      this.parameterList = []
+      this.selectSortieParams = []
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        aircraftNumber: null,
+        sortieNumber: null,
+        startTime: null,
+        endTime: null,
+        duration: null,
+        isDelete: null,
+        step: null,
+      }
+      this.resetForm('form')
+    },
+    handleSortieData(value) {
+      console.log('value', value)
+      this.selectSortieId = value.id
+      this.selectedSortieDataType = value.type
+      this.batchNo = value.batchNo
+    },
+    // 确定诊断按钮
+    submitForm() {
+      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.open = false
+        this.dialogSelectModel = true
+        if (this.checkList[0] === 3) {
+          this.title = '请选择虚警抑制模型'
+          // this.FABtnText = '完成'
+        } else if (this.checkList[0] === 4) {
+          this.title = '请选择地面诊断模型'
+        } else {
+          this.title = '请选择深度隔离模型'
+        }
+        const data = {
+          pageNum: 1,
+          pageSize: 10,
+          type: this.checkList[0],
+        }
+        modelListAll(data).then(response => {
+          this.modelOptions = response.data
+          this.loading = false
+        })
+      }
+    },
+    modelSelectHandel(val) {
+      this.parameterList = []
+      this.selectSortieParams = []
+      this.selectModelVal = val.name
+      this.selectSortieParams = JSON.parse(val.dataParams)
+      this.modelId = val.id
+      getSortieParams(this.selectSortieId).then(response => {
+        response.data.forEach(item => {
+          this.parameterList.push({
+            value: item,
+            desc: item,
+          })
+        })
+      })
+    },
+    back() {
+      this.dialogSelectModel = false
+      this.open = true
+      this.title = '故障诊断信息'
+      this.selectModelVal = ''
+      this.parameterList = []
+      this.selectSortieParams = []
+    },
+    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()
+      } else {
+        this.deepIsolationBegin()
+      }
+    },
+    // 虚警抑制模型执行
+    falseAlarmBegin(){
+      this.dialogSelectModel = false
+      this.title = '虚警抑制模型执行中'
+      this.dialogProgress = true
+      const data = {
+        modelId: this.modelId,
+        sortieNo: this.form.sortieNumber,
+        batchNo: this.batchNo,
+        // dataType: this.radio,
+        dataType: this.checkList[0],
+        dataId: this.selectSortieId,
+        dataParams: this.selectSortieParams,
+      }
+      console.log('data', data)
+      if (!this.timer) {
+        this.timer = setInterval(() => {
+          this.percentageVal += 1
+          if (this.percentageVal == 100) {
+            this.percentageVal=50
+            clearInterval(this.timer)
+            this.timer = null
+            this.dialogProgress = false
+            this.dialogResult = true
+            this.title = '虚警抑制结果'
+            // 选择模型页面数据清空
+            this.selectModelVal = ''
+            this.showFlag=this.checkList[0]
+            // 删除数组中第一个元素
+            this.checkList.shift()
+          }
+        }, 50)
+      }
+    },
+    // 地面诊断模型执行
+    groundDiagnosisBegin(){
+      this.dialogSelectModel = false
+      this.title = '地面诊断模型执行中'
+      this.dialogProgress = true
+      const data = {
+        modelId: this.modelId,
+        sortieNo: this.form.sortieNumber,
+        batchNo: this.batchNo,
+        // dataType: this.radio,
+        dataType: this.checkList[0],
+        dataId: this.selectSortieId,
+        dataParams: this.selectSortieParams,
+      }
+      console.log('data', data)
+      if (!this.timer) {
+        this.timer = setInterval(() => {
+          this.percentageVal += 1
+          if (this.percentageVal == 100) {
+            this.percentageVal=50
+            clearInterval(this.timer)
+            this.timer = null
+            this.dialogProgress = false
+            this.dialogResult = true
+            this.title = '地面诊断结果'
+            this.showFlag=this.checkList[0]
+            // 选择模型页面数据清空
+            this.selectModelVal = ''
+            // 删除数组中第一个元素
+            this.checkList.shift()
+          }
+        }, 50)
+      }
+    },
+    // 深度隔离模型执行
+    deepIsolationBegin(){
+      this.dialogSelectModel = false
+      this.title = '深度隔离模型执行中'
+      this.dialogProgress = true
+      const data = {
+        modelId: this.modelId,
+        sortieNo: this.form.sortieNumber,
+        batchNo: this.batchNo,
+        // dataType: this.radio,
+        dataType: this.checkList[0],
+        dataId: this.selectSortieId,
+        dataParams: this.selectSortieParams,
+      }
+      console.log('data', data)
+      if (!this.timer) {
+        this.timer = setInterval(() => {
+          this.percentageVal += 1
+          if (this.percentageVal == 100) {
+            this.percentageVal=50
+            clearInterval(this.timer)
+            this.timer = null
+            this.dialogProgress = false
+            this.dialogResult = true
+            this.title = '深度隔离结果'
+            this.showFlag=this.checkList[0]
+            // 选择模型页面数据清空
+            this.selectModelVal = ''
+            // 删除数组中第一个元素
+            this.checkList.shift()
+          }
+        }, 50)
+      }
+    },
+    falseAlarmResultNext() {
+      if(this.FABtnText === '完成'){
+        this.dialogResult = false
+        this.cancelSelectModel()
+        this.FABtnText = '下一步'
+      }else{
+        this.submitForm()
+      }
+      // 先选择深度隔离模型
+      // this.dialogProgress = true
+      // this.title = '深度隔离诊断过程中'
+      // this.timer = setInterval(() => {
+      //   this.percentageVal=100
+      //   this.dialogProgress = false
+      //   this.dialogResult = true
+      //   this.title = '深度隔离结果'
+      //   clearInterval(this.timer)
+      //   this.timer = null
+      // },2000)
+    },
+    // 上报
+    reportHandel(){
+      console.log("上报");
+    }
+  },
+}
+</script>
+
+<style scoped>
+.progress {
+  top: 35%;
+}
+::v-deep .clearMargin {
+  margin-bottom: 0;
+}
+.back {
+  margin-left: -100px;
+  margin-top: -25px;
+}
+</style>

+ 103 - 1
PHM-web/src/views/manage/product/index.vue

@@ -18,6 +18,14 @@
         <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
           v-hasPermi="['manage:product:add']">新增</el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
+          v-hasPermi="['manage:product:export']">导出</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleImport"
+          v-hasPermi="['manage:product:import']">导入</el-button>
+      </el-col>
       <el-col :span="1.5">
         <el-button type="info" plain icon="el-icon-sort" size="mini" @click="toggleExpandAll">展开/折叠</el-button>
       </el-col>
@@ -65,10 +73,34 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 产品树导入对话框 -->
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip text-center" slot="tip">
+          <div class="el-upload__tip" slot="tip">
+            <el-checkbox v-model="upload.updateSupport" />
+            是否更新已经存在的产品树数据
+          </div>
+          <span>仅允许导入xls、xlsx格式文件。</span>
+          <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
+            @click="importTemplate">下载模板</el-link>
+        </div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
+import { getToken } from '@/utils/auth'
 import {
   listProduct,
   getProduct,
@@ -124,6 +156,19 @@ export default {
           { required: true, message: '归属不能为空', trigger: 'blur' },
         ],
       },
+      upload: {
+        title: '',
+        // 是否显示弹出层
+        open: false,
+        // 是否禁用上传
+        isUploading: false,
+        // 设置上传的请求头部
+        headers: { Authorization: 'Bearer ' + getToken() },
+        // 是否更新已存在数据
+        updateSupport: 0,
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + '/manage/product/import',
+      },
     }
   },
   created() {
@@ -220,7 +265,6 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset()
-      debugger
       if (row.parentId == 0) {
         this.form.aircraftId = row.aircraftId
         this.form.name = row.name
@@ -275,6 +319,64 @@ export default {
         })
         .catch(() => {})
     },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download(
+        'manage/product/export',
+        {
+          ...this.queryParams,
+        },
+        `product_${new Date().getTime()}.xlsx`
+      )
+    },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = '产品树导入'
+      this.upload.open = true
+    },
+    submitFileForm() {
+      this.$refs.upload.submit()
+    },
+    uploadClose() {
+      // 关闭弹窗
+      this.upload.open = false
+      // 重置上传状态和文件
+      this.upload.isUploading = false
+      this.$refs.upload.clearFiles()
+      // 重置表单
+      this.upload.form = {}
+      // this.resetForm("uploadForm");
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      if (response.code !== 200) {
+        this.$modal.msgError(response.msg)
+        return
+      }
+      this.upload.open = false
+      this.upload.isUploading = false
+      this.$refs.upload.clearFiles()
+      this.$alert(
+        "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
+          response.msg +
+          '</div>',
+        '导入结果',
+        { dangerouslyUseHTMLString: true }
+      )
+      this.getList()
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      this.download(
+        '/manage/product/importTemplate',
+        {},
+        `product_template_${new Date().getTime()}.xlsx`
+      )
+    },
   },
 }
 </script>