Эх сурвалжийг харах

合并武汉代码、问答界面查看详细信息bug

Rmengdi 4 сар өмнө
parent
commit
ed9cbd5bbb

+ 28 - 15
src/components/FittingsModal/index.js

@@ -6,35 +6,48 @@ export const defaultProps = {
 export const columns = (_this) => [
   {
     prop: 'aircaftCatalogCode',
-    label: '飞机编号'
+    label: '飞机编号',
+    width: '140px'
   },
   {
     prop: 'aircaftModelName',
-    label: '所属机型'
+    label: '所属机型',
+    width: '140px'
   },
   {
     prop: 'aircaftTypeName',
-    label: '所属机种'
+    label: '所属机种',
+    width: '140px'
   },
-
   {
     prop: 'mechanician',
-    label: '机械师'
+    label: '机械师',
+    width: '140px'
+  },
+  {
+    prop: 'healthStatus',
+    label: '飞机健康状态',
+    width: '140px',
+    render: (h, params) => {
+      //根据healthStatus值显示健康或故障
+      const statusText = params.row.healthStatus === '已完成' ? '健康' : '故障'
+      const statusClass = params.row.healthStatus === '已完成' ? 'success-state' : 'warning-state'
+      return h('span', { class: statusClass }, statusText)
+    }
   },
   {
     button: true,
     label: '操作',
-    width: '240px',
     group: [
-      {
-        name: '查看健康状态',
-        type: 'text',
-        round: false,
-        plain: false,
-        onClick: (row, index, scope) => {
-          _this.look(row)
-        }
-      },
+      // {
+      //   name: '查看健康状态',
+      //   type: 'text',
+      //   round: false,
+      //   plain: false,
+      //   onClick: (row, index, scope) => {
+      //     _this.look(row)
+      //   }
+      // },
       {
         name: '确定',
         type: 'text',

+ 28 - 34
src/components/FittingsModal/index.vue

@@ -9,17 +9,19 @@
       </div>
     </div>
     <!-- 查看飞机健康状态 -->
-    <FaultStatisticsDialog ref="FaultStatisticsDialog" />
+    <!-- <FaultStatisticsDialog ref="FaultStatisticsDialog" /> -->
   </el-dialog>
 </template>
 
 <script>
 import { columns, options, defaultProps } from './index.js'
 import { getAircaftTypeAndModelTree, getAircraftsByCode } from '@/api/task/carrierFlightMission'
-import FaultStatisticsDialog from './FaultStatisticsDialog/index.vue'
+// import FaultStatisticsDialog from './FaultStatisticsDialog/index.vue'
+//获取飞机健康状态接口
+import { getFaultStatisticsList } from '@/api/task/carrierFlightMission'
 export default {
   name: 'FittingsModal',
-  components: { FaultStatisticsDialog },
+  // components: { FaultStatisticsDialog },
   props: { taskId: {} },
   data() {
     // 这里存放数据
@@ -27,7 +29,7 @@ export default {
       currentNodeKey: '',
       currentRow: null,
       menuTreeData: [],
-      columns: columns(this),
+      columns: columns(this), //列定义获取方式
       options,
       dialogTableData: [],
       defaultProps,
@@ -61,6 +63,26 @@ export default {
       if (code == 200) {
         this.dialogTableData = data.list
         this.tableRequset.total = data.totalCount
+        debugger
+
+        //获取飞机故障统计集合
+        const { code: healthCode, data: healthData } = await getFaultStatisticsList()
+        if (healthCode == 200) {
+          //创建每架飞机的健康状态映射对象
+          const healthStatusMap = {}
+          healthData.forEach((item) => {
+            healthStatusMap[item.aircraftNum] = item.repairStatus
+          })
+          this.dialogTableData.forEach(async (aircraft) => {
+            aircraft.healthStatus = healthStatusMap[aircraft.aircaftCatalogCode] || ''
+          })
+        } else {
+          this.dialogTableData.forEach(async (aircraft) => {
+            aircraft.healthStatus = ''
+          })
+        }
+        //强制更新列定义
+        this.columns = this.getColums()
       }
     },
     async getAircaftTypeAndModelTree() {
@@ -84,37 +106,9 @@ export default {
     select(row) {
       this.$emit('select', row)
       this.fittingsVisible = false
-    },
-    look(row) {
-      this.$refs.FaultStatisticsDialog.opneDialog(row)
     }
-    // onFaultStatisticsDialogOpen() {
-    //   const modal = document.querySelector('.el-dialog__modal')
-    //   if (modal) {
-    //     modal.style.position = 'absolute'
-    //     modal.style.zIndex = 999
-
-    //     const dialog = this.$refs.FaultStatisticsDialog.$el
-    //     const rect = dialog.getBoundingClientRect()
-    //     modal.style.top = rect.top + 'px'
-    //     modal.style.left = rect.left + 'px'
-    //     modal.style.width = rect.width + 'px'
-    //     modal.style.height = rect.height + 'px'
-    //   }
-    // },
-    // onFaultStatisticsDialogClose() {
-    //   const modal = document.querySelector('.el-dialog__modal')
-    //   if (modal) {
-    //     modal.style.position = 'fixed'
-    //     modal.style.zIndex = 2000
-
-    //     const dialog = this.$refs.FaultStatisticsDialog.$el
-    //     const rect = dialog.getBoundingClientRect()
-    //     modal.style.top = '0'
-    //     modal.style.left = '0'
-    //     modal.style.width = '100%'
-    //     modal.style.height = '100%'
-    //   }
+    // look(row) {
+    //   this.$refs.FaultStatisticsDialog.opneDialog(row)
     // }
   }
 }

+ 1 - 1
src/views/als/intelligentQA/index.scss

@@ -26,7 +26,7 @@
     width: 100%;
     box-sizing: border-box;
     height: calc(100vh - 300px);
-    overflow: hidden;
+    overflow-y: scroll;
     padding: 0px 20px;
 
     .historyItem{

+ 5 - 3
src/views/als/intelligentQA/index.vue

@@ -202,7 +202,7 @@ export default {
     async getHistoryAll() {
       try {
         const { data } = await getQAHistoryListAll()
-        this.historyData = data
+        this.historyData = data.slice(0, 20)
         // console.log('this.historyData', this.historyData)
       } catch (error) {}
     },
@@ -210,7 +210,7 @@ export default {
     async getGroupAPI() {
       try {
         const { data } = await getGroup()
-        this.statisticsData = data
+        this.statisticsData = data.slice(0, 10)
       } catch (error) {}
     },
 
@@ -325,7 +325,9 @@ export default {
             question: data.question,
             userId: data.userId
           })
-          this.sqlAnswerKey = Object.keys(newData.sqlAnswer[0])
+          if (newData.sqlAnswer) {
+            this.sqlAnswerKey = Object.keys(newData.sqlAnswer[0])
+          }
           this.chatInfo.push(newData)
         }
       } catch (error) {}

+ 17 - 0
src/views/basicData/dataSailingMaterialMaterialCoding/index.vue

@@ -20,6 +20,7 @@
             :disabled="tableCheckItems.length == 0"
             >删除</el-button
           >
+          <el-button type="primary" @click="selfMotionMapCode">自动映射编码</el-button>
           <el-dropdown split-button type="primary" style="margin-left: 10px" trigger="click" @command="handleExportBtn">
             更多
             <el-dropdown-menu slot="dropdown">
@@ -56,6 +57,7 @@ import { defaultProps, columns, options, modalConfig } from './index'
 import { debounce } from '@/utils/index'
 import MappingCoding from './mappingCoding/index.vue'
 import ImportDialog from './importDialog/index.vue'
+import { autoMapping } from '@/api/task/carrierFlightMission'
 import Vue from 'vue'
 export default {
   name: 'dataSailingMaterialMaterialCoding',
@@ -321,6 +323,21 @@ export default {
           break
       }
     },
+    selfMotionMapCode() {
+      this.$confirm('是否自动映射所有编码', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(async () => {
+          const { code, data } = await autoMapping()
+          if (code == 200) {
+            this.fetchTableData()
+            useMessage('success', '映射成功', 1000)
+          }
+        })
+        .catch(() => {})
+    },
     //更多按钮
     handleExportBtn(type) {
       this[type]()

+ 17 - 0
src/views/basicData/dataSailingMaterialMaterialCodingAviation/index.vue

@@ -20,6 +20,7 @@
             :disabled="tableCheckItems.length == 0"
             >删除</el-button
           >
+          <el-button type="primary" @click="selfMotionMapCode">自动映射编码</el-button>
           <el-dropdown split-button type="primary" style="margin-left: 10px" trigger="click" @command="handleExportBtn">
             更多
             <el-dropdown-menu slot="dropdown">
@@ -53,6 +54,7 @@ import { debounce } from '@/utils/index'
 import { getAvmatCategoriesTree, getAvmatCatalog, queryByCodeOrName } from '@/api/basicData/dataSpecies'
 import { addAvmatCatalog, editAvmatCatalog, removeAvmatCatalog, downLoadFile, exportExcel } from '@/api/basicData/dataSailingMaterialMaterialCoding'
 import ImportDialog from './importDialog/index.vue'
+import { autoMapping } from '@/api/task/carrierFlightMission'
 import Vue from 'vue'
 export default {
   name: 'dataSailingMaterialMaterialCoding',
@@ -251,6 +253,21 @@ export default {
           break
       }
     },
+    selfMotionMapCode() {
+      this.$confirm('是否自动映射所有编码', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(async () => {
+          const { code, data } = await autoMapping()
+          if (code == 200) {
+            this.fetchTableData()
+            useMessage('success', '映射成功', 1000)
+          }
+        })
+        .catch(() => {})
+    },
     //更多按钮
     handleExportBtn(type) {
       this[type]()