Bläddra i källkod

飞参数据、虚警抑制、故障诊断、模型管理、退化评估(部分)页面功能

Rmengdi 6 månader sedan
förälder
incheckning
217261107e

+ 5 - 0
src/api/als/algorithm.js

@@ -29,3 +29,8 @@ export const executeFalseAlarm = async (data) => {
 export const executeFault = async (data) => {
   return await post('/als/algorithm/execute/fault', data)
 }
+
+// 执行退化评估算法
+export const executeEvaluation = async (data) => {
+  return await post('/als/algorithm/execute/evaluation', data)
+}

+ 5 - 0
src/api/als/warning.js

@@ -24,3 +24,8 @@ export const removeWarning = async (id) => {
 export const getAircaftTypeAndModelTree = async (data) => {
   return await get('/basicdata/aircaftCatalog/getAircaftTypeAndModelTree', data)
 }
+
+// 根据hmc码和架次号获取曲线内容
+export const getCurveData = async (hmc, sortieNo) => {
+  return await get(`/als/warning/${hmc}/${sortieNo}`)
+}

+ 1 - 1
src/router/modules/als/qualityManage.js

@@ -63,7 +63,7 @@ export const lifePrediction = {
       path: '/qualityManage/lifePrediction',
       component: () => import('@/views/als/lifePrediction/index.vue'),
       meta: {
-        title: '寿命预测'
+        title: '退化评估'
       },
       sort: 3
     }

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

@@ -7,7 +7,7 @@
     <div class="view-dataSpecies-right" style="width: calc(100% - 460px)">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="currentConfigNodeKey === ''">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 2) || currentConfigNodeKey === ''">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
         </div>
         <div class="view-dataType-title-search">
@@ -502,8 +502,7 @@ export default {
       // this.$refs.table.clearSelection()
       this.currentAirId = this.form.airId = data.id
       this.currentAirModelId = this.form.airModelId = data.parentId
-      // this.currentNode = data
-      // this.form.aircraftType = data.label
+      this.currentNode = data
       // this.getAirInstallAPI(this.currentNodeKey)
       let dataTree = []
       if (data.type === 1) {

+ 211 - 489
src/views/als/falseAlarm/index.vue

@@ -5,104 +5,67 @@
     </div>
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
-        <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 2)">新增</el-button>
-          <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
-        </div>
+        <div class="view-dataType-title-btn"></div>
         <div class="view-dataType-title-search">
           <el-input placeholder="请输入架次号" v-model="keyWordData" class="input1">
-            <el-button slot="append" icon="el-icon-search" @click="searchClick" :disabled="!(currentNode.type == 2)"></el-button>
+            <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
           </el-input>
         </div>
       </div>
       <div class="view-dataType-table">
         <LTable ref="table" @selection-change="selection" :defaultFetch="false" :fetch="fetch" :columns="columns" :dataSource="tableData" :options="options" :pagination="tableRequset"></LTable>
       </div>
-      <!-- 添加或修改虚警抑制对话框 -->
-      <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="1000px" :before-close="handleClose">
-        <el-form ref="executeForm" :model="executeForm" label-width="80px">
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="编目" prop="aircraftId">
-                <el-select v-model="executeForm.aircraftId" placeholder="请选择编目" disabled @change="changeAircraftId(form.aircraftId)">
-                  <el-option v-for="item in aircaftCatalogAll" :key="item.aircaftCatalogId" :label="item.aircaftCatalogCode" :value="item.aircaftCatalogId"> </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="模型类型" prop="modelType">
-                <el-select v-model="executeForm.modelType" placeholder="请选择模型类型" @change="changeModelType(executeForm.modelType)">
-                  <el-option v-for="item in [$enumData.agloModelList[3]]" :key="item.key" :label="item.name" :value="item.key" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="模型" prop="modelId">
-                <el-select v-model="executeForm.modelId" placeholder="请选择模型" @change="changeModelId(executeForm.modelId)">
-                  <el-option v-for="item in modelList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select> </el-form-item
-            ></el-col>
-          </el-row>
-
-          <el-form-item label="架次号" prop="sortieNo">
-            <LTable ref="sortieNoTableRef" @current-change="sortieNoSelection" class="single-select-table" :columns="sortieNoColumns" :dataSource="sortieNoList" :options="sortieNoOptions" :pagination="SortieNoTableRequset"></LTable>
+      <!-- 警告列表对话框 -->
+      <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" :before-close="handleClose" width="1200px">
+        <el-dialog width="80%" title="飞参数据曲线" :visible.sync="innerVisible" :before-close="innerDialogClose" append-to-body>
+          <div style="width: 100%; position: relative; color: #fff">
+            <el-radio-group class="isFalseAlarm" v-model="isFalseAlarm" size="small">
+              <el-radio-button label="0">实警</el-radio-button>
+              <el-radio-button label="1">虚警</el-radio-button>
+            </el-radio-group>
+          </div>
+          <PlayBackChart :chartData="chartData" />
+          <span slot="footer" class="dialog-footer">
+            <el-button @click="innerDialogClose">取 消</el-button>
+            <el-button type="primary" @click="submit">确 定</el-button>
+          </span>
+        </el-dialog>
+        <el-form ref="airForm" :inline="true" :model="airForm" label-width="80px" disabled>
+          <el-form-item label="编目" prop="aircraftId">
+            <el-select v-model="airForm.aircraftId">
+              <el-option v-for="item in aircaftCatalogAll" :key="item.aircaftCatalogId" :label="item.aircaftCatalogCode" :value="item.aircaftCatalogId"> </el-option>
+            </el-select>
           </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="警告名称" 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 label="架次" prop="sortieNo">
+            <el-input v-model="airForm.sortieNo" />
           </el-form-item>
-
-          <el-form-item label="参数" prop="param"> <el-input v-model="executeForm.param" type="textarea" :rows="2" placeholder="请输入参数" /> </el-form-item>
-          <el-form-item label="数据列" prop="columnData">
-            <el-transfer v-model="transferRightData" :data="transferData" @change="changeColumnData"></el-transfer>
+          <el-form-item label="飞行时间" prop="flightDate">
+            <el-input v-model="airForm.flightDate" />
           </el-form-item>
         </el-form>
-        <span slot="footer" class="dialog-footer">
-          <el-button @click="handleClose">取 消</el-button>
-          <el-button type="primary" @click="submit">确 定</el-button>
-        </span>
-      </el-dialog>
-      <el-dialog title="执行进度" :visible.sync="progressVisible" width="800px" :before-close="handleClose">
-        <el-progress :text-inside="true" :stroke-width="24" :percentage="percentage" status="success"></el-progress>
-      </el-dialog>
-      <el-dialog title="结果展示" :visible.sync="resultVisible" width="1200px">
-        <!-- <falseAlarmResult :falseAlarmId="form.id" /> -->
-        <LTable ref="resultTableRef" :columns="resultColumns" :dataSource="resultTableData" :options="resultOptions" :pagination="resultTableRequset"></LTable>
-        <span slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="resultVisible = false">确 定</el-button>
-        </span>
+        <LTable ref="warningTable" @selection-change="selection" :defaultFetch="false" :columns="warningColumns" :dataSource="warningTableData" :options="warningOptions" :pagination="warningTableRequset"></LTable>
       </el-dialog>
     </div>
   </div>
 </template>
 
 <script>
-import { getFalseAlarm, addFalseAlarm, updateFalseAlarm, removeFalseAlarm } from '@/api/als/falseAlarm'
-import { getTaskExecondRegister } from '@/api/carrierStandard/carrierListExecutionRegistration'
-import { getFalseAlarmResult } from '@/api/als/falseAlarmResult'
-import { getColumnDataAPI, executeFalseAlarm } from '@/api/als/algorithm'
+import { getDataImport } from '@/api/als/dataImport'
+import { getCurveData, getWarning, updateWarning } from '@/api/als/warning'
 import { getAircaftCatalogTree } from '@/api/als/sideTree'
 import { getAircaftCatalogAll } from '@/api/als/aircraft'
-import { getDataImport } from '@/api/als/dataImport'
-import { getModel } from '@/api/als/model'
+import PlayBackChart from '@/views/als/components/Charts/playBackChart.vue'
 import { deepClone, debounce } from '@/utils/index'
-import { getWarning } from '@/api/als/warning'
-import { flattenTree } from '../utils/common'
 
 export default {
-  name: 'FalseAlarm',
-  components: {},
+  name: 'DataImport',
+  components: { PlayBackChart },
   data() {
     // 这里存放数据
     return {
       dialogTitle: '新增',
       dialogVisible: false,
-      progressVisible: false,
-      resultVisible: false,
+      innerVisible: false,
       keyWordData: '',
       aircaftModelIdList: [],
       currentNodeKey: '',
@@ -123,18 +86,6 @@ export default {
       },
       searchValue: '',
       columns: [
-        {
-          prop: 'sortieNo',
-          label: '架次号',
-          render: (h, params) => {
-            const matchedItem = this.allTaskExecond.find((item) => params.row.sortieNo.trim() === item.taskId.trim())
-            if (matchedItem) {
-              return h('span', matchedItem.taskName)
-            } else {
-              return h('span', {}, '')
-            }
-          }
-        },
         {
           prop: 'aircraftId',
           label: '编目',
@@ -148,37 +99,21 @@ export default {
           }
         },
         {
-          prop: 'modelType',
-          label: '模型类型',
-          render: (h, params) => {
-            const matchedItem = this.$enumData.agloModelList.find((item) => params.row.modelType === item.key)
-            if (matchedItem) {
-              return h('span', matchedItem.name)
-            } else {
-              return h('span', {}, '')
-            }
-          }
-        },
-        {
-          prop: 'param',
-          label: '参数'
+          prop: 'sortieNo',
+          label: '架次号'
         },
         {
-          prop: 'columnData',
-          label: '数据列'
+          prop: 'flightDate',
+          label: '飞行时间'
         },
-        // {
-        //   prop: 'ossId',
-        //   label: '文件Id'
-        // },
         {
-          prop: 'status',
-          label: '状态',
+          prop: 'source',
+          label: '数据源',
           render: (h, params) => {
-            if (params.row.status == 0) {
-              return h('span', { class: 'warning-state' }, '失败')
+            if (params.row.source == 1) {
+              return h('span', { class: 'success-state' }, '飞参数据')
             } else {
-              return h('span', { class: 'success-state' }, '成功')
+              return h('span', { class: 'success-state' }, 'MDC数据')
             }
           }
         },
@@ -188,192 +123,117 @@ export default {
           width: '240px',
           group: [
             {
-              name: '查看',
-              type: 'text',
-              round: false,
-              plain: false,
-              onClick: (row, index, scope) => {
-                this.checkResultList(row)
-              }
-            },
-            {
-              name: '删除',
+              name: '查看警告列表',
               type: 'text',
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                this.remove([row])
+                this.checkWarningList(row)
               }
             }
           ]
         }
       ],
-      sortieNoColumns: [
-        {
-          prop: 'sortieNo',
-          label: '架次号',
-          render: (h, params) => {
-            const matchedItem = this.allTaskExecond.find((item) => params.row.sortieNo.trim() === item.taskId.trim())
-            if (matchedItem) {
-              return h('span', matchedItem.taskName)
-            } else {
-              return h('span', {}, '')
-            }
-          }
-        },
-        {
-          prop: 'source',
-          label: '数据来源',
-          render: (h, params) => {
-            if (params.row.source == 1) {
-              return h('span', { class: 'success-state' }, '飞参数据')
-            } else {
-              return h('span', { class: 'success-state' }, 'MDC数据')
-            }
-          }
-        },
-        {
-          prop: 'ossId',
-          label: '文件Id'
-        }
-      ],
-      resultColumns: [
-        {
-          prop: 'sortieNo',
-          label: '架次号',
-          render: (h, params) => {
-            const matchedItem = this.allTaskExecond.find((item) => params.row.sortieNo.trim() === item.taskId.trim())
-            if (matchedItem) {
-              return h('span', matchedItem.taskName)
-            } else {
-              return h('span', {}, '')
-            }
-          }
-        },
-        {
-          prop: 'aircraftId',
-          label: '编目',
-          render: (h, params) => {
-            const matchedItem = this.aircaftCatalogAll.find((item) => params.row.aircraftId.trim() === item.aircaftCatalogId.trim())
-            if (matchedItem) {
-              return h('span', matchedItem.aircaftCatalogCode)
-            } else {
-              return h('span', {}, '')
-            }
-          }
-        },
+      options: {
+        stripe: true, // 斑马纹
+        mutiSelect: true, // 多选框
+        index: false, // 显示序号, 多选则 mutiSelect
+        loading: false, // 表格动画
+        initTable: false, // 是否一挂载就加载数据
+        border: true,
+        height: 'calc(100vh - 300px)'
+      },
+      tableCheckItems: [],
+      tableData: [],
+      tableRequset: {
+        total: 0,
+        pageIndex: 1,
+        pageSize: 10,
+        searchValue: ''
+      },
+      warningColumns: [
         {
           prop: 'code',
-          label: '警告代码'
+          label: 'HMC码'
         },
         {
           prop: 'name',
-          label: '警告名称'
+          label: '名称'
         },
         {
           prop: 'describe',
-          label: '警告描述'
+          label: '描述'
         },
         {
           prop: 'status',
-          label: '结果',
+          label: '是否虚警',
           render: (h, params) => {
-            const result = JSON.parse(params.row.status)[0]
-            const isfalseAlarm = result['是否虚警']
-            if (isfalseAlarm == 0) {
-              return h('span', { class: 'warning-state' }, '否')
+            if (params.row.status == '0') {
+              return h('span', { class: 'warning-state' }, '实警')
             } else {
-              return h('span', { class: 'success-state' }, '')
+              return h('span', { class: 'success-state' }, '虚警')
             }
           }
+        },
+        {
+          button: true,
+          label: '操作',
+          width: '240px',
+          group: [
+            {
+              name: '查看',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.checkCurve(row)
+              }
+            }
+          ]
         }
       ],
-      options: {
+      warningOptions: {
         stripe: true, // 斑马纹
         mutiSelect: true, // 多选框
         index: false, // 显示序号, 多选则 mutiSelect
         loading: false, // 表格动画
         initTable: false, // 是否一挂载就加载数据
         border: true,
-        height: 'calc(100vh - 300px)'
-      },
-      sortieNoOptions: {
-        stripe: true, // 斑马纹
-        mutiSelect: false, // 多选框
-        index: true, // 显示序号, 多选则 mutiSelect
-        loading: false, // 表格动画
-        initTable: false, // 是否一挂载就加载数据
-        border: true,
-        height: '250px'
-      },
-      resultOptions: {
-        stripe: true,
-        mutiSelect: false,
-        index: false,
-        loading: false,
-        initTable: false,
-        border: true,
-        height: '300px'
-      },
-      resultTableRequset: {
-        total: 0,
-        pageIndex: 1,
-        pageSize: 10,
-        searchValue: ''
-      },
-      tableCheckItems: [],
-      tableData: [],
-      resultTableData: [],
-      SortieNoTableRequset: {
-        total: 0,
-        pageIndex: 1,
-        pageSize: 10,
-        searchValue: ''
+        height: 'calc(100vh - 600px)'
       },
-      tableRequset: {
+      warningTableCheckItems: [],
+      warningTableData: [],
+      warningTableRequset: {
         total: 0,
         pageIndex: 1,
         pageSize: 10,
         searchValue: ''
       },
-      executeForm: {
-        modelId: '',
-        modelType: '',
-        ossId: '',
-        aircraftId: '',
-        sortieNo: '',
-        param: '',
-        columnData: [],
-        warningIds: []
+      debounceFn: debounce(this.fetch, 500),
+      aircaftCatalogAll: [],
+      chartData: {
+        title: '',
+        legendData: [],
+        xAxisData: [],
+        yAxisData: [],
+        seriesData: []
       },
       form: {
         id: '',
         sortieNo: '',
         aircraftId: '',
-        modelType: '',
-        param: '',
-        columnData: [],
-        ossId: '',
-        status: '',
-        tenantId: '',
-        version: '',
-        delFlag: '',
-        createBy: '',
-        createTime: '',
-        updateBy: '',
-        updateTime: ''
+        code: '',
+        name: '',
+        describe: [],
+        status: ''
       },
-      debounceFn: debounce(this.fetch, 500),
-      aircaftCatalogAll: [],
-      transferData: [],
-      transferRightData: [],
-      algoTypeList: [{ id: 4, name: '虚警抑制' }],
-      modelList: [],
-      percentage: 0,
-      sortieNoList: [],
-      warningIdsList: [],
-      sortieNoTableCheck: [],
-      allTaskExecond: []
+      airForm: {
+        aircraftId: '',
+        sortieNo: '',
+        flightDate: ''
+      },
+      isFalseAlarm: '0',
+      currentSortieNo: ''
     }
   },
   watch: {
@@ -382,6 +242,12 @@ export default {
       this.debounceFn()
     }
   },
+  // computed: {
+  //   falseAlarmText() {
+  //     console.log('this.isFalseAlarm', this.isFalseAlarm)
+  //     return this.isFalseAlarm === '1' ? '实警' : '虚警'
+  //   }
+  // },
   mounted() {
     this.getAircaftCatalogTreeAPI()
   },
@@ -402,28 +268,7 @@ export default {
           this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children)
             .map((e) => e.id)
             .toString()
-          this.getFalseAlarmAPI({ aircraftId: this.aircaftModelIdList })
-        }
-        const res = await getTaskExecondRegister({
-          status: null,
-          queryParam: '',
-          taskId: '',
-          aircaftCatalogId: ''
-        })
-        this.allTaskExecond = flattenTree(res.data)
-      } catch (error) {}
-    },
-
-    async removeFalseAlarmAPI(params) {
-      try {
-        const { code } = await removeFalseAlarm(params)
-        if (code === 200) {
-          this.$message({
-            type: 'success',
-            message: '操作成功!'
-          })
-          await this.getFalseAlarmAPI({ aircraftId: this.aircaftModelIdList })
-          this.handleClose()
+          this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
         }
       } catch (error) {}
     },
@@ -444,280 +289,154 @@ export default {
       return newArr
     },
 
-    async getFalseAlarmAPI(params) {
+    async getDataImportAPI(params) {
       if (this.$refs.table) this.$refs.table.clearSelection()
       const { keyWord } = this
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getFalseAlarm({ pageSize, pageNum: pageIndex, ...params })
+      } = await getDataImport({ pageSize, pageNum: pageIndex, ...params, source: 1 })
       this.tableData = list
       this.tableRequset.total = total
     },
 
-    async getFalseAlarmResultAPI(params) {
-      if (this.$refs.resultTableRef) {
-        this.$refs.resultTableRef.clearSelection()
-        this.resultTableData = []
-      }
-      const { keyWord } = this
-      const { pageSize, pageIndex } = this.resultTableRequset
-      const {
-        data: { list, total }
-      } = await getFalseAlarmResult({ pageSize, pageNum: pageIndex, ...params })
-      this.resultTableData = list
-      this.resultTableRequset.total = total
-    },
-
     fetch() {
-      this.getFalseAlarmAPI({ aircraftId: this.aircaftModelIdList })
+      this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
     },
 
     async searchClick() {
-      this.getFalseAlarmAPI({ aircraftId: this.aircaftModelIdList, sortieNo: this.keyWordData })
-    },
-
-    async addFalseAlarmAPI() {
-      try {
-        delete this.form.aircaftModelName
-        const { code } = await addFalseAlarm({ ...this.form })
-        if (code === 200) {
-          this.$message({
-            type: 'success',
-            message: '操作成功!'
-          })
-          this.getFalseAlarmAPI({ aircraftId: this.aircaftModelIdList })
-        }
-      } catch (error) {}
-    },
-
-    async updateFalseAlarmAPI() {
-      try {
-        const { code } = await updateFalseAlarm({ ...this.form })
-        if (code === 200) {
-          this.$message({
-            type: 'success',
-            message: '操作成功!'
-          })
-          this.handleClose()
-          this.getFalseAlarmAPI({ aircraftId: this.aircaftModelIdList })
-        }
-      } catch (error) {}
+      this.getDataImportAPI({ aircraftId: this.aircaftModelIdList, sortieNo: this.keyWordData })
     },
 
     treeNodeClick(data) {
       this.$refs.table.clearSelection()
-      this.currentNodeKey = this.executeForm.aircraftId = data.id
+      this.currentNodeKey = data.id
       this.currentNode = data
       this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data])
         .map((e) => e.id)
         .toString()
-      this.getFalseAlarmAPI({ aircraftId: this.aircaftModelIdList })
+      if (!this.aircaftModelIdList) {
+        this.aircaftModelIdList = '#'
+      }
+      this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
     },
 
     openDialog() {
-      this.executeForm.aircraftId = this.currentNodeKey
-      if (this.executeForm.aircraftId !== '') {
-        this.changeAircraftId(this.executeForm.aircraftId)
-      }
-      this.dialogTitle = '新增'
+      this.dialogTitle = '警告列表'
       this.dialogVisible = true
     },
 
     handleClose() {
-      this.$refs.sortieNoTableRef.clearSelection()
-      this.$refs.warningTableRef.clearSelection()
-      this.sortieNoList = []
-      this.warningIdsList = []
       this.dialogVisible = false
-      this.transferRightData = []
-      this.executeForm = {
-        modelId: '',
-        modelType: '',
-        ossId: '',
+      this.warningTableData = []
+      this.currentSortieNo = ''
+      this.airForm = {
         aircraftId: '',
         sortieNo: '',
-        param: '',
-        columnData: [],
-        warningIds: []
+        flightDate: ''
       }
     },
 
-    handUpdate(row) {
-      this.dialogTitle = '编辑'
-      this.form = deepClone(row)
-      this.dialogVisible = true
-    },
-    changeColumnData(value) {
-      const data = []
-      this.transferData.forEach((item) => {
-        value.forEach((rightData) => {
-          if (rightData === item.key) {
-            data.push(item.label)
-          }
-        })
-      })
-      this.executeForm.columnData = data
-    },
-    checkResultList(row) {
-      if (row.status === '0') {
-        this.$message({
-          type: 'warning',
-          message: '执行失败,无法查看结果!'
-        })
-        return
+    innerDialogClose() {
+      this.innerVisible = false
+      this.chartData = {
+        title: '',
+        legendData: [],
+        xAxisData: [],
+        yAxisData: [],
+        seriesData: []
       }
-      this.getFalseAlarmResultAPI({ falseAlarmId: row.id })
-      this.resultVisible = true
+      this.isFalseAlarm = false
+    },
+
+    submit() {
+      this.form.status = this.isFalseAlarm
+      this.updateWarningAPI()
     },
-    async beginExecute() {
-      if (this.warningIdsList.length == 0 || this.executeForm.warningIds.length == 0) {
-        this.$message({
-          type: 'warning',
-          message: '该架次未选择警告,无法进行虚警抑制!'
-        })
-        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)
 
+    async updateWarningAPI() {
       try {
-        const res = await executeFalseAlarm(this.executeForm)
-        this.percentage = 100
-        clearInterval(myTimer)
-        if (res?.code === 200) {
+        const { code } = await updateWarning({ ...this.form })
+        if (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: '确定'
+            message: '操作成功!'
           })
+          this.innerDialogClose()
+          this.getWarningAPI({ sortieNo: this.currentSortieNo })
         }
-      } catch (error) {
-        clearInterval(myTimer)
-      } finally {
-        this.progressVisible = false
-        this.percentage = 0
-      }
-    },
-    async changeModelType(type) {
-      try {
-        const {
-          data: { list }
-        } = await getModel({ type })
-        this.modelList = list
       } catch (error) {}
     },
 
-    changeModelId(modelId) {
-      const modelColumnData = JSON.parse(
-        this.modelList.find((item) => {
-          return item.id === modelId
-        }).columnData
-      )
-
-      const labelToKeyMap = this.transferData.reduce((acc, item) => {
-        acc[item.label] = item.key
-        return acc
-      }, {})
-
-      modelColumnData.forEach((item) => {
-        if (labelToKeyMap.hasOwnProperty(item)) {
-          this.executeForm.columnData.push(item)
-          this.transferRightData.push(labelToKeyMap[item])
-        }
-      })
-    },
-
-    async changeAircraftId(aircraftId) {
-      try {
-        const {
-          data: { list, total }
-        } = await getDataImport({ aircraftId })
-        this.sortieNoList = list
-        this.SortieNoTableRequset.total = total
-      } catch (error) {}
+    selection(val) {
+      this.tableCheckItems = val
     },
 
-    async changeSortieNo(sortieNo) {
-      try {
-        const {
-          data: { list }
-        } = await getWarning({ aircraftId: this.executeForm.aircraftId, sortieNo })
-        this.executeForm.sortieNo = sortieNo
-        this.warningIdsList = list
-      } catch (error) {}
+    checkWarningList(row) {
+      this.currentSortieNo = this.airForm.sortieNo = row.sortieNo
+      this.airForm.aircraftId = row.aircraftId
+      this.airForm.flightDate = row.flightDate
+      this.getWarningAPI({ sortieNo: this.currentSortieNo })
+      this.openDialog()
     },
 
-    submit() {
-      switch (this.dialogTitle) {
-        case '编辑':
-          this.updateFalseAlarmAPI()
-          break
-        case '新增':
-          this.beginExecute()
-          break
-      }
+    async getWarningAPI(params) {
+      if (this.$refs.warningTable) this.$refs.warningTable.clearSelection()
+      const { pageSize, pageIndex } = this.warningTableRequset
+      const {
+        data: { list, total }
+      } = await getWarning({ pageSize, pageNum: pageIndex, ...params })
+      this.warningTableData = list
+      this.warningTableRequset.total = total
     },
 
-    selection(val) {
-      this.tableCheckItems = val
+    async checkCurve(row) {
+      this.isFalseAlarm = row.status
+      this.form = deepClone(row)
+      const { data } = await getCurveData(row.code, row.sortieNo)
+      this.getResultData(data)
     },
 
-    async sortieNoSelection(val) {
-      this.executeForm.ossId = val.ossId
-      if (val.ossId) {
-        try {
-          const res = await getColumnDataAPI(val.ossId)
-          if (res.code === 200) {
-            this.transferData = []
-            res.data.forEach((item, index) => {
-              this.transferData.push({
-                key: index,
-                label: item
-              })
-            })
-
-            this.changeSortieNo(val.sortieNo)
-          }
-        } catch (error) {}
+    getResultData(data) {
+      this.chartData = {
+        title: '',
+        legendData: [],
+        xAxisData: [],
+        yAxisData: [],
+        seriesData: []
       }
-    },
-
-    warningSelection(val) {
-      this.executeForm.warningIds = [val.id]
-      if (this.executeForm.modelId) {
-        this.changeModelId(this.executeForm.modelId)
+      // const { contentData, headData } = this.handleResultData(JSON.parse(data))
+      const contentData = JSON.parse(data)
+      const headData = Object.keys(contentData)
+      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.innerVisible = true
     },
 
-    remove(row) {
-      this.$confirm('是否删除该数据', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
+    handleResultData(resultData) {
+      console.log('resultData', resultData)
+      const headData = Object.keys(resultData)
+      const contentData = {}
+      headData.forEach((headItem) => {
+        contentData[headItem] = []
       })
-        .then(() => {
-          this.removeFalseAlarmAPI(row.map((e) => e.id))
-        })
-        .catch(() => {})
+      resultData.forEach((item) => {
+        for (var key in item) {
+          contentData[key].push(item[key])
+        }
+      })
+      return { contentData, headData }
     }
   }
 }
@@ -725,7 +444,10 @@ export default {
 
 <style lang="scss" scoped>
 @import '../index.scss';
-::v-deep .single-select-table thead .el-table-column--selection .cell {
-  display: none;
+.isFalseAlarm {
+  position: absolute;
+  right: 20px;
+  color: #fff;
+  z-index: 9999;
 }
 </style>

+ 153 - 378
src/views/als/faultDiagnosis/index.vue

@@ -5,94 +5,63 @@
     </div>
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
-        <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 2)">新增</el-button>
-          <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
-        </div>
+        <div class="view-dataType-title-btn"></div>
         <div class="view-dataType-title-search">
           <el-input placeholder="请输入架次号" v-model="keyWordData" class="input1">
-            <el-button slot="append" icon="el-icon-search" @click="searchClick" :disabled="!(currentNode.type == 2)"></el-button>
+            <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
           </el-input>
         </div>
       </div>
       <div class="view-dataType-table">
         <LTable ref="table" @selection-change="selection" :defaultFetch="false" :fetch="fetch" :columns="columns" :dataSource="tableData" :options="options" :pagination="tableRequset"></LTable>
       </div>
-      <!-- 添加或修改故障诊断对话框 -->
-      <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="1000px" :before-close="handleClose">
-        <el-form ref="executeForm" :model="executeForm" label-width="80px">
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="编目" prop="aircraftId">
-                <el-select v-model="executeForm.aircraftId" placeholder="请选择编目" @change="changeAircraftId(executeForm.aircraftId)" disabled>
-                  <el-option v-for="item in aircaftCatalogAll" :key="item.aircaftCatalogId" :label="item.aircaftCatalogCode" :value="item.aircaftCatalogId"> </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="模型类型" prop="modelType">
-                <el-select v-model="executeForm.modelType" placeholder="请选择模型类型" @change="changeModelType(executeForm.modelType)">
-                  <el-option v-for="item in algoTypeList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="模型" prop="modelId">
-                <el-select v-model="executeForm.modelId" placeholder="请选择模型" @change="changeModelId(executeForm.modelId)">
-                  <el-option v-for="item in modelList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select> </el-form-item
-            ></el-col>
-          </el-row>
-
-          <el-form-item label="架次号" prop="sortieNo">
-            <LTable ref="sortieNoTableRef" @current-change="sortieNoSelection" class="single-select-table" :columns="sortieNoColumns" :dataSource="sortieNoList" :options="sortieNoOptions" :pagination="SortieNoTableRequset"></LTable>
+      <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" :before-close="handleClose" width="600px">
+        <el-form ref="form" :model="form" label-width="80px">
+          <el-form-item label="编目" prop="aircraftId">
+            <el-select v-model="form.aircraftId" disabled>
+              <el-option v-for="item in aircaftCatalogAll" :key="item.aircaftCatalogId" :label="item.aircaftCatalogCode" :value="item.aircaftCatalogId"> </el-option>
+            </el-select>
           </el-form-item>
-          <el-form-item label="参数" prop="param">
-            <el-input v-model="executeForm.param" type="textarea" :rows="2" placeholder="请输入参数" />
+          <el-form-item label="架次" prop="sortieNo">
+            <el-input v-model="form.sortieNo" disabled />
           </el-form-item>
-          <el-form-item label="数据列" prop="columnData">
-            <el-transfer v-model="transferRightData" :data="transferData" @change="changeColumnData"></el-transfer>
+          <el-form-item label="飞行时间" prop="flightDate">
+            <el-input v-model="form.flightDate" disabled />
           </el-form-item>
-          <!-- <el-form-item label="文件Id" prop="ossId">
-            <el-input v-model="form.ossId" placeholder="请输入文件Id" />
+          <el-form-item label="部件" prop="partId">
+            <treeselect :value="form.partId" :normalizer="normalizer" :options="partsData" :show-count="true" placeholder="请选择部件" @select="partIdSelect" />
           </el-form-item>
-           <el-form-item label="结果">
-           <editor v-model="form.resultContent" :min-height="192" /> 
-          </el-form-item>-->
         </el-form>
         <span slot="footer" class="dialog-footer">
           <el-button @click="handleClose">取 消</el-button>
           <el-button type="primary" @click="submit">确 定</el-button>
         </span>
       </el-dialog>
-      <el-dialog title="执行进度" :visible.sync="progressVisible" width="800px" :before-close="handleClose">
-        <el-progress :text-inside="true" :stroke-width="24" :percentage="percentage" status="success"></el-progress>
+      <el-dialog title="诊断结果" :visible.sync="resultVisible" width="1200px">
+        <LTable ref="resultTable" :defaultFetch="false" :columns="resultColumns" :dataSource="resultTableData" :options="resultOptions" :pagination="resultTableRequset"></LTable>
       </el-dialog>
-      <el-dialog title="结果展示" :visible.sync="resultVisible" width="1200px">
-        <LTable ref="resultTableRef" :columns="resultColumns" :dataSource="resultTableData" :options="resultOptions"></LTable>
-        <span slot="footer" class="dialog-footer">
-          <el-button @click="resultVisible = false">取 消</el-button>
-          <el-button type="primary" @click="resultVisible = false">确 定</el-button>
-        </span>
+      <el-dialog title="执行进度" :visible.sync="progressVisible" width="800px">
+        <el-progress :text-inside="true" :stroke-width="24" :percentage="percentage" status="success"></el-progress>
       </el-dialog>
     </div>
   </div>
 </template>
 
 <script>
-import { getFaultDiagnosis, addFaultDiagnosis, updateFaultDiagnosis, removeFaultDiagnosis } from '@/api/als/faultDiagnosis'
-import { getTaskExecondRegister } from '@/api/carrierStandard/carrierListExecutionRegistration'
-import { getColumnDataAPI, executeFault } from '@/api/als/algorithm'
+import { getDataImport } from '@/api/als/dataImport'
+import { getFaultDiagnosis } from '@/api/als/faultDiagnosis'
 import { getAircaftCatalogTree } from '@/api/als/sideTree'
-import { deepClone, debounce } from '@/utils/index'
 import { getAircaftCatalogAll } from '@/api/als/aircraft'
-import { getDataImport } from '@/api/als/dataImport'
-import { getModel } from '@/api/als/model'
-import { flattenTree } from '../utils/common'
+import { deepClone, debounce } from '@/utils/index'
+import { handleTree } from '../utils/common'
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import { getAirConfiguration } from '@/api/als/airConfiguration'
+import { executeFault } from '@/api/als/algorithm'
 
 export default {
   name: 'FaultDiagnosis',
-  components: {},
+  components: { Treeselect },
   data() {
     // 这里存放数据
     return {
@@ -120,18 +89,6 @@ export default {
       },
       searchValue: '',
       columns: [
-        {
-          prop: 'sortieNo',
-          label: '架次号',
-          render: (h, params) => {
-            const matchedItem = this.allTaskExecond.find((item) => params.row.sortieNo.trim() === item.taskId.trim())
-            if (matchedItem) {
-              return h('span', matchedItem.taskName)
-            } else {
-              return h('span', {}, '')
-            }
-          }
-        },
         {
           prop: 'aircraftId',
           label: '编目',
@@ -145,41 +102,21 @@ export default {
           }
         },
         {
-          prop: 'modelType',
-          label: '模型类型',
-          render: (h, params) => {
-            const matchedItem = this.$enumData.agloModelList.find((item) => params.row.modelType === item.key)
-            if (matchedItem) {
-              return h('span', matchedItem.name)
-            } else {
-              return h('span', {}, '')
-            }
-          }
-        },
-        {
-          prop: 'param',
-          label: '参数'
+          prop: 'sortieNo',
+          label: '架次号'
         },
         {
-          prop: 'columnData',
-          label: '数据列'
+          prop: 'flightDate',
+          label: '飞行时间'
         },
-        // {
-        //   prop: 'ossId',
-        //   label: '文件Id'
-        // },
-        // {
-        //   prop: 'result',
-        //   label: '结果'
-        // },
         {
-          prop: 'status',
-          label: '状态',
+          prop: 'source',
+          label: '数据源',
           render: (h, params) => {
-            if (params.row.status == 0) {
-              return h('span', { class: 'warning-state' }, '失败')
+            if (params.row.source == 1) {
+              return h('span', { class: 'success-state' }, '飞参数据')
             } else {
-              return h('span', { class: 'success-state' }, '成功')
+              return h('span', { class: 'success-state' }, 'MDC数据')
             }
           }
         },
@@ -189,38 +126,47 @@ export default {
           width: '240px',
           group: [
             {
-              name: '查看',
+              name: '故障诊断',
               type: 'text',
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                this.checkResultList(row)
+                this.faultExecute(row)
               }
             },
             {
-              name: '删除',
+              name: '查看结果',
               type: 'text',
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                this.remove([row])
+                this.checkRelustList(row)
               }
             }
           ]
         }
       ],
+      options: {
+        stripe: true, // 斑马纹
+        mutiSelect: true, // 多选框
+        index: false, // 显示序号, 多选则 mutiSelect
+        loading: false, // 表格动画
+        initTable: false, // 是否一挂载就加载数据
+        border: true,
+        height: 'calc(100vh - 300px)'
+      },
+      tableCheckItems: [],
+      tableData: [],
+      tableRequset: {
+        total: 0,
+        pageIndex: 1,
+        pageSize: 10,
+        searchValue: ''
+      },
       resultColumns: [
         {
           prop: 'sortieNo',
-          label: '架次号',
-          render: (h, params) => {
-            const matchedItem = this.allTaskExecond.find((item) => params.row.sortieNo.trim() === item.taskId.trim())
-            if (matchedItem) {
-              return h('span', matchedItem.taskName)
-            } else {
-              return h('span', {}, '')
-            }
-          }
+          label: '架次号'
         },
         {
           prop: 'aircraftId',
@@ -235,10 +181,10 @@ export default {
           }
         },
         {
-          prop: 'modelType',
-          label: '模型类型',
+          prop: 'param',
+          label: '部件',
           render: (h, params) => {
-            const matchedItem = this.$enumData.agloModelList.find((item) => params.row.modelType === item.key)
+            const matchedItem = this.allAirConfig.find((item) => params.row.param === item.id)
             if (matchedItem) {
               return h('span', matchedItem.name)
             } else {
@@ -247,116 +193,53 @@ export default {
           }
         },
         {
-          prop: 'resultContent',
-          label: '结果'
-        }
-      ],
-      sortieNoColumns: [
-        {
-          prop: 'sortieNo',
-          label: '架次号',
-          render: (h, params) => {
-            const matchedItem = this.allTaskExecond.find((item) => params.row.sortieNo.trim() === item.taskId.trim())
-            if (matchedItem) {
-              return h('span', matchedItem.taskName)
-            } else {
-              return h('span', {}, '')
-            }
-          }
-        },
-        {
-          prop: 'source',
-          label: '数据来源',
+          prop: 'status',
+          label: '状态',
           render: (h, params) => {
-            if (params.row.source == 1) {
-              return h('span', { class: 'success-state' }, '飞参数据')
+            if (params.row.status == 0) {
+              return h('span', { class: 'warning-state' }, '失败')
             } else {
-              return h('span', { class: 'success-state' }, 'MDC数据')
+              return h('span', { class: 'success-state' }, '成功')
             }
           }
         },
         {
-          prop: 'ossId',
-          label: '文件Id'
+          prop: 'resultContent',
+          label: '结果'
         }
       ],
-      options: {
+      resultOptions: {
         stripe: true, // 斑马纹
         mutiSelect: true, // 多选框
         index: false, // 显示序号, 多选则 mutiSelect
         loading: false, // 表格动画
         initTable: false, // 是否一挂载就加载数据
         border: true,
-        height: 'calc(100vh - 300px)'
-      },
-      sortieNoOptions: {
-        stripe: true, // 斑马纹
-        mutiSelect: false, // 多选框
-        index: true, // 显示序号, 多选则 mutiSelect
-        loading: false, // 表格动画
-        initTable: false, // 是否一挂载就加载数据
-        border: true,
-        height: '250px'
-      },
-      resultOptions: {
-        stripe: true,
-        mutiSelect: false,
-        index: false,
-        loading: false,
-        initTable: false,
-        border: true,
-        height: '300px'
+        height: 'calc(100vh - 600px)'
       },
-      SortieNoTableRequset: {
-        total: 0,
-        pageIndex: 1,
-        pageSize: 10,
-        searchValue: ''
-      },
-      tableCheckItems: [],
-      tableData: [],
+      resultTableCheckItems: [],
       resultTableData: [],
-      tableRequset: {
+      resultTableRequset: {
         total: 0,
         pageIndex: 1,
         pageSize: 10,
         searchValue: ''
       },
+      debounceFn: debounce(this.fetch, 500),
+      aircaftCatalogAll: [],
       form: {
         id: '',
         sortieNo: '',
-        aircraftId: '',
-        modelType: '',
-        param: '',
-        columnData: [],
         ossId: '',
-        resultContent: '',
-        status: '',
-        tenantId: '',
-        version: '',
-        delFlag: '',
-        createBy: '',
-        createTime: '',
-        updateBy: '',
-        updateTime: ''
-      },
-      debounceFn: debounce(this.fetch, 500),
-      executeForm: {
-        sortieNo: '',
         aircraftId: '',
-        ossId: '',
-        modelId: '',
-        param: '',
-        columnData: []
+        flightDate: '',
+        status: '',
+        partId: null
       },
-      aircaftCatalogAll: [],
-      transferData: [],
-      transferRightData: [],
-      algoTypeList: [{ id: 5, name: '故障诊断' }],
-      modelList: [],
-      percentage: 0,
-      sortieNoList: [],
-      allTaskExecond: []
+      currentSortieNo: '',
+      partsData: [],
+      allAirConfig: [],
+      percentage: 0
     }
   },
   watch: {
@@ -379,35 +262,15 @@ export default {
         }
         const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
         this.aircaftCatalogAll = data2
+        const { data: airConfigData } = await getAirConfiguration()
+        this.allAirConfig = airConfigData
         if (data.length) {
           this.currentNodeKey = data[0].id
           this.currentNode = data[0]
           this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children)
             .map((e) => e.id)
             .toString()
-          this.getFaultDiagnosisAPI({ aircraftId: this.aircaftModelIdList })
-          // this.getDataImportAPI()
-        }
-        const res = await getTaskExecondRegister({
-          status: null,
-          queryParam: '',
-          taskId: '',
-          aircaftCatalogId: ''
-        })
-        this.allTaskExecond = flattenTree(res.data)
-      } catch (error) {}
-    },
-
-    async removeFaultDiagnosisAPI(params) {
-      try {
-        const { code } = await removeFaultDiagnosis(params)
-        if (code === 200) {
-          this.$message({
-            type: 'success',
-            message: '操作成功!'
-          })
-          await this.getFaultDiagnosisAPI({ aircraftId: this.aircaftModelIdList })
-          this.handleClose()
+          this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
         }
       } catch (error) {}
     },
@@ -424,138 +287,117 @@ export default {
           }
         })
       }
-
       getLeaf(list, newArr)
       return newArr
     },
 
     async getFaultDiagnosisAPI(params) {
+      if (this.$refs.resultTable) this.$refs.resultTable.clearSelection()
+      const { keyWord } = this
+      const { pageSize, pageIndex } = this.resultTableRequset
+      const {
+        data: { list, total }
+      } = await getFaultDiagnosis({ pageSize, pageNum: pageIndex, ...params })
+      this.resultTableData = list
+      this.resultTableRequset.total = total
+    },
+
+    async getDataImportAPI(params) {
       if (this.$refs.table) this.$refs.table.clearSelection()
       const { keyWord } = this
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getFaultDiagnosis({ pageSize, pageNum: pageIndex, ...params })
+      } = await getDataImport({ pageSize, pageNum: pageIndex, ...params, source: 1 })
       this.tableData = list
       this.tableRequset.total = total
     },
 
     fetch() {
-      this.getFaultDiagnosisAPI(this.currentNodeKey)
-    },
-
-    searchClick() {
-      this.getFaultDiagnosisAPI({ aircraftId: this.aircaftModelIdList, sortieNo: this.keyWordData })
-    },
-
-    async addFaultDiagnosisAPI() {
-      try {
-        delete this.form.aircaftModelName
-        const { code } = await addFaultDiagnosis({ ...this.form })
-        if (code === 200) {
-          this.$message({
-            type: 'success',
-            message: '操作成功!'
-          })
-        }
-      } catch (error) {}
+      this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
     },
 
-    async updateFaultDiagnosisAPI() {
-      try {
-        const { code } = await updateFaultDiagnosis({ ...this.form })
-        if (code === 200) {
-          this.$message({
-            type: 'success',
-            message: '操作成功!'
-          })
-          this.handleClose()
-          this.getFaultDiagnosisAPI({ aircraftId: this.aircaftModelIdList })
-        }
-      } catch (error) {}
+    async searchClick() {
+      this.getDataImportAPI({ aircraftId: this.aircaftModelIdList, sortieNo: this.keyWordData })
     },
 
     treeNodeClick(data) {
       this.$refs.table.clearSelection()
-      this.currentNodeKey = this.executeForm.aircraftId = data.id
+      this.currentNodeKey = data.id
       this.currentNode = data
       this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data])
         .map((e) => e.id)
         .toString()
-      this.getFaultDiagnosisAPI({ aircraftId: this.aircaftModelIdList })
-      // this.getDataImportAPI(this.currentNodeKey)
+      if (!this.aircaftModelIdList) {
+        this.aircaftModelIdList = '#'
+      }
+      this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
     },
 
     openDialog() {
-      this.executeForm.aircraftId = this.currentNodeKey
-      if (this.executeForm.aircraftId !== '') {
-        this.changeAircraftId(this.executeForm.aircraftId)
-      }
-      this.dialogTitle = '新增'
+      this.dialogTitle = '诊断结果'
+      this.dialogVisible = true
+    },
+
+    async getAirConfigurationAPI(params) {
+      try {
+        const { data } = await getAirConfiguration(params)
+        const treeData = handleTree(data, 'id')
+        this.partsData = treeData
+      } catch (error) {}
+    },
+
+    faultExecute(row) {
+      this.dialogTitle = '选择诊断部件'
+      this.form = deepClone(row)
+      const item = this.aircaftCatalogAll.find((item) => item.aircaftCatalogId === this.form.aircraftId)
+      // this.form.aircraftType = item.aircraftType
+      this.getAirConfigurationAPI({ aircraftType: item.aircaftModelId })
       this.dialogVisible = true
     },
 
+    partIdSelect(node) {
+      this.form.partId = node.id
+    },
+
+    normalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children
+      }
+      return {
+        id: node.id,
+        label: node.name,
+        children: node.children
+      }
+    },
     handleClose() {
       this.dialogVisible = false
-      this.transferRightData = []
-      this.$refs.sortieNoTableRef.clearSelection()
-      this.executeForm = {
+      this.currentSortieNo = ''
+      this.form = {
+        id: '',
         sortieNo: '',
-        aircraftId: '',
         ossId: '',
-        modelId: '',
-        param: '',
-        columnData: []
+        aircraftId: '',
+        flightDate: '',
+        status: '',
+        partId: null
       }
     },
 
-    handUpdate(row) {
-      this.dialogTitle = '编辑'
-      this.form = deepClone(row)
-      this.dialogVisible = true
-    },
-
-    changeColumnData(value) {
-      const data = []
-      this.transferData.forEach((item) => {
-        value.forEach((rightData) => {
-          if (rightData === item.key) {
-            data.push(item.label)
-          }
-        })
-      })
-      this.executeForm.columnData = data
+    submit() {
+      this.beginExecute()
     },
 
-    changeModelId(modelId) {
-      const modelColumnData = JSON.parse(
-        this.modelList.find((item) => {
-          return item.id === modelId
-        }).columnData
-      )
-      const labelToKeyMap = this.transferData.reduce((acc, item) => {
-        acc[item.label] = item.key
-        return acc
-      }, {})
-      modelColumnData?.forEach((item) => {
-        if (labelToKeyMap.hasOwnProperty(item)) {
-          this.executeForm.columnData.push(item)
-          this.transferRightData.push(labelToKeyMap[item])
-        }
-      })
+    selection(val) {
+      this.tableCheckItems = val
     },
 
-    checkResultList(row) {
-      if (row.status === '0') {
-        this.$message({
-          type: 'warning',
-          message: '执行失败,无法查看结果!'
-        })
-        return
-      }
-      this.resultTableData = [row]
+    checkRelustList(row) {
+      // resultTableData
+      this.getFaultDiagnosisAPI({ sortieNo: row.sortieNo })
       this.resultVisible = true
     },
+
     async beginExecute() {
       this.progressVisible = true
 
@@ -574,10 +416,10 @@ export default {
       }, 30)
 
       try {
-        const res = await executeFault(this.executeForm)
-        this.percentage = 100
+        const res = await executeFault(this.form)
         clearInterval(myTimer)
         if (res?.code === 200) {
+          this.percentage = 100
           this.$message({
             type: 'success',
             message: '执行成功!'
@@ -595,73 +437,6 @@ export default {
         this.progressVisible = false
         this.percentage = 0
       }
-    },
-    async changeModelType(type) {
-      try {
-        const {
-          data: { list }
-        } = await getModel({ type })
-        this.modelList = list
-      } catch (error) {}
-    },
-
-    async changeAircraftId(aircraftId) {
-      try {
-        const {
-          data: { list, total }
-        } = await getDataImport({ aircraftId })
-        this.sortieNoList = list
-        this.SortieNoTableRequset.total = total
-      } catch (error) {}
-    },
-
-    async sortieNoSelection(val) {
-      this.executeForm.ossId = val.ossId
-      this.executeForm.sortieNo = val.sortieNo
-      if (val.ossId) {
-        try {
-          const res = await getColumnDataAPI(val.ossId)
-          if (res.code === 200) {
-            this.transferData = []
-            res.data.forEach((item, index) => {
-              this.transferData.push({
-                key: index,
-                label: item
-              })
-            })
-            if (this.executeForm.modelId) {
-              this.changeModelId(this.executeForm.modelId)
-            }
-          }
-        } catch (error) {}
-      }
-    },
-
-    submit() {
-      switch (this.dialogTitle) {
-        case '编辑':
-          this.updateFaultDiagnosisAPI()
-          break
-        case '新增':
-          this.beginExecute()
-          break
-      }
-    },
-
-    selection(val) {
-      this.tableCheckItems = val
-    },
-
-    remove(row) {
-      this.$confirm('是否删除该数据', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      })
-        .then(() => {
-          this.removeFaultDiagnosisAPI(row.map((e) => e.id))
-        })
-        .catch(() => {})
     }
   }
 }

+ 30 - 66
src/views/als/flightData/index.vue

@@ -30,15 +30,6 @@
                 </el-select>
               </el-form-item>
             </el-col>
-            <el-col :span="12">
-              <el-form-item label="机型" prop="aircaftModel">
-                <el-select v-model="form.aircaftModel" placeholder="请选择机型" disabled>
-                  <el-option v-for="item in aircaftModelAll" :key="item.aircaftModelId" :label="item.aircaftModelName" :value="item.aircaftModelId"> </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
             <el-col :span="12">
               <el-form-item label="编目" prop="aircraftId">
                 <el-select v-model="form.aircraftId" placeholder="请选择编目" disabled>
@@ -46,25 +37,25 @@
                 </el-select>
               </el-form-item>
             </el-col>
+          </el-row>
+          <el-row>
             <el-col :span="12">
               <el-form-item label="飞行时间" prop="flightDate">
                 <el-date-picker v-model="form.flightDate" type="datetime" placement="bottom-start" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择飞行时间" @change="flightDateChange"></el-date-picker>
               </el-form-item>
             </el-col>
-          </el-row>
-          <el-row>
             <el-col :span="12">
               <el-form-item label="架次号" prop="sortieNo">
                 <el-input disabled v-model="form.sortieNo" placeholder="选择飞行时间自动生成" />
               </el-form-item>
             </el-col>
+          </el-row>
+          <el-row>
             <el-col :span="12">
               <el-form-item label="上传飞参数据" label-width="100px" prop="ossId">
                 <FileUpload v-model="form.ossId" :limit="1" :fileSize="500" :fileType="['xls', 'xlsx']" />
               </el-form-item>
             </el-col>
-          </el-row>
-          <el-row>
             <el-col :span="12">
               <el-form-item label="警告列表导入" label-width="100px">
                 <el-upload
@@ -103,12 +94,12 @@
 <script>
 import { getDataImport, addDataImport, updateDataImport, removeDataImport } from '@/api/als/dataImport'
 import { getAircaftCatalogTree } from '@/api/als/sideTree'
-import { getAircaftModelAll, getAircaftCatalogAll, getSortieNo } from '@/api/als/aircraft'
-import { getTaskExecondRegister } from '@/api/carrierStandard/carrierListExecutionRegistration'
+import { getAircaftCatalogAll } from '@/api/als/aircraft'
 import { deepClone, debounce } from '@/utils/index'
 import FileUpload from '@/views/als/components/FileUpload'
 import { flattenTree, download } from '../utils/common'
 import { getItem } from '@/utils/index'
+import { getWarning } from '@/api/als/warning'
 
 export default {
   name: 'DataImport',
@@ -174,6 +165,10 @@ export default {
             }
           }
         },
+        {
+          prop: 'flightDate',
+          label: '飞行时间'
+        },
         {
           prop: 'ossId',
           label: '文件编号'
@@ -225,24 +220,13 @@ export default {
         id: '',
         ossId: '',
         source: '1',
-        aircaftModel: '',
         aircraftId: '',
         sortieNo: '',
         flightDate: '',
-        status: '',
-        tenantId: '',
-        version: '',
-        delFlag: '',
-        createBy: '',
-        createTime: '',
-        updateBy: '',
-        updateTime: ''
+        status: ''
       },
       debounceFn: debounce(this.fetch, 500),
-      aircaftModelAll: [],
       aircaftCatalogAll: [],
-      sortieNoList: [],
-      allTaskExecond: [],
       upload: {
         // 是否显示弹出层
         open: false,
@@ -257,7 +241,8 @@ export default {
         // 上传的地址
         url: '/api/als/warning/importData'
       },
-      warnFileList: []
+      warnFileList: [],
+      uploadFlag: false
     }
   },
   watch: {
@@ -274,13 +259,6 @@ export default {
       try {
         const { data } = await getAircaftCatalogTree(params)
         this.menuTreeData = data
-        const getAircaftModelAllParams = {
-          aircaftTypeCode: '',
-          aircaftTypeId: '',
-          queryParam: ''
-        }
-        const { data: data1 } = await getAircaftModelAll(getAircaftModelAllParams)
-        this.aircaftModelAll = data1
         const getAircaftCatalogAllParams = {
           keyWord: '',
           aircaftModelIdList: []
@@ -295,13 +273,6 @@ export default {
             .toString()
           this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
         }
-        const res = await getTaskExecondRegister({
-          status: null,
-          queryParam: '',
-          taskId: '',
-          aircaftCatalogId: ''
-        })
-        this.allTaskExecond = flattenTree(res.data)
       } catch (error) {}
     },
 
@@ -363,6 +334,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.uploadFlag = true
           this.handleClose()
           this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
           this.submitBtnLoading = false
@@ -396,14 +368,6 @@ export default {
         this.aircaftModelIdList = '#'
       }
       this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
-      this.getSortieNoAPI(data.label)
-    },
-
-    async getSortieNoAPI(aircaftCatalogCode) {
-      const res = await getSortieNo({ aircaftCatalogCode })
-      this.sortieNoList = res.data.filter((item) => {
-        return item.taskName
-      })
     },
 
     openDialog() {
@@ -419,26 +383,23 @@ export default {
         id: '',
         ossId: '',
         source: '1',
-        aircaftModel: '',
         sortieNo: '',
         aircraftId: '',
         flightDate: '',
-        status: '',
-        tenantId: '',
-        version: '',
-        delFlag: '',
-        createBy: '',
-        createTime: '',
-        updateBy: '',
-        updateTime: ''
+        status: ''
       }
     },
 
-    handUpdate(row) {
+    async handUpdate(row) {
       this.dialogTitle = '编辑'
-      const matchedItem = this.aircaftCatalogAll.find((item) => row.aircraftId.trim() === item.aircaftCatalogId.trim())
-      this.getSortieNoAPI(matchedItem.aircaftCatalogCode)
       this.form = deepClone(row)
+      // const {
+      //   data: { list, total }
+      // }=await getWarning({ sortieNo: row.SortieNo })
+      // if(total!==0){
+
+      // }
+      // console.log('this.form', this.form)
       this.dialogVisible = true
     },
 
@@ -449,11 +410,12 @@ export default {
             case '编辑':
               this.submitBtnLoading = true
               this.updateDataImportAPI()
+              this.submitFileForm()
               break
             case '新增':
               this.submitBtnLoading = true
-              this.submitFileForm()
               this.addDataImportAPI()
+              this.submitFileForm()
               break
           }
         }
@@ -508,9 +470,11 @@ export default {
     },
     // 文件上传成功处理
     handleFileSuccess(response, file, fileList) {
-      this.upload.open = false
-      this.upload.isUploading = false
-      this.$refs.upload.clearFiles()
+      if (this.uploadFlag) {
+        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 })
     },
     // 提交上传文件

+ 70 - 216
src/views/als/lifePrediction/index.vue

@@ -20,29 +20,17 @@
       <div class="view-dataType-table">
         <LTable ref="table" @selection-change="selection" :defaultFetch="false" :fetch="fetch" :columns="columns" :dataSource="tableData" :options="options" :pagination="tableRequset"></LTable>
       </div>
-      <!-- 添加或修改寿命预测对话框 -->
-      <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="800px" :before-close="handleClose">
-        <el-form ref="executeForm" :model="executeForm" label-width="80px">
+      <!-- 添加或修改退化评估对话框 -->
+      <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
+        <el-form ref="form" :model="form" label-width="80px">
           <el-form-item label="编目" prop="aircraftId">
-            <el-select v-model="executeForm.aircraftId" placeholder="请选择编目" @change="changeAircraftId(executeForm.aircraftId)" disabled>
+            <el-select v-model="form.aircraftId" placeholder="请选择编目" @change="changeAircraftId(form.aircraftId)" disabled>
               <el-option v-for="item in aircaftCatalogAll" :key="item.aircaftCatalogId" :label="item.aircaftCatalogCode" :value="item.aircaftCatalogId"> </el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="模型类型" prop="modelType">
-            <el-select v-model="executeForm.modelType" placeholder="请选择模型类型" @change="changeModelType(executeForm.modelType)">
-              <el-option v-for="item in algoTypeList" :key="item.id" :label="item.name" :value="item.id" />
-            </el-select>
-          </el-form-item>
-          <el-form-item label="架次号" prop="sortieNo">
-            <LTable ref="sortieNoTableRef" @current-change="sortieNoSelection" class="single-select-table" :columns="sortieNoColumns" :dataSource="sortieNoList" :options="sortieNoOptions" :pagination="SortieNoTableRequset"></LTable>
-          </el-form-item>
-          <el-form-item label="部件" prop="name">
-            <el-input v-model="executeForm.name" placeholder="请输入部件" />
-            <!-- <treeselect v-model="executeForm.name" :normalizer="normalizer" :options="partsTreeData" :show-count="true" placeholder="请选择部件" /> -->
+          <el-form-item label="部件" prop="partId">
+            <treeselect :value="form.partId" :normalizer="normalizer" :options="partsData" :show-count="true" placeholder="请选择部件" @select="partIdSelect" />
           </el-form-item>
-          <!-- <el-form-item label="所属系统" prop="system">
-            <el-input v-model="form.system" placeholder="请输入所属系统" />
-          </el-form-item> -->
         </el-form>
 
         <span slot="footer" class="dialog-footer">
@@ -66,19 +54,18 @@
 
 <script>
 import { getLifePrediction, addLifePrediction, updateLifePrediction, removeLifePrediction } from '@/api/als/lifePrediction'
-import { getTaskExecondRegister } from '@/api/carrierStandard/carrierListExecutionRegistration'
 import { getAircaftCatalogTree } from '@/api/als/sideTree'
 import { deepClone, debounce } from '@/utils/index'
-import { getDataImport } from '@/api/als/dataImport'
-import { getModel } from '@/api/als/model'
 import { getAircaftCatalogAll } from '@/api/als/aircraft'
-import { flattenTree } from '../utils/common'
-// import Treeselect from '@riophae/vue-treeselect'
-// import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import { getAirConfiguration } from '@/api/als/airConfiguration'
+import { handleTree } from '../utils/common'
+import { executeEvaluation } from '@/api/als/algorithm'
 
 export default {
   name: 'LifePrediction',
-  components: {},
+  components: { Treeselect },
   data() {
     // 这里存放数据
     return {
@@ -106,11 +93,6 @@ export default {
       },
       searchValue: '',
       columns: [
-        { prop: 'id', label: '编号' },
-        {
-          prop: 'sortieNo',
-          label: '架次号'
-        },
         {
           prop: 'aircraftId',
           label: '编目',
@@ -129,24 +111,20 @@ export default {
         },
         {
           prop: 'model',
-          label: '型号'
-        },
-        {
-          prop: 'system',
-          label: '所属系统'
-        },
-        {
-          prop: 'methodType',
-          label: '处理方式'
+          label: '部件型号'
         },
         {
-          prop: 'remainTiem',
-          label: '剩余时长'
+          prop: 'code',
+          label: '部件编码'
         },
         {
           prop: 'status',
           label: '状态'
         },
+        {
+          prop: 'resultContent',
+          label: '结果'
+        },
         {
           button: true,
           label: '操作',
@@ -158,7 +136,7 @@ export default {
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
-                this.checkResultList(row)
+                this.checkResult(row)
               }
             },
             {
@@ -173,35 +151,6 @@ export default {
           ]
         }
       ],
-      sortieNoColumns: [
-        {
-          prop: 'sortieNo',
-          label: '架次号',
-          render: (h, params) => {
-            const matchedItem = this.allTaskExecond.find((item) => params.row.sortieNo.trim() === item.taskId.trim())
-            if (matchedItem) {
-              return h('span', matchedItem.taskName)
-            } else {
-              return h('span', {}, '')
-            }
-          }
-        },
-        {
-          prop: 'source',
-          label: '数据来源',
-          render: (h, params) => {
-            if (params.row.source == 1) {
-              return h('span', { class: 'success-state' }, '飞参数据')
-            } else {
-              return h('span', { class: 'success-state' }, 'MDC数据')
-            }
-          }
-        },
-        {
-          prop: 'ossId',
-          label: '文件Id'
-        }
-      ],
       options: {
         stripe: true, // 斑马纹
         mutiSelect: true, // 多选框
@@ -211,21 +160,6 @@ export default {
         border: true,
         height: 'calc(100vh - 300px)'
       },
-      sortieNoOptions: {
-        stripe: true,
-        mutiSelect: false,
-        index: true,
-        loading: false,
-        initTable: false,
-        border: true,
-        height: '250px'
-      },
-      SortieNoTableRequset: {
-        total: 0,
-        pageIndex: 1,
-        pageSize: 10,
-        searchValue: ''
-      },
       tableCheckItems: [],
       tableData: [],
       tableRequset: {
@@ -237,33 +171,19 @@ export default {
       form: {
         id: '',
         aircraftId: '',
+        partId: null,
+        aircraftType: '',
+        code: '',
         name: '',
         model: '',
-        system: '',
         methodType: '',
-        remainTiem: '',
         status: '',
-        tenantId: '',
-        version: '',
-        delFlag: '',
-        createBy: '',
-        createTime: '',
-        updateBy: '',
-        updateTime: ''
+        resultContent: ''
       },
       debounceFn: debounce(this.fetch, 500),
-      executeForm: {
-        sortieNo: '',
-        aircraftId: '',
-        modelType: '',
-        name: ''
-      },
       aircaftCatalogAll: [],
-      algoTypeList: [{ id: 6, name: '寿命预测' }],
       percentage: 0,
-      modelList: [],
-      sortieNoList: [],
-      allTaskExecond: []
+      partsData: []
     }
   },
   watch: {
@@ -295,13 +215,6 @@ export default {
         // this.getLifePredictionAPI()
         // this.getDataImportAPI()
       }
-      const res = await getTaskExecondRegister({
-        status: null,
-        queryParam: '',
-        taskId: '',
-        aircaftCatalogId: ''
-      })
-      this.allTaskExecond = flattenTree(res.data)
     },
 
     async removeLifePredictionAPI(params) {
@@ -353,34 +266,6 @@ export default {
       this.getLifePredictionAPI({ aircraftId: this.aircaftModelIdList })
     },
 
-    async addLifePredictionAPI() {
-      try {
-        delete this.form.aircaftModelName
-        const { code } = await addLifePrediction({ ...this.form })
-        if (code === 200) {
-          this.$message({
-            type: 'success',
-            message: '操作成功!'
-          })
-          this.getLifePredictionAPI({ aircraftId: this.aircaftModelIdList })
-        }
-      } catch (error) {}
-    },
-
-    async updateLifePredictionAPI() {
-      try {
-        const { code } = await updateLifePrediction({ ...this.form })
-        if (code === 200) {
-          this.$message({
-            type: 'success',
-            message: '操作成功!'
-          })
-          this.handleClose()
-          this.getLifePredictionAPI({ aircraftId: this.aircaftModelIdList })
-        }
-      } catch (error) {}
-    },
-
     treeNodeClick(data) {
       this.$refs.table.clearSelection()
       this.currentNodeKey = this.form.aircraftId = data.id
@@ -392,102 +277,74 @@ export default {
     },
 
     openDialog() {
-      this.executeForm.aircraftId = this.currentNodeKey
-      if (this.executeForm.aircraftId !== '') {
-        this.changeAircraftId(this.executeForm.aircraftId)
-      }
+      const aircraftType = this.currentNode.parentId
+      this.getAirConfigurationAPI({ aircraftType })
       this.dialogTitle = '新增'
       this.dialogVisible = true
     },
 
+    partIdSelect(node) {
+      this.form.partId = node.id
+    },
+
+    async getAirConfigurationAPI(params) {
+      try {
+        const { data } = await getAirConfiguration(params)
+        const treeData = handleTree(data, 'id')
+        this.partsData = treeData
+      } catch (error) {}
+    },
+
     handleClose() {
       this.dialogVisible = false
       this.form = {
         id: '',
         aircraftId: '',
+        partId: null,
+        aircraftType: '',
+        code: '',
         name: '',
         model: '',
-        system: '',
         methodType: '',
-        remainTiem: '',
         status: '',
-        tenantId: '',
-        version: '',
-        delFlag: '',
-        createBy: '',
-        createTime: '',
-        updateBy: '',
-        updateTime: ''
+        resultContent: ''
       }
     },
-    handUpdate(row) {
-      this.dialogTitle = '编辑'
-      this.form = deepClone(row)
-      this.dialogVisible = true
-    },
-    checkResultList(row) {
-      this.form = deepClone(row)
+    checkResult(row) {
+      // this.form = deepClone(row)
       this.resultVisible = true
     },
-    executeAglo(row) {
-      // this.executeVisible = true
-      // this.agloForm.sortieNo = row.sortieNo
-      // this.agloForm.aircraftId = row.aircraftId
-    },
-    beginExecute() {
-      try {
-        // 调用算法接口
-        this.progressVisible = true
-        this.percentage += 1
-        const myTimer = setInterval(() => {
-          if (this.percentage < 100) {
-            this.percentage += 1
+    async beginExecute() {
+      this.progressVisible = true
+
+      let myTimer = setInterval(() => {
+        if (this.percentage < 100) {
+          if (this.percentage === 99) {
+            this.percentage = 99
           } else {
-            this.progressVisible = false
-            this.percentage = 0
-            clearInterval(myTimer)
-            // this.$router.push({ name: 'PreResult', params: { agloForm: this.agloForm } })
-            this.handleClose()
-            this.$message({
-              type: 'success',
-              message: '执行成功!'
-            })
-            this.$alert('寿命预测结果为:寿命前期', '寿命预测结果', {
-              confirmButtonText: '确定'
-            })
+            this.percentage += 1
           }
-        }, 30)
-      } catch (error) {
-        this.progressVisible = false
-        if (myTimer) {
-          clearInterval(myTimer)
         }
-        this.percentage = 0
-      }
-    },
+      }, 30)
 
-    async changeAircraftId(aircraftId) {
       try {
-        const {
-          data: { list, total }
-        } = await getDataImport({ aircraftId })
-        this.sortieNoList = list
-        this.SortieNoTableRequset.total = total
-      } catch (error) {}
-    },
-
-    async sortieNoSelection(val) {
-      this.executeForm.ossId = val.ossId //得到架次数据
-      this.executeForm.sortieNo = val.sortieNo
-    },
+        const res = await executeEvaluation(this.form)
 
-    async changeModelType(type) {
-      try {
-        const {
-          data: { list }
-        } = await getModel({ type })
-        this.modelList = list
-      } catch (error) {}
+        clearInterval(myTimer)
+        if (res?.code === 200) {
+          this.handleClose()
+          this.$message({
+            type: 'success',
+            message: '执行成功!'
+          })
+          this.getLifePredictionAPI({ aircraftId: this.aircaftModelIdList })
+        }
+      } catch (error) {
+        clearInterval(myTimer)
+      } finally {
+        this.progressVisible = false
+        this.percentage = 0
+      }
     },
 
     normalizer(node) {
@@ -504,11 +361,8 @@ export default {
     submit() {
       switch (this.dialogTitle) {
         case '编辑':
-          this.updateLifePredictionAPI()
           break
         case '新增':
-          // this.addLifePredictionAPI()
-          // this.handleClose()
           this.beginExecute()
           break
       }

+ 53 - 18
src/views/als/model/index.vue

@@ -29,11 +29,14 @@
           <el-form-item label="模型链接" prop="url">
             <el-input v-model="form.url" placeholder="请输入模型链接" />
           </el-form-item>
-          <el-form-item v-show="['5', '6'].includes(form.type)" label="机型" prop="aircaftType">
-            <treeselect v-model="form.aircaftType" :normalizer="aircaftTypeNormalizer" :options="aircaftTypeTreeData" :show-count="true" placeholder="请选择机型" />
+          <el-form-item v-show="['5', '6'].includes(form.type)" label="机型" prop="aircraftType">
+            <treeselect :value="form.aircraftType" :normalizer="aircraftTypeNormalizer" :options="aircraftTypeTreeData" :show-count="true" placeholder="请选择机型" @select="aircraftTypeChange" />
           </el-form-item>
           <el-form-item v-show="['5', '6'].includes(form.type)" label="部件" prop="partId">
-            <treeselect v-model="form.parentId" :normalizer="normalizer" :options="partsData" :show-count="true" placeholder="请选择部件" />
+            <treeselect :value="form.partId" :normalizer="normalizer" :options="partsData" :show-count="true" placeholder="请选择部件" @select="partIdSelect" />
+            <!-- <el-select v-model="form.partId" filterable placeholder="请选择部件">
+              <el-option v-for="item in partsData" :key="item.id" :label="item.devicesName" :value="item.id"> </el-option>
+            </el-select> -->
           </el-form-item>
           <el-form-item label="参数" prop="param">
             <el-input type="textarea" :rows="2" v-model="form.param" placeholder="请输入参数" />
@@ -66,6 +69,7 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 import { handleTree } from '../utils/common'
 import { agloModelList } from '@/views/als/utils/enum-data'
 import { getAirConfiguration } from '@/api/als/airConfiguration'
+import { getAirInstall } from '@/api/als/airInstall'
 import { getAircaftTypeAndModelTree } from '@/api/als/sideTree'
 
 export default {
@@ -80,7 +84,6 @@ export default {
       aircaftModelIdList: [],
       searchValue: '',
       columns: [
-        { prop: 'id', label: '编号' },
         {
           prop: 'name',
           label: '模型名称'
@@ -103,7 +106,15 @@ export default {
         },
         {
           prop: 'partId',
-          label: '部件'
+          label: '部件',
+          render: (h, params) => {
+            const matchedItem = this.allAirConfig.find((item) => params.row.partId === item.id)
+            if (matchedItem) {
+              return h('span', matchedItem.name)
+            } else {
+              return h('span', {}, '')
+            }
+          }
         },
         {
           prop: 'param',
@@ -176,16 +187,17 @@ export default {
         name: '',
         type: '',
         url: '',
-        aircaftType: null,
+        aircraftType: null,
         partId: null,
         param: '',
         columnData: '',
-        status: '',
+        status: '1',
         remark: ''
       },
       debounceFn: debounce(this.fetch, 500),
       partsData: [],
-      aircaftTypeTreeData: []
+      aircraftTypeTreeData: [],
+      allAirConfig: []
     }
   },
   watch: {
@@ -201,12 +213,11 @@ export default {
   methods: {
     async getPartData() {
       try {
-        const { data } = await getAirConfiguration()
-        const { data: aircaftTypeData } = await getAircaftTypeAndModelTree()
-        this.aircaftTypeTreeData = aircaftTypeData
-        console.log('this.aircaftTypeTreeData', this.aircaftTypeTreeData)
-        const treeData = handleTree(data, 'id')
-        this.partsData = treeData
+        const { data } = await getAircaftTypeAndModelTree()
+        const { data: airConfigData } = await getAirConfiguration()
+        this.allAirConfig = airConfigData
+        this.aircraftTypeTreeData = data[0].children
+        console.log('this.aircraftTypeTreeData', this.aircraftTypeTreeData)
       } catch (error) {}
     },
 
@@ -221,7 +232,7 @@ export default {
       }
     },
 
-    aircaftTypeNormalizer(node) {
+    aircraftTypeNormalizer(node) {
       if (node.children && !node.children.length) {
         delete node.children
       }
@@ -232,6 +243,24 @@ export default {
       }
     },
 
+    aircraftTypeChange(node) {
+      this.form.aircraftType = node.id
+      this.getAirConfigurationAPI({ aircraftType: this.form.aircraftType })
+    },
+
+    async getAirConfigurationAPI(params) {
+      try {
+        const { data } = await getAirConfiguration(params)
+        const treeData = handleTree(data, 'id')
+        this.partsData = treeData
+      } catch (error) {}
+    },
+
+    partIdSelect(node) {
+      console.log('node', node)
+      this.form.partId = node.id
+    },
+
     async removeModelAPI(params) {
       try {
         const { code } = await removeModel(params)
@@ -306,11 +335,11 @@ export default {
         name: '',
         type: '',
         url: '',
-        aircaftType: null,
+        aircraftType: null,
         partId: null,
         param: '',
         columnData: '',
-        status: '',
+        status: '1',
         remark: ''
       }
     },
@@ -318,6 +347,13 @@ export default {
     handUpdate(row) {
       this.dialogTitle = '编辑'
       this.form = deepClone(row)
+      console.log('this.form', this.form)
+      if (['5', '6'].includes(this.form.type)) {
+        const item = this.allAirConfig.find((item) => item.id === this.form.partId)
+        this.form.aircraftType = item.aircraftType
+        this.getAirConfigurationAPI({ aircraftType: this.form.aircraftType })
+      }
+
       this.dialogVisible = true
     },
 
@@ -329,7 +365,6 @@ export default {
           break
         case '新增':
           this.addModelAPI()
-
           break
       }
     },

+ 10 - 29
src/views/als/preProcessing/index.vue

@@ -126,15 +126,7 @@ export default {
         // { prop: 'id', label: '编号' },
         {
           prop: 'sortieNo',
-          label: '架次号',
-          render: (h, params) => {
-            const matchedItem = this.allTaskExecond.find((item) => params.row.sortieNo.trim() === item.taskId.trim())
-            if (matchedItem) {
-              return h('span', matchedItem.taskName)
-            } else {
-              return h('span', {}, '')
-            }
-          }
+          label: '架次号'
         },
         {
           prop: 'aircraftId',
@@ -225,15 +217,7 @@ export default {
       sortieNoColumns: [
         {
           prop: 'sortieNo',
-          label: '架次号',
-          render: (h, params) => {
-            const matchedItem = this.allTaskExecond.find((item) => params.row.sortieNo.trim() === item.taskId.trim())
-            if (matchedItem) {
-              return h('span', matchedItem.taskName)
-            } else {
-              return h('span', {}, '')
-            }
-          }
+          label: '架次号'
         },
         {
           prop: 'source',
@@ -583,23 +567,20 @@ export default {
 
       let myTimer = setInterval(() => {
         if (this.percentage < 100) {
-          this.percentage += 1
-        } else {
-          clearInterval(myTimer)
-          this.$message({
-            type: 'error',
-            message: '执行有误'
-          })
-          this.progressVisible = false
-          this.percentage = 0
+          if (this.percentage === 99) {
+            this.percentage = 99
+          } else {
+            this.percentage += 1
+          }
         }
       }, 30)
 
       try {
         const res = await executePreProcessing(this.executeForm)
-        this.percentage = 100
+
         clearInterval(myTimer)
         if (res?.code === 200) {
+          this.percentage = 100
           this.$message({
             type: 'success',
             message: '执行成功!'
@@ -628,7 +609,7 @@ export default {
       try {
         const {
           data: { list, total }
-        } = await getDataImport({ aircraftId })
+        } = await getDataImport({ aircraftId, source: 1 })
         this.sortieNoList = list
         this.SortieNoTableRequset.total = total
       } catch (error) {}

+ 1 - 1
src/views/als/utils/enum-data.js

@@ -7,7 +7,7 @@ export const agloModelList = [
   { key: '3', name: '补全' },
   { key: '4', name: '虚警抑制' },
   { key: '5', name: '故障诊断' },
-  { key: '6', name: '寿命预测' }
+  { key: '6', name: '退化评估' }
 ]
 
 const enumData = {