Bladeren bron

故障诊断调用

Rmengdi 1 maand geleden
bovenliggende
commit
5e9c58bd8c
3 gewijzigde bestanden met toevoegingen van 18 en 56 verwijderingen
  1. 1 1
      .env.development
  2. 16 54
      src/views/als/faultDiagnosis/index.vue
  3. 1 1
      vue.config.js

+ 1 - 1
.env.development

@@ -5,4 +5,4 @@ ENV = 'development'
 # 开发环境
 VUE_APP_BASE_API ='/api'
 
-VUE_APP_BASE_API_target ='http://localhost:9091'
+VUE_APP_BASE_API_target ='http://localhost:9192'

+ 16 - 54
src/views/als/faultDiagnosis/index.vue

@@ -17,18 +17,13 @@
       </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">
-        <div style="margin: 10px 0px">{{ resultShowData.result }}</div>
-        <el-image style="width: 500px" v-if="resultShowData.url !== ''" :src="resultShowData.url" :preview-src-list="[resultShowData.url]"></el-image>
-        <span slot="footer" class="dialog-footer">
-          <el-button @click="resultShowDialogClose">取 消</el-button>
-          <el-button type="primary" @click="resultShowDialogClose">确 定</el-button>
-        </span>
-      </el-dialog>
     </div>
   </div>
 </template>
@@ -52,7 +47,6 @@ export default {
     return {
       resultVisible: false,
       progressVisible: false,
-      resultShowVisible: false,
       keyWordData: '',
       aircaftModelIdList: [],
       currentNodeKey: '',
@@ -126,8 +120,6 @@ export default {
             {
               name: '故障诊断',
               type: 'text',
-              statusKey: 'status',
-              disableKey: '2',
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
@@ -201,22 +193,6 @@ export default {
               return h('span', {}, '-')
             }
           }
-        },
-        {
-          button: true,
-          label: '操作',
-          width: '240px',
-          group: [
-            {
-              name: '查看结果',
-              type: 'text',
-              round: false,
-              plain: false,
-              onClick: (row, index, scope) => {
-                this.checkRelustShow(row)
-              }
-            }
-          ]
         }
       ],
       resultOptions: {
@@ -398,14 +374,6 @@ export default {
       }
     },
 
-    resultShowDialogClose() {
-      this.resultShowVisible = false
-      this.resultShowData = {
-        url: '',
-        result: ''
-      }
-    },
-
     submit() {
       this.beginExecute(row)
     },
@@ -419,13 +387,6 @@ export default {
       this.resultVisible = true
     },
 
-    async checkRelustShow(row) {
-      const { data } = await getListByIdsApi(JSON.parse(row.resultContent).ossId)
-      this.resultShowData.url = data[0].url
-      this.resultShowData.result = JSON.parse(row.resultContent).result
-      this.resultShowVisible = true
-    },
-
     async getImgUrl(ossId) {
       const { data } = await getListByIdsApi(ossId)
       const newUrl = data[0].url
@@ -447,19 +408,20 @@ export default {
 
       try {
         this.form.dataId = row.id
-        // const res = await executeFault(this.form)
+        const res = await executeFault(this.form)
         clearInterval(myTimer)
-        // if (res?.code === 200) {
-        this.percentage = 100
-        this.$message({
-          type: 'success',
-          message: '执行成功!'
-        })
-        this.resultVisible = true
-        this.getFaultDiagnosisResultAPI({ sortieNo: this.currentSortieNo })
-        this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
-        this.handleClose()
-        // }
+        if (res?.code === 200) {
+          this.percentage = 100
+          this.$message({
+            type: 'success',
+            message: '执行成功!'
+          })
+          this.resultVisible = true
+          console.log('11', JSON.parse(res.msg))
+          this.getFaultDiagnosisResultAPI({ sortieNo: this.currentSortieNo })
+          this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
+          this.handleClose()
+        }
       } catch (error) {
         clearInterval(myTimer)
       } finally {

+ 1 - 1
vue.config.js

@@ -8,7 +8,7 @@ module.exports = defineConfig({
     open: true, //值为 true的话,项目启动时自动打开到浏览器里边, false不会打开
     proxy: {
       ['/api/als']: {
-        target: 'http://localhost:9090',
+        target: 'http://localhost:9191',
         ws: false,
         changeOrigin: true,
         pathRewrite: {