Ver Fonte

故障诊断结果、标签栏bug、算法模型删除多余的内容

Rmengdi há 1 mês atrás
pai
commit
b27968c0ea

+ 0 - 40
src/store/modules/app.js

@@ -6,52 +6,12 @@ export default {
     tagsViewList: getItem(TAGS_VIEW) || []
   },
   mutations: {
-    //   添加tags,限制最多保留5个标签(不包括首页)
     addTagsViewList(state, tag) {
       const isFind = state.tagsViewList.find((item) => {
         return item.path === tag.path
       })
       if (!isFind) {
-        // 检查是否为同一功能模块的子页面
-        const isSameModule = state.tagsViewList.some((item) => {
-          const itemPath = item.path.split('/')[2]
-          const tagPath = tag.path.split('/')[2]
-          return itemPath === tagPath
-        })
-
-        // 如果是同一模块的子页面,替换该模块最早的子页面标签
-        if (isSameModule) {
-          // const moduleIndex = state.tagsViewList.findIndex((item) => {
-          //   const itemPath = item.path.split('/')[2]
-          //   const tagPath = tag.path.split('/')[2]
-          //   return itemPath === tagPath && item.fullPath !== '/home'
-          // })
-          // if (moduleIndex !== -1) {
-          //   state.tagsViewList.splice(moduleIndex, 1)
-          // }
-
-          const modulePath = tag.path.split('/')[2]
-          const modulePages = state.tagsViewList.filter((item) => {
-            return item.path.split('/')[2] === modulePath && item.fullPath !== '/home'
-          })
-          if (modulePages.length > 1) {
-            //保留最早和最新的子页面
-            const firstPage = modulePages[0]
-            state.tagsViewList = state.tagsViewList.filter((item) => {
-              return item.path.split('/')[2] !== modulePath || item === firstPage
-            })
-          }
-        }
-
         state.tagsViewList.push(tag)
-        // 如果标签数超过5个(不包括首页),删除最早添加的非首页标签
-        if (state.tagsViewList.length > 6) {
-          // 找到第一个非首页的标签的索引
-          const firstNonHomeIndex = state.tagsViewList.findIndex((item) => item.fullPath !== '/home')
-          if (firstNonHomeIndex !== -1) {
-            state.tagsViewList.splice(firstNonHomeIndex, 1)
-          }
-        }
         setItem(TAGS_VIEW, state.tagsViewList)
       }
     },

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

@@ -17,13 +17,29 @@
       </div>
       <el-dialog title="诊断结果" :visible.sync="resultVisible" width="1200px">
         <LTable ref="resultTable" :showColumnSetting="false" :defaultFetch="false" :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> -->
       </el-dialog>
       <el-dialog title="执行进度" :visible.sync="progressVisible" width="800px">
         <el-progress :text-inside="true" :stroke-width="24" :percentage="percentage" status="success"></el-progress>
       </el-dialog>
+      <el-dialog title="结果展示" :visible.sync="resultShowVisible" :before-close="resultShowDialogClose" width="800px">
+        <el-descriptions border :column="1">
+          <el-descriptions-item label="评分">
+            <div style="display: flex; align-items: center">
+              <el-rate v-model="changeScore" disabled text-color="#ff9900" score-template="{value}"> </el-rate>
+              <span style="margin-left: 3px; color: #f7ba2a; font-size: 1.2rem">{{ diagnosisResult.score }}</span>
+            </div>
+          </el-descriptions-item>
+          <el-descriptions-item label="退化结果">
+            <el-tag style="margin-right: 20px" type="danger" v-for="(item, index) in diagnosisResult.degradation" :key="index">{{ item }}</el-tag>
+          </el-descriptions-item>
+          <el-descriptions-item label="故障结果">
+            <el-tag style="margin-right: 20px" type="danger" v-for="(item, index) in diagnosisResult.fault" :key="index">{{ item }}</el-tag>
+          </el-descriptions-item>
+        </el-descriptions>
+        <span slot="footer" class="dialog-footer">
+          <el-button type="primary" @click="resultShowDialogClose">确 定</el-button>
+        </span>
+      </el-dialog>
     </div>
   </div>
 </template>
@@ -47,6 +63,7 @@ export default {
     return {
       resultVisible: false,
       progressVisible: false,
+      resultShowVisible: false,
       keyWordData: '',
       aircaftModelIdList: [],
       currentNodeKey: '',
@@ -163,36 +180,34 @@ export default {
           label: '算法名称'
         },
         {
-          prop: 'param',
-          label: '部件',
+          prop: 'createTime',
+          label: '执行时间',
           render: (h, params) => {
-            const matchedItem = this.allAirConfig.find((item) => params.row.param === item.id)
-            if (matchedItem) {
-              return h('span', matchedItem.name)
-            } else {
-              return h('span', {}, '')
-            }
+            return h('span', params.row.createTime.split(' ')[0])
           }
         },
         {
-          prop: 'remarks',
-          label: '参数特征'
-        },
-        {
-          prop: 'columnData',
-          label: '数据列'
+          prop: 'status',
+          label: '状态',
+          render: (h, params) => {
+            return h('span', { class: 'success-state' }, '成功')
+          }
         },
         {
-          prop: 'resultContent',
+          button: true,
           label: '结果',
-          render: (h, params) => {
-            const result = JSON.parse(params.row.resultContent).result
-            if (result) {
-              return h('span', result)
-            } else {
-              return h('span', {}, '-')
+          width: '240px',
+          group: [
+            {
+              name: '查看结果',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.checkRelustShow(row)
+              }
             }
-          }
+          ]
         }
       ],
       resultOptions: {
@@ -232,7 +247,13 @@ export default {
       resultShowData: {
         url: '',
         result: ''
-      }
+      },
+      diagnosisResult: {
+        degradation: [],
+        fault: [],
+        score: null
+      },
+      changeScore: null
     }
   },
   watch: {
@@ -287,7 +308,6 @@ export default {
 
     async getFaultDiagnosisResultAPI(params) {
       if (this.$refs.resultTable) this.$refs.resultTable.clearSelection()
-      const { keyWord } = this
       const { pageSize, pageIndex } = this.resultTableRequset
       const {
         data: { list, total }
@@ -374,6 +394,16 @@ export default {
       }
     },
 
+    resultShowDialogClose() {
+      this.resultShowVisible = false
+      this.diagnosisResult = {
+        degradation: [],
+        fault: [],
+        score: null
+      }
+      this.changeScore = null
+    },
+
     submit() {
       this.beginExecute(row)
     },
@@ -382,11 +412,18 @@ export default {
       this.tableCheckItems = val
     },
 
-    checkRelustList(row) {
-      this.getFaultDiagnosisResultAPI({ sortieNo: row.sortieNo })
+    async checkRelustList(row) {
+      this.getFaultDiagnosisResultAPI({ diagnosisId: row.id })
       this.resultVisible = true
     },
 
+    checkRelustShow(row) {
+      const resData = JSON.parse(row.resultContent)
+      this.changeScore = resData.score / 20
+      this.diagnosisResult = resData
+      this.resultShowVisible = true
+    },
+
     async getImgUrl(ossId) {
       const { data } = await getListByIdsApi(ossId)
       const newUrl = data[0].url
@@ -416,9 +453,12 @@ export default {
             type: 'success',
             message: '执行成功!'
           })
-          this.resultVisible = true
-          console.log('11', JSON.parse(res.msg))
-          this.getFaultDiagnosisResultAPI({ sortieNo: this.currentSortieNo })
+          const resData = JSON.parse(res.data)
+          this.changeScore = resData.score / 20
+          this.diagnosisResult = resData
+
+          // this.resultVisible = true
+          this.resultShowVisible = true
           this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
           this.handleClose()
         }

+ 9 - 17
src/views/als/model/index.vue

@@ -29,20 +29,20 @@
           <el-form-item label="模型链接" prop="url">
             <el-input v-model="form.url" placeholder="请输入模型链接" />
           </el-form-item>
-          <el-form-item v-if="['5'].includes(form.type)" label="参数特征" prop="paramType">
+          <!-- <el-form-item v-if="['5'].includes(form.type)" label="参数特征" prop="paramType">
             <el-select v-model="form.paramType" filterable allow-create default-first-option placeholder="请选择参数特征">
               <el-option v-for="item in paramTypeData" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"> </el-option>
             </el-select>
-          </el-form-item>
+          </el-form-item> -->
           <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 noOptionsText="该机型暂无构型信息,请在构型管理中添加" :value="form.partId" :normalizer="normalizer" :options="partsData" :show-count="true" placeholder="请选择部件" @select="partIdSelect" />
           </el-form-item>
-          <el-form-item label="参数" prop="param">
+          <!-- <el-form-item label="参数" prop="param">
             <el-input type="textarea" :rows="2" v-model="form.param" placeholder="请输入参数" />
-          </el-form-item>
+          </el-form-item> -->
           <el-form-item label="数据列" prop="columnData">
             <el-input type="textarea" :rows="3" v-model="form.columnData" placeholder="请输入数据列" />
           </el-form-item>
@@ -107,10 +107,6 @@ export default {
           prop: 'url',
           label: '模型链接'
         },
-        {
-          prop: 'paramType',
-          label: '参数特征'
-        },
         {
           prop: 'aircraftType',
           label: '机型',
@@ -135,13 +131,9 @@ export default {
             }
           }
         },
-        {
-          prop: 'param',
-          label: '模型参数'
-        },
         {
           prop: 'columnData',
-          label: '飞参数据列'
+          label: '数据列'
         },
         {
           prop: 'status',
@@ -221,10 +213,10 @@ export default {
       rules: {
         name: [{ required: true, message: '模型名称不能为空', trigger: 'blur' }],
         type: [{ required: true, message: '模型类型不能为空', trigger: 'change' }],
-        url: [{ required: true, message: '模型链接不能为空', trigger: 'blur' }],
-        paramType: [{ required: true, message: '参数特征不能为空', trigger: 'change' }],
-        aircraftType: [{ required: true, message: '机型不能为空', trigger: 'change' }],
-        partId: [{ required: true, message: '部件不能为空', trigger: 'change' }]
+        url: [{ required: true, message: '模型链接不能为空', trigger: 'blur' }]
+        // paramType: [{ required: true, message: '参数特征不能为空', trigger: 'change' }],
+        // aircraftType: [{ required: true, message: '机型不能为空', trigger: 'change' }],
+        // partId: [{ required: true, message: '部件不能为空', trigger: 'change' }]
       },
       paramTypeData: [],
       aircaftModelAll: []

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

@@ -2,12 +2,12 @@ import Vue from 'vue'
 
 // 证件类型 columns
 export const agloModelList = [
-  { key: '1', name: '去噪' },
-  { key: '2', name: '扩充' },
-  { key: '3', name: '补全' },
-  { key: '4', name: '虚警抑制' },
-  { key: '5', name: '故障诊断' },
-  { key: '6', name: '退化评估' }
+  // { key: '1', name: '去噪' },
+  // { key: '2', name: '扩充' },
+  // { key: '3', name: '补全' },
+  // { key: '4', name: '虚警抑制' },
+  { key: '5', name: '故障诊断' }
+  // { key: '6', name: '退化评估' }
 ]
 
 // 抽取状态