Переглянути джерело

退化评估、数据同步

Rmengdi 3 місяців тому
батько
коміт
5014e723f5

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

@@ -43,3 +43,8 @@ export const exportFaultStatisticsExcel = async (data) => {
 export const getFaultStatisticsListAll = async (data) => {
   return await post('/als/faultStatistics/listAll', data)
 }
+
+// 同步
+export const getSync = async (data) => {
+  return await get('/extra/statistics', data)
+}

+ 24 - 3
src/views/als/faultStatistics/index.vue

@@ -374,7 +374,7 @@
 </template>
 
 <script>
-import { getFaultStatistics, getFaultStatisticsListAll, getAircaftTypeAndModelTree, addFaultStatistics, updateFaultStatistics, removeFaultStatistics, downLoadFaultStatistics, exportFaultStatisticsExcel } from '@/api/als/faultStatistics'
+import { getSync, getFaultStatistics, getFaultStatisticsListAll, getAircaftTypeAndModelTree, addFaultStatistics, updateFaultStatistics, removeFaultStatistics, downLoadFaultStatistics, exportFaultStatisticsExcel } from '@/api/als/faultStatistics'
 import { deepClone, debounce } from '@/utils/index'
 import ImportDialog from './importDialog/index.vue'
 import EchartsVue from './echarts.vue'
@@ -775,7 +775,8 @@ export default {
         installationTime: [{ required: true, message: '故障件装本机工作时次不能为空', trigger: 'blur' }],
         totalWorkTime: [{ required: true, message: '故障件总工作时次不能为空', trigger: 'blur' }]
       },
-      debounceFn: debounce(this.fetch, 500)
+      debounceFn: debounce(this.fetch, 500),
+      loading: null
     }
   },
   watch: {
@@ -1040,7 +1041,27 @@ export default {
     },
 
     // 同步
-    handleSync() {},
+    async handleSync() {
+      this.loading = this.$loading({
+        lock: true,
+        text: '正在同步数据,请稍候...',
+        spinner: 'el-icon-loading'
+        // background: 'rgba(0, 0, 0, 0.7)'
+      })
+      try {
+        const { code } = await getSync()
+        if (code === 200) {
+          this.loading.close()
+          this.$message({
+            type: 'success',
+            message: '同步成功!'
+          })
+          this.getFaultStatisticsAPI()
+        }
+      } catch (error) {
+        this.loading.close()
+      }
+    },
 
     //更多按钮
     handleExport(type) {

+ 1 - 1
src/views/als/flightData/index.vue

@@ -53,7 +53,7 @@
           <el-row>
             <el-col :span="12">
               <el-form-item label="上传飞参数据" label-width="110px" prop="ossId">
-                <FileUpload v-model="form.ossId" :limit="1" :fileSize="500" :fileType="['xls', 'xlsx']" />
+                <FileUpload v-model="form.ossId" :limit="1" :fileSize="500" :fileType="['xls', 'xlsx', 'csv']" />
               </el-form-item>
             </el-col>
             <el-col :span="12">

+ 34 - 31
src/views/als/knowledgeExtraction/index.vue

@@ -96,7 +96,7 @@
             </div>
           </div>
           <div slot="footer" class="dialog-footer">
-            <el-button @click="addER">新增实体关系</el-button>
+            <el-button type="success" @click="addER">新增实体关系</el-button>
             <el-button @click="handleCancel">作 废</el-button>
             <el-button type="primary" @click="passThrough">通 过</el-button>
           </div>
@@ -259,42 +259,44 @@ export default {
           prop: 'clause',
           label: '内容'
         },
+        {
+          prop: 'status',
+          label: '状态',
+          width: '240px',
+          render: (h, params) => {
+            if (params.row.status === '0') {
+              return h('span', { class: 'danger-state' }, '未审核')
+            } else if (params.row.status === '1') {
+              return h('span', { class: 'success-state' }, '通过')
+            } else if (params.row.status === '2') {
+              return h('span', { class: 'warning-state' }, '作废')
+            }
+          }
+        },
         // {
-        //   prop: 'status',
+        //   prop: 'statusKey',
         //   label: '状态',
         //   width: '240px',
         //   render: (h, params) => {
-        //     if (params.row.status === '0') {
-        //       return h('span', { class: 'success-state' }, '已分句')
+        //     // if (params.row.status !== ' ') {
+        //     //   if (params.row.status == '0') {
+        //     //     return h('span', { class: 'danger-state' }, '未审核')
+        //     //   } else if (params.row.status == '1') {
+        //     //     return h('span', { class: 'success-state' }, '通过')
+        //     //   } else if (params.row.status == '2') {
+        //     //     return h('span', { class: 'warning-state' }, '作废')
+        //     //   }
+        //     // } else {
+        //     const matchedItem = this.$enumData.extractStatus.find((item) => params.row.statusKey === item.key)
+        //     if (matchedItem) {
+        //       return h('span', { class: 'success-state' }, matchedItem.name)
+        //       // return h('span', { class: matchedItem.colorType }, matchedItem.name)
         //     } else {
-        //       return h('span', { class: 'warning-state' }, '抽取中')
+        //       return h('span', {}, '')
         //     }
+        //     // }
         //   }
         // },
-        {
-          prop: 'statusKey',
-          label: '状态',
-          width: '240px',
-          render: (h, params) => {
-            // if (params.row.status !== ' ') {
-            //   if (params.row.status == '0') {
-            //     return h('span', { class: 'danger-state' }, '未审核')
-            //   } else if (params.row.status == '1') {
-            //     return h('span', { class: 'success-state' }, '通过')
-            //   } else if (params.row.status == '2') {
-            //     return h('span', { class: 'warning-state' }, '作废')
-            //   }
-            // } else {
-            const matchedItem = this.$enumData.extractStatus.find((item) => params.row.statusKey === item.key)
-            if (matchedItem) {
-              return h('span', { class: 'success-state' }, matchedItem.name)
-              // return h('span', { class: matchedItem.colorType }, matchedItem.name)
-            } else {
-              return h('span', {}, '')
-            }
-            // }
-          }
-        },
         {
           button: true,
           label: '操作',
@@ -767,7 +769,7 @@ export default {
 
     // 作废
     handleCancel() {
-      // this.clauseForm.status=
+      this.clauseForm.status = 2
       this.$confirm('是否将该抽取结果作废?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
@@ -782,7 +784,7 @@ export default {
 
     // 通过
     passThrough() {
-      // this.clauseForm.status=
+      this.clauseForm.status = 1
       this.updateClauseAPI()
     },
 
@@ -899,6 +901,7 @@ export default {
           break
         case '5':
           this.active = 2
+          this.getClauseListAPI({ taskId: row.id })
           this.twoTitle = '入库中'
           break
         case '6':

+ 119 - 19
src/views/als/lifePrediction/index.vue

@@ -21,13 +21,26 @@
         <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="600px" :before-close="handleClose">
-        <el-form ref="form" :model="form" label-width="80px">
+      <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="60%" :before-close="handleClose">
+        <el-form ref="form" :model="form" :rules="rules" label-width="80px">
           <el-form-item label="编目" prop="aircraftId">
             <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="sortieNo">
+            <LTable
+              ref="sortieNoTableRef"
+              :defaultFetch="false"
+              :fetch="sortieNoFetch"
+              @selection-change="sortieNoSelection"
+              class="single-select-table"
+              :columns="sortieNoColumns"
+              :dataSource="sortieNoList"
+              :options="sortieNoOptions"
+              :pagination="SortieNoTableRequset"
+            ></LTable>
+          </el-form-item>
           <el-form-item label="部件" prop="partId">
             <treeselect noOptionsText="该机型暂无构型信息,请在构型管理中添加" :value="form.partId" :normalizer="normalizer" :options="partsData" :show-count="true" placeholder="请选择部件" @select="partIdSelect" />
           </el-form-item>
@@ -41,8 +54,8 @@
       <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="800px">
-        展示结果
+      <el-dialog title="结果展示" :visible.sync="resultVisible" width="50%">
+        <el-image style="width: 500px" :src="resultUrl" :preview-src-list="[resultUrl]"></el-image>
         <span slot="footer" class="dialog-footer">
           <el-button @click="resultVisible = false">取 消</el-button>
           <el-button type="primary" @click="resultVisible = false">确 定</el-button>
@@ -62,6 +75,7 @@ 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'
+import { getDataImport } from '@/api/als/dataImport'
 
 export default {
   name: 'LifePrediction',
@@ -125,17 +139,13 @@ export default {
           prop: 'status',
           label: '状态'
         },
-        {
-          prop: 'resultContent',
-          label: '结果'
-        },
         {
           button: true,
           label: '操作',
           width: '240px',
           group: [
             {
-              name: '查看',
+              name: '查看结果',
               type: 'text',
               round: false,
               plain: false,
@@ -172,6 +182,44 @@ export default {
         pageSize: 10,
         searchValue: ''
       },
+      sortieNoColumns: [
+        {
+          prop: 'sortieNo',
+          label: '架次号'
+        },
+        {
+          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'
+        }
+      ],
+      sortieNoOptions: {
+        stripe: true, // 斑马纹
+        mutiSelect: true, // 多选框
+        index: true, // 显示序号, 多选则 mutiSelect
+        loading: false, // 表格动画
+        initTable: false, // 是否一挂载就加载数据
+        border: true,
+        height: '250px'
+      },
+      SortieNoTableRequset: {
+        total: 0,
+        pageIndex: 1,
+        pageSize: 10,
+        searchValue: ''
+      },
+      sortieNoList: [],
+      sortieNoCheckItems: [],
       form: {
         id: '',
         aircraftId: '',
@@ -182,12 +230,23 @@ export default {
         model: '',
         methodType: '',
         status: '',
-        resultContent: ''
+        resultContent: '',
+        ossIds: []
       },
       debounceFn: debounce(this.fetch, 500),
       aircaftCatalogAll: [],
       percentage: 0,
-      partsData: []
+      partsData: [],
+      // executeForm: {
+      //   sortieNo: '',
+      //   aircraftId: '',
+      //   partId: ''
+      // },
+      rules: {
+        aircraftId: [{ required: true, message: '编目不能为空', trigger: 'change' }],
+        partId: [{ required: true, message: '部件不能为空', trigger: 'change' }]
+      },
+      resultUrl: ''
     }
   },
   watch: {
@@ -266,6 +325,28 @@ export default {
       this.getLifePredictionAPI({ aircraftId: this.aircaftModelIdList })
     },
 
+    sortieNoFetch() {
+      this.getAirDataAPI({ aircraftId: this.currentNode.id })
+    },
+
+    async sortieNoSelection(val) {
+      this.sortieNoCheckItems = val
+    },
+
+    async getAirDataAPI(params) {
+      this.sortieNoCheckItems = []
+      try {
+        if (this.$refs.sortieNoTableRef) this.$refs.sortieNoTableRef.clearSelection()
+        const { keyWord } = this
+        const { pageSize, pageIndex } = this.SortieNoTableRequset
+        const {
+          data: { list, total }
+        } = await getDataImport({ pageSize, pageNum: pageIndex, ...params, source: 1 })
+        this.sortieNoList = list
+        this.SortieNoTableRequset.total = total
+      } catch (error) {}
+    },
+
     async searchClick() {
       this.getLifePredictionAPI({ aircraftId: this.aircaftModelIdList, name: this.keyWordData })
     },
@@ -282,7 +363,9 @@ export default {
 
     openDialog() {
       const aircraftType = this.currentNode.parentId
+      this.form.aircraftId = this.currentNode.id
       this.getAirConfigurationAPI({ aircraftType })
+      this.getAirDataAPI({ aircraftId: this.currentNode.id })
       this.dialogTitle = '新增'
       this.dialogVisible = true
     },
@@ -311,14 +394,27 @@ export default {
         model: '',
         methodType: '',
         status: '',
-        resultContent: ''
+        resultContent: '',
+        ossIds: []
       }
     },
     checkResult(row) {
       // this.form = deepClone(row)
+      this.resultUrl = row.resultContent
       this.resultVisible = true
     },
     async beginExecute() {
+      this.sortieNoCheckItems.forEach((item) => {
+        this.form.ossIds.push(item.ossId)
+      })
+      console.log('333', this.form)
+      if (this.sortieNoCheckItems.length == 0) {
+        this.$message({
+          type: 'success',
+          message: '请选择架次号!'
+        })
+        return
+      }
       this.progressVisible = true
 
       let myTimer = setInterval(() => {
@@ -363,13 +459,17 @@ export default {
     },
 
     submit() {
-      switch (this.dialogTitle) {
-        case '编辑':
-          break
-        case '新增':
-          this.beginExecute()
-          break
-      }
+      this.$refs['form'].validate((valid) => {
+        if (valid) {
+          switch (this.dialogTitle) {
+            case '编辑':
+              break
+            case '新增':
+              this.beginExecute()
+              break
+          }
+        }
+      })
     },
 
     selection(val) {

+ 1 - 1
vue.config.js

@@ -16,7 +16,7 @@ module.exports = defineConfig({
         }
       },
       ['/api/kgqa']: {
-        target: 'http://192.168.0.102:7073',
+        target: 'http://192.168.0.106:7073',
         ws: false,
         changeOrigin: true,
         pathRewrite: {