ソースを参照

Merge branch 'dev-rmd2' of Rmengdi/LQBZ_web into master

Rmengdi 6 ヶ月 前
コミット
76bce95f15

+ 0 - 48
src/api/als/communication.js

@@ -15,51 +15,3 @@ export const updateCommunication = async (data) => {
 export const removeCommunication = async (data) => {
   return await deletes('/als/communication/' + data)
 }
-
-//下载模板
-export const downLoadFile = async (data) => {
-  window.open(process.env.VUE_APP_BASE_API + '/basicdata/aircaftModel/downLoadFile')
-}
-//导出
-export const exportExcel = async (data) => {
-  window.open(process.env.VUE_APP_BASE_API + `/basicdata/aircaftModel/exportExcel?aircaftTypeId=${data.aircaftTypeId}&queryParam=${data.queryParam}`)
-}
-
-// --------------------------
-export const addAircaftType = async (data) => {
-  return await post('/basicdata/aircaftType/addAircaftType', data)
-}
-
-export const updateAircaftType = async (data) => {
-  return await post('/basicdata/aircaftType/updateAircaftType', data)
-}
-
-export const removeAircaftType = async (data) => {
-  return await post('/basicdata/aircaftType/removeAircaftType', data)
-}
-
-//下载模板
-export const downLoadAircaftTypeFile = async (data) => {
-  window.open(process.env.VUE_APP_BASE_API + '/basicdata/aircaftType/downLoadFile')
-}
-//导出
-export const exportAircaftTypeExcel = async (data) => {
-  window.open(process.env.VUE_APP_BASE_API + `/basicdata/aircaftType/exportExcel?queryParam=${data.queryParam}`)
-}
-
-// --------------------------------------------------------------------------------------------
-export const getAvmatCategoriesTree = async (data) => {
-  return await get('/basicdata/avmatcategories/getAvmatCategoriesTree', data)
-}
-
-export const getAvmatCatalog = async (data) => {
-  return await post('/basicdata/avmatCatalog/getAvmatCatalog', data)
-}
-
-export const queryByCodeOrName = async (data) => {
-  return await post('/basicdata/avmatCatalog/queryByCodeOrName', data)
-}
-
-export const getAircaftType = async (data) => {
-  return await get('/basicdata/aircaftType/getAircaftType', data)
-}

+ 1 - 2
src/api/als/faultCase.js

@@ -2,12 +2,11 @@ import { get, put, post, deletes } from '@/http/index'
 
 // 查询故障案例列表
 export const getFaultCase = async (data) => {
-  return await get('/als/faultCase/list', data)
+  return await get('/als/faultCase/esList', data)
 }
 
 // 新增故障案例
 export const addFaultCase = async (data) => {
-  data.viewCount = '0'
   return await post('/als/faultCase', data)
 }
 

+ 10 - 0
src/api/als/intelligentQA.js

@@ -14,6 +14,11 @@ export const getQAHistoryList = async (data) => {
   return await get('/als/qaHistory/list', data)
 }
 
+// 查询问答历史记录列表不分页
+export const getQAHistoryListAll = async (data) => {
+  return await get('/als/qaHistory/list/all', data)
+}
+
 // 获取问答历史记录详细信息
 export const getQAHistoryDetail = async (id) => {
   return await get('/als/qaHistory/' + id)
@@ -28,3 +33,8 @@ export const addQAHistory = async (data) => {
 export const removeQAHistory = async (id) => {
   return await deletes('/als/qaHistory/' + id)
 }
+
+// 统计列表
+export const getGroup = async (data) => {
+  return await get('/als/qaHistory/group', data)
+}

+ 2 - 13
src/layout/components/NavBar/menu.vue

@@ -8,19 +8,8 @@
 import MenuItem from './MenuItem.vue'
 export default {
   name: 'Menu',
-  computed: {
-    mainMenu() {
-      return this.$router.getRoutes()
-    },
-    newRoute() {
-      this.mainMenu.forEach((item, key) => {
-        if (item.path === '/faultStatisticsEcharts') {
-          delete this.mainMenu[key]
-        }
-      })
-      const froutes = filterRoutes(this.mainMenu)
-      return changeSortMenus(generteMenus(froutes))
-    }
+  components: {
+    MenuItem
   },
   props: {
     treeData: {

+ 2 - 2
src/router/modules/faultDiagnosis.js

@@ -18,7 +18,7 @@ export default [
     children: [
       {
         name: 'FalseAlarm',
-        path: '/qualityManage/falseAlarm',
+        path: '/falseAlarm',
         component: () => import('@/views/als/falseAlarm/index.vue'),
         meta: {
           parent: 'FaultManage',
@@ -27,7 +27,7 @@ export default [
       },
       {
         name: 'FaultDiagnosis',
-        path: '/qualityManage/faultDiagnosis',
+        path: '/faultDiagnosis',
         component: () => import('@/views/als/faultDiagnosis/index.vue'),
         meta: {
           parent: 'FaultManage',

+ 18 - 10
src/router/modules/faultStatistics.js

@@ -1,14 +1,14 @@
 import Layout from '@/layout/index.vue'
 /**
  *
- * FalseAlarm               故障统计
+ * FaultStatistics               故障统计
  */
 
 export default [
   {
-    name: 'FaultStatistics',
-    path: '/als/',
-    redirect: '/als/falseAlarm',
+    name: 'Fault',
+    path: '/fault',
+    redirect: '/fault/',
     component: Layout,
     meta: {
       title: '故障统计'
@@ -16,13 +16,21 @@ export default [
     children: [
       {
         name: 'FaultStatistics',
-        path: '/als/falseAlarm',
-        component: () => import('@/views/als/falseAlarm/index.vue'),
+        path: '/faultStatistics',
+        component: () => import('@/views/als/faultStatistics/index.vue'),
         meta: {
-          roleMenuHide: true,
-          parent: 'FaultStatistics',
-          title: '故障统计',
-          icon: 'el-icon-s-platform'
+          // roleMenuHide: true,
+          parent: 'Fault',
+          title: '故障数据'
+        }
+      },
+      {
+        name: 'faultStatisticsEcharts',
+        path: '/faultStatisticsEcharts',
+        component: () => import('@/views/als/faultStatistics/echarts.vue'),
+        meta: {
+          parent: 'Fault',
+          title: '故障统计'
         }
       }
     ]

+ 7 - 7
src/router/modules/lifePrediction.js

@@ -1,8 +1,8 @@
 import Layout from '@/layout/index.vue'
 /**
  *
- * FalseAlarm               有寿件管理
- * FaultDiagnosis           退化分析
+ * LifetimeSpareParts               有寿件管理
+ * LifePrediction           退化分析/寿命预测
  */
 
 export default [
@@ -17,17 +17,17 @@ export default [
     },
     children: [
       {
-        name: 'FalseAlarm',
-        path: '/qualityManage/falseAlarm',
-        component: () => import('@/views/als/falseAlarm/index.vue'),
+        name: 'LifetimeSpareParts',
+        path: '/lifetimeSpareParts',
+        component: () => import('@/views/als/lifetimeSpareParts/index.vue'),
         meta: {
           parent: 'LifeManage',
           title: '有寿件管理'
         }
       },
       {
-        name: 'FaultDiagnosis',
-        path: '/qualityManage/faultDiagnosis',
+        name: 'LifePrediction',
+        path: '/lifePrediction',
         component: () => import('@/views/als/lifePrediction/index.vue'),
         meta: {
           parent: 'LifeManage',

+ 8 - 8
src/router/modules/maintenanceDecision.js

@@ -1,8 +1,8 @@
 import Layout from '@/layout/index.vue'
 /**
  *
- * FalseAlarm               有寿件管理
- * FaultDiagnosis           退化分析
+ * FaultCase               故障字典
+ * IntelligentQA           智能辅助决策
  */
 
 export default [
@@ -17,18 +17,18 @@ export default [
     },
     children: [
       {
-        name: 'FalseAlarm',
-        path: '/qualityManage/falseAlarm',
-        component: () => import('@/views/als/falseAlarm/index.vue'),
+        name: 'FaultCase',
+        path: '/faultCase',
+        component: () => import('@/views/als/faultCase/index.vue'),
         meta: {
           parent: 'MaintenanceDecision',
           title: '故障字典'
         }
       },
       {
-        name: 'IntelligentDecision',
-        path: '/qualityManage/maintenanceDecision',
-        component: () => import('@/views/als/maintenanceDecision/index.vue'),
+        name: 'IntelligentQA',
+        path: '/intelligentQA',
+        component: () => import('@/views/als/intelligentQA/index.vue'),
         meta: {
           parent: 'MaintenanceDecision',
           title: '智能辅助决策'

+ 15 - 72
src/router/modules/system.js

@@ -228,9 +228,9 @@ export default [
         }
       },
       {
-        name: 'MDCData',
-        path: '/dataManage/MDCData',
-        component: () => import('@/views/als/MDCData/index.vue'),
+        name: 'JudgeFaultLogic',
+        path: '/dataManage/judgeFaultLogic',
+        component: () => import('@/views/als/judgeFaultLogic/index.vue'),
         meta: {
           parent: 'BasicData',
           title: '判故逻辑管理'
@@ -348,73 +348,16 @@ export default [
           parent: 'SystemConfig',
           title: '系统备份'
         }
+      },
+      {
+        name: 'SystemCommunication',
+        path: '/system/systemCommunication',
+        component: () => import('@/views/als/systemCommunication/index.vue'),
+        meta: {
+          parent: 'SystemConfig',
+          title: '通讯管理'
+        }
       }
-    }
-  ]
-
-
-export const systemRole = {
-  path: '/system',
-  redirect: '/system/program',
-  component: Layout,
-  name: 'SystemRole',
-  meta: {
-    title: '系统管理',
-    icon: 'el-icon-s-platform'
-  },
-  sort: 11,
-  children: [
-    {
-      path: '/system/role',
-      component: () => import('@/views/system/role/index.vue'),
-      meta: {
-        title: '角色管理'
-      },
-      sort: 5
-    }
-  ]
-}
-
-export const systemBackup = {
-  path: '/system',
-  redirect: '/system/program',
-  component: Layout,
-  name: 'SystemBackup',
-  meta: {
-    title: '系统管理',
-    icon: 'el-icon-s-platform'
-  },
-  sort: 11,
-  children: [
-    {
-      path: '/system/systemBackup',
-      component: () => import('@/views/system/systemBackup/index.vue'),
-      meta: {
-        title: '系统备份'
-      },
-      sort: 6
-    }
-  ]
-}
-
-export const systemCommunication = {
-  path: '/system',
-  redirect: '/system/program',
-  component: Layout,
-  name: 'systemCommunication',
-  meta: {
-    title: '系统管理',
-    icon: 'el-icon-s-platform'
-  },
-  sort: 11,
-  children: [
-    {
-      path: '/system/systemCommunication',
-      component: () => import('@/views/als/systemCommunication/index.vue'),
-      meta: {
-        title: '通讯管理'
-      },
-      sort: 6
-    }
-  ]
-}
+    ]
+  }
+]

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

@@ -58,7 +58,7 @@ import PlayBackChart from '@/views/als/components/Charts/playBackChart.vue'
 import { deepClone, debounce } from '@/utils/index'
 
 export default {
-  name: 'DataImport',
+  name: 'FalseAlarm',
   components: { PlayBackChart },
   data() {
     // 这里存放数据

+ 211 - 127
src/views/als/faultCase/index.vue

@@ -1,13 +1,21 @@
 <template>
   <div class="view-table-content">
-    <div class="view-dataSpecies-right">
+    <div style="width: 100%">
       <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>
+          <el-dropdown split-button type="primary" style="margin-left: 10px" trigger="click" @command="handleExport">
+            更多
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item command="handleImport">导入</el-dropdown-item>
+              <el-dropdown-item command="handleExport" :disabled="tableData.length == 0">导出</el-dropdown-item>
+              <el-dropdown-item command="importTemplate">下载数据模板</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
         </div>
         <div class="view-dataType-title-search">
-          <el-input placeholder="请输入故障名称" v-model="keyWordData" class="input1">
+          <el-input placeholder="请输入故障现象" v-model="keyWordData" class="input1">
             <el-button slot="append" icon="el-icon-search" @click="searchClick(keyWordData)"></el-button>
           </el-input>
         </div>
@@ -18,48 +26,21 @@
       <!-- 添加或修改故障案例对话框 -->
       <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="id">
-            <el-input v-model="form.id" placeholder="请输入序号" />
-          </el-form-item>
-          <el-form-item label="飞机编号" prop="aircraftTypeId">
-            <el-input v-model="form.aircraftTypeId" placeholder="请输入飞机编号" />
-          </el-form-item>
           <el-form-item label="机型" prop="aircraftTypeName">
-            <el-input v-model="form.aircraftTypeName" placeholder="请输入机型" />
-          </el-form-item>
-          <el-form-item label="系统编号" prop="aircraftSystemId">
-            <el-input v-model="form.aircraftSystemId" placeholder="请输入系统编号" />
+            <treeselect :value="form.aircraftTypeName" :normalizer="aircraftTypeNormalizer" :options="aircraftTypeTreeData" :show-count="true" placeholder="请选择机型" @select="aircraftTypeChange" />
           </el-form-item>
           <el-form-item label="系统" prop="aircraftSystemName">
             <el-input v-model="form.aircraftSystemName" placeholder="请输入系统" />
           </el-form-item>
-          <el-form-item label="分系统编号" prop="aircraftSubsystemId">
-            <el-input v-model="form.aircraftSubsystemId" placeholder="请输入分系统编号" />
-          </el-form-item>
           <el-form-item label="分系统" prop="aircraftSubsystemName">
             <el-input v-model="form.aircraftSubsystemName" placeholder="请输入分系统" />
           </el-form-item>
-          <el-form-item label="作者" prop="author">
-            <el-input v-model="form.author" placeholder="请输入作者" />
-          </el-form-item>
           <el-form-item label="故障现象" prop="faultPhenomenon">
             <el-input v-model="form.faultPhenomenon" placeholder="请输入故障现象" />
           </el-form-item>
           <el-form-item label="故障原因" prop="faultCause">
             <el-input v-model="form.faultCause" placeholder="请输入故障原因" />
           </el-form-item>
-          <el-form-item label="故障树" prop="faultTreePath">
-            <FileUpload v-model="form.faultTreePath" :limit="1" :fileSize="500" :fileType="['jpg', 'jpeg', 'png']" />
-          </el-form-item>
-          <el-form-item label="故障图" prop="faultPicturePath">
-            <FileUpload v-model="form.faultPicturePath" :limit="1" :fileSize="500" :fileType="['jpg', 'jpeg', 'png']" />
-          </el-form-item>
-          <el-form-item label="排故方法" prop="troubleshootingMethodPath">
-            <el-input v-model="form.troubleshootingMethodPath" placeholder="请输入排故方法" />
-          </el-form-item>
-          <el-form-item label="排序" prop="orderBy">
-            <el-input v-model="form.orderBy" placeholder="请输入排序" />
-          </el-form-item>
         </el-form>
 
         <span slot="footer" class="dialog-footer">
@@ -70,23 +51,45 @@
 
       <el-dialog title="故障案例详情" :visible.sync="detailVisible" width="1000px" :show-close="false">
         <el-descriptions border>
-          <el-descriptions-item label="飞机编号">{{ form.aircraftTypeId }}</el-descriptions-item>
-          <el-descriptions-item label="机型">{{ form.aircraftTypeName }}</el-descriptions-item>
-          <el-descriptions-item label="系统编号">{{ form.aircraftSystemId }}</el-descriptions-item>
+          <el-descriptions-item label="机型">{{ detailAircraftType }}</el-descriptions-item>
           <el-descriptions-item label="系统">{{ form.aircraftSystemName }}</el-descriptions-item>
-          <el-descriptions-item label="分系统编号">{{ form.aircraftSubsystemId }}</el-descriptions-item>
           <el-descriptions-item label="分系统">{{ form.aircraftSubsystemName }}</el-descriptions-item>
-          <el-descriptions-item label="作者">{{ form.author }}</el-descriptions-item>
           <el-descriptions-item label="故障现象">{{ form.faultPhenomenon }}</el-descriptions-item>
           <el-descriptions-item label="故障原因">{{ form.faultCause }}</el-descriptions-item>
-          <el-descriptions-item :span="1" label="排故方法">{{ form.troubleshootingMethodPath }}</el-descriptions-item>
+          <!-- <el-descriptions-item :span="1" label="排故方法">{{ form.troubleshootingMethodPath }}</el-descriptions-item>
           <el-descriptions-item label="故障图"><img :src="faultPicturePathUrl" width="200px" /></el-descriptions-item>
-          <el-descriptions-item label="故障树"><img :src="faultPicturePathUrl" width="200px" /></el-descriptions-item>
+          <el-descriptions-item label="故障树"><img :src="faultPicturePathUrl" width="200px" /></el-descriptions-item> -->
         </el-descriptions>
         <span slot="footer" class="dialog-footer">
           <el-button @click="detailSubmit">确 定</el-button>
         </span>
       </el-dialog>
+
+      <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+        <el-upload
+          ref="upload"
+          :limit="1"
+          accept=".xlsx, .xls"
+          :headers="upload.headers"
+          :action="upload.url + '?updateSupport=' + upload.updateSupport"
+          :disabled="upload.isUploading"
+          :on-progress="handleFileUploadProgress"
+          :on-success="handleFileSuccess"
+          :auto-upload="false"
+          drag
+        >
+          <i class="el-icon-upload"></i>
+          <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+          <div class="el-upload__tip text-center" slot="tip">
+            <div class="el-upload__tip" slot="tip"><el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据</div>
+            <span>仅允许导入xls、xlsx格式文件。</span>
+          </div>
+        </el-upload>
+        <div slot="footer" class="dialog-footer">
+          <el-button type="primary" @click="submitFileForm">确 定</el-button>
+          <el-button @click="upload.open = false">取 消</el-button>
+        </div>
+      </el-dialog>
     </div>
   </div>
 </template>
@@ -95,11 +98,16 @@
 import { getFaultCase, addFaultCase, updateFaultCase, removeFaultCase } from '@/api/als/faultCase'
 import { deepClone, debounce } from '@/utils/index'
 import { getListByIdsApi } from '@/api/als/oss'
-import FileUpload from '@/views/als/components/FileUpload'
+import { getItem } from '@/utils/index'
+import { getAircaftTypeAndModelTree } from '@/api/als/sideTree'
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import { flattenTree, download } from '../utils/common'
+// import FileUpload from '@/views/als/components/FileUpload'
 
 export default {
   name: 'FaultCase',
-  components: { FileUpload },
+  components: { Treeselect },
   data() {
     // 这里存放数据
     return {
@@ -117,54 +125,68 @@ export default {
       },
       searchValue: '',
       columns: [
-        {
-          prop: 'aircraftTypeId',
-          label: '机型编号'
-        },
         {
           prop: 'aircraftTypeName',
-          label: '机型'
-        },
-        {
-          prop: 'aircraftSystemId',
-          label: '系统编号'
+          label: '机型',
+          render: (h, params) => {
+            const matchedItem = this.aircraftTypeAll.find((item) => params.row.aircraftTypeName.trim() === item.id.trim())
+            if (matchedItem) {
+              return h('span', matchedItem.label)
+            } else {
+              return h('span', {}, '')
+            }
+          }
         },
         {
           prop: 'aircraftSystemName',
           label: '系统'
         },
-        {
-          prop: 'aircraftSubsystemId',
-          label: '分系统编号'
-        },
         {
           prop: 'aircraftSubsystemName',
           label: '分系统'
         },
-        {
-          prop: 'author',
-          label: '作者'
-        },
         {
           prop: 'faultPhenomenon',
-          label: '故障现象'
+          label: '故障现象',
+          render: (h, params) => {
+            return h('span', {
+              domProps: {
+                innerHTML: params.row.faultPhenomenon ? params.row.faultPhenomenon : params.row.pcontent
+              }
+            })
+          }
         },
         {
           prop: 'faultCause',
-          label: '故障原因'
+          label: '故障原因',
+          render: (h, params) => {
+            return h('span', {
+              domProps: {
+                innerHTML: params.row.faultCause ? params.row.faultCause : params.row.fcontent
+              }
+            })
+          }
+        },
+        {
+          prop: 'viewCount',
+          label: '浏览次数'
         },
         // {
-        //   prop: 'faultTreePath',
-        //   label: '故障树'
+        //   prop: 'createBy',
+        //   label: '创建人'
         // },
         // {
-        //   prop: 'faultPicturePath',
-        //   label: '故障图'
+        //   prop: 'createTime',
+        //   label: '创建时间'
+        // },
+        // {
+        //   prop: 'updateBy',
+        //   label: '最后修改人'
+        // },
+        // {
+        //   prop: 'updateTime',
+        //   label: '最后修改时间'
         // },
-        {
-          prop: 'troubleshootingMethodPath',
-          label: '排故方法'
-        },
         {
           button: true,
           label: '操作',
@@ -202,11 +224,11 @@ export default {
       ],
 
       options: {
-        stripe: true, // 斑马纹
-        mutiSelect: true, // 多选框
-        index: false, // 显示序号, 多选则 mutiSelect
-        loading: false, // 表格动画
-        initTable: false, // 是否一挂载就加载数据
+        stripe: true,
+        mutiSelect: false,
+        index: true,
+        loading: false,
+        initTable: false,
         border: true,
         height: 'calc(100vh - 300px)'
       },
@@ -219,49 +241,35 @@ export default {
         searchValue: ''
       },
       form: {
-        id: '',
-        aircraftTypeId: '',
-        aircraftTypeName: '',
-        aircraftSystemId: '',
+        aircraftTypeName: null,
         aircraftSystemName: '',
-        aircraftSubsystemId: '',
         aircraftSubsystemName: '',
-        author: '',
         faultPhenomenon: '',
         faultCause: '',
         faultTreePath: '',
         faultPicturePath: '',
         troubleshootingMethodPath: '',
-        viewCount: '1',
-        orderBy: '',
-        tenantId: '',
-        version: '',
-        delFlag: '',
+        viewCount: 0,
         createBy: '',
         createTime: '',
         updateBy: '',
         updateTime: ''
       },
       debounceFn: debounce(this.fetch, 500),
-      aircaftModelAll: [],
-      aircaftCatalogAll: [],
-      systemItemList: [{ id: 1, label: '特设' }],
-      levelList: [
-        { id: 1, label: '一般故障' },
-        { id: 2, label: '较大故障' },
-        { id: 3, label: '重大故障' }
-      ],
-      faultCauseTypeList: [
-        { id: 1, label: '设计原因' },
-        { id: 2, label: '制造原因' },
-        { id: 3, label: '使用维护' },
-        { id: 4, label: '成品维护' },
-        { id: 5, label: '其他原因' }
-      ],
-      detailAircraftType: '',
-      detailAircraftCode: '',
       faultPicturePathUrl: '',
-      faultTreePathUrl: ''
+      faultTreePathUrl: '',
+      upload: {
+        open: false,
+        title: '',
+        isUploading: false,
+        updateSupport: 0,
+        headers: { Authorization: getItem('token') },
+        // 上传的地址
+        url: '/api/als/faultCase/importData'
+      },
+      aircraftTypeTreeData: [],
+      aircraftTypeAll: [],
+      detailAircraftType: ''
     }
   },
   watch: {
@@ -271,6 +279,7 @@ export default {
     }
   },
   mounted() {
+    this.getAirTypeData()
     this.getFaultCaseAPI()
   },
   methods: {
@@ -282,11 +291,12 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          await this.getFaultCaseAPI({ faultCaseCodes: this.faultCaseCodes })
+          await this.getFaultCaseAPI({ faultPhenomenon: keyWordData })
           this.handleClose()
         }
       } catch (error) {}
     },
+
     async getFaultCaseAPI(params) {
       if (this.$refs.table) this.$refs.table.clearSelection()
       const { keyWord } = this
@@ -298,16 +308,25 @@ export default {
       this.tableRequset.total = total
     },
 
+    async getAirTypeData() {
+      try {
+        const { data } = await getAircaftTypeAndModelTree()
+        this.aircraftTypeTreeData = data[0].children
+        this.aircraftTypeAll = flattenTree(data[0].children)
+      } catch (error) {}
+    },
+
     async getFaultCaseByEsAPI(keyWordData) {
       console.log(keyWordData)
     },
 
     fetch() {
-      this.getFaultCaseAPI({ faultCaseCodes: this.aircaftModelIdList })
+      this.getFaultCaseAPI({ faultPhenomenon: keyWordData })
     },
 
     async searchClick(keyWordData) {
-      this.getFaultCaseByEsAPI(keyWordData)
+      // this.getFaultCaseByEsAPI(keyWordData)
+      this.getFaultCaseAPI({ faultPhenomenon: keyWordData })
     },
 
     async addFaultCaseAPI() {
@@ -316,10 +335,12 @@ export default {
         if (code === 200) {
           this.$message({
             type: 'success',
-            message: '操作成功!'
+            duration: 3000,
+            message: 'ES数据同步中,稍后查询!'
           })
+
           this.handleClose()
-          this.getFaultCaseAPI({ faultCaseCodes: this.aircaftModelIdList })
+          this.getFaultCaseAPI({ faultPhenomenon: keyWordData })
         }
       } catch (error) {}
     },
@@ -333,7 +354,7 @@ export default {
             message: '操作成功!'
           })
           this.handleClose()
-          this.getFaultCaseAPI({ faultCaseCodes: this.aircaftModelIdList })
+          this.getFaultCaseAPI({ faultPhenomenon: keyWordData })
         }
       } catch (error) {}
     },
@@ -343,21 +364,22 @@ export default {
       this.dialogVisible = true
     },
 
+    aircraftTypeChange(node) {
+      this.form.aircraftTypeName = node.id
+    },
+
     handleClose() {
       this.dialogVisible = false
       this.form = {
-        id: '',
-        aircraftType: '',
-        faultCode: '',
-        faultName: '',
-        location: '',
-        level: '',
-        symptoms: '',
+        aircraftTypeName: null,
+        aircraftSystemName: '',
+        aircraftSubsystemName: '',
+        faultPhenomenon: '',
         faultCause: '',
-        remarks: '',
-        tenantId: '',
-        version: '',
-        delFlag: '',
+        faultTreePath: '',
+        faultPicturePath: '',
+        troubleshootingMethodPath: '',
+        viewCount: 0,
         createBy: '',
         createTime: '',
         updateBy: '',
@@ -368,6 +390,8 @@ export default {
     handUpdate(row) {
       this.dialogTitle = '编辑'
       this.form = deepClone(row)
+      this.form.faultPhenomenon = row.pcontent
+      this.form.faultCause = row.fcontent
       this.dialogVisible = true
     },
 
@@ -382,6 +406,17 @@ export default {
       }
     },
 
+    aircraftTypeNormalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children
+      }
+      return {
+        id: node.id,
+        label: node.label,
+        children: node.children
+      }
+    },
+
     selection(val) {
       this.tableCheckItems = val
     },
@@ -400,21 +435,70 @@ export default {
 
     async checkDetails(row) {
       this.form = deepClone(row)
-      if (row.faultPicturePath) {
-        const res = await getListByIdsApi(row.faultPicturePath)
-        this.faultPicturePathUrl = res.data[0].url
-        const res2 = await getListByIdsApi(row.faultTreePath)
-        this.faultTreePathUrl = res.data[0].url
-      } else {
-        this.faultPicturePathUrl = row.faultPicturePath
-        this.faultTreePathUrl = row.faultTreePathUrl
-      }
+      const matchedItem = this.aircraftTypeAll.find((item) => row.aircraftTypeName.trim() === item.id.trim())
+      this.detailAircraftType = matchedItem.label
+      // if (row.faultPicturePath) {
+      //   const res = await getListByIdsApi(row.faultPicturePath)
+      //   this.faultPicturePathUrl = res.data[0].url
+      //   const res2 = await getListByIdsApi(row.faultTreePath)
+      //   this.faultTreePathUrl = res.data[0].url
+      // } else {
+      //   this.faultPicturePathUrl = row.faultPicturePath
+      //   this.faultTreePathUrl = row.faultTreePathUrl
+      // }
+      this.form.faultPhenomenon = row.pcontent
+      this.form.faultCause = row.fcontent
       this.detailVisible = true
-      this.form = deepClone(row)
+      this.addViewCount(row)
+      // this.form = deepClone(row)
     },
+
+    async addViewCount(row) {
+      try {
+        await updateFaultCase({ id: row.id, viewCount: ++row.viewCount })
+      } catch (error) {}
+    },
+
     detailSubmit() {
       this.handleClose()
       this.detailVisible = false
+    },
+
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = '警告列表导入'
+      this.upload.open = true
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      download('/faultCase/importTemplate', {}, `faultCase_template_${new Date().getTime()}.xlsx`)
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      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 })
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit()
+    },
+    // 导出
+    handleExport() {
+      download(
+        '/faultCase/export',
+        {
+          ...this.form
+        },
+        `faultCase_${new Date().getTime()}.xlsx`
+      )
     }
   }
 }

+ 1 - 1
src/views/als/faultStatistics/echarts.vue

@@ -65,7 +65,7 @@ import { getFaultStatisticsListAll, getAircaftTypeAndModelTree, removeFaultStati
 import { debounce } from '@/utils/index'
 import * as echarts from 'echarts'
 export default {
-  name: 'FaultStatistics',
+  name: 'FaultStatisticsEcharts',
   data() {
     // 这里存放数据
     return {

+ 48 - 0
src/views/als/intelligentQA/index.scss

@@ -36,6 +36,7 @@
       overflow: hidden;
 
       .historyMore{
+        font-size: 1.2rem;
         float: right;
         height: 40px;
         line-height: 40px;
@@ -48,6 +49,53 @@
   }
   
 }
+.statistics{
+  .statisticsTitle{
+    height: 50px;
+    line-height: 50px;
+    text-align: center;
+  }
+  .statisticsContent{
+    width: 100%;
+    box-sizing: border-box;
+    height: calc(100vh - 300px);
+    overflow: hidden;
+    padding: 0px 20px;
+
+    .statisticsItem{
+      height: 40px;
+      width: 100%;
+      line-height: 40px;
+      overflow: hidden;
+      position: relative;
+    }
+
+    li:after{
+      content: "";
+      display: inline-block;
+      width: 20px;
+      height: 20px;
+      line-height: 20px;
+      text-align: center;
+      color: #FFF;
+      background: #999999;
+      text-align: center;
+      position: absolute;
+      left: 0;
+      top: 8px;
+    }
+    li:first-child:after {content: "1";background: #FD8C84;}
+    li:nth-child(2):after {content: "2";background: #FFCC99;}
+    li:nth-child(3):after {content: "3";background: #7FD75A;}
+    li:nth-child(4):after {content: "4";background: #CCCCFF;}
+    li:nth-child(5):after {content: "5";background: #60C4FD;}
+    li:nth-child(6):after {content: "6";}
+    li:nth-child(7):after {content: "7";}
+    li:nth-child(8):after {content: "8";}
+    li:nth-child(9):after {content: "9";}
+    li:nth-child(10):after {content: "10";}
+  }
+}
 
 .chat{
   flex: 1;

+ 97 - 50
src/views/als/intelligentQA/index.vue

@@ -5,7 +5,11 @@
       <div class="historyContent">
         <div v-for="item in historyData" :key="item.id" class="historyItem">
           <span style="float: left"> {{ item.question }}</span>
+          <i class="el-icon-delete historyMore" style="margin-left: 10px" @click="deleteHistory(item.id)"></i>
           <i class="el-icon-more historyMore" @click="historyDetail(item.id)"></i>
+          <!-- <el-tooltip class="item" effect="dark" content="详情" placement="top">
+            
+          </el-tooltip> -->
         </div>
       </div>
     </div>
@@ -22,7 +26,7 @@
                 <div class="answer">{{ item.answer }}</div>
                 <!-- <div class="graph"></div> -->
                 <graphECharts v-if="item.graph" :graphData="item.graph" class="charts"></graphECharts>
-                <i v-if="item.answer" class="el-icon-more more" @click="handleMore(item)"></i>
+                <i v-if="item.user_id && item.ossID" class="el-icon-more more" @click="handleMore(item)"></i>
               </div>
             </div>
           </div>
@@ -37,6 +41,11 @@
     </div>
     <div class="statistics">
       <div class="statisticsTitle">统计列表</div>
+      <ul class="statisticsContent">
+        <li v-for="item in statisticsData" :key="item.question" class="statisticsItem">
+          <span style="padding-left: 30px"> {{ item.question }}</span>
+        </li>
+      </ul>
     </div>
     <el-dialog title="更多" :visible.sync="dialogVisible" width="1500px" :before-close="handleClose">
       <div class="dialogContent">
@@ -77,7 +86,7 @@
 
 <script>
 import store from '@/store'
-import { handlerAsk, getQAHistoryList, getQAHistoryDetail } from '@/api/als/intelligentQA'
+import { handlerAsk, getQAHistoryList, getGroup, getQAHistoryListAll, getQAHistoryDetail, removeQAHistory } from '@/api/als/intelligentQA'
 import graphECharts from '@/views/als/components/Charts/graph.vue'
 import axios from 'axios'
 import { getListByIdsApi } from '@/api/als/oss'
@@ -105,11 +114,13 @@ export default {
         graph: {}
       },
       historyData: [],
-      fileInfo: {}
+      fileInfo: {},
+      statisticsData: []
     }
   },
   mounted() {
-    this.getHistory()
+    this.getHistoryAll()
+    this.getGroupAPI()
     this.adjustHeight()
   },
   watch: {},
@@ -132,16 +143,21 @@ export default {
       })
     },
 
-    async getHistory() {
+    async getHistoryAll() {
       try {
-        const {
-          data: { list, total }
-        } = await getQAHistoryList()
-        this.historyData = list
+        const { data } = await getQAHistoryListAll()
+        this.historyData = data
         // console.log('this.historyData', this.historyData)
       } catch (error) {}
     },
 
+    async getGroupAPI() {
+      try {
+        const { data } = await getGroup()
+        this.statisticsData = data
+      } catch (error) {}
+    },
+
     handleKeydown(event) {
       if (event.key === 'Enter') {
         if (event.ctrlKey) {
@@ -177,39 +193,41 @@ export default {
           answer: '正在解析您的问题,请稍后......'
         })
         this.questionInput = ''
-        // const { code, data } = await handlerAsk(sendInput)
-        const { code, data } = {
-          code: 200,
-          msg: '',
-          data: {
-            user_id: 'user',
-            answer: '解决办法为:更换电池或遥控器',
-            file_name: '排故手册',
-            // ossID: '225825878820585472',//pdf
-            ossID: '225840762526433280', //word
-            graph: {
-              data: [
-                { name: '202310150010', category: 'HMC' },
-                { name: '电视', category: '成品' },
-                { name: '电视遥控器失灵', category: '故障描述' },
-                { name: '家用电器', category: '系统' },
-                { name: '更换电池或遥控器', category: '维修策略' }
-              ],
-              links: [
-                { source: '202310150010', target: '电视', value: '成品' },
-                { source: '202310150010', target: '电视遥控器失灵', value: '故障描述' },
-                { source: '202310150010', target: '家用电器', value: '系统' },
-                { source: '202310150010', target: '更换电池或遥控器', value: '维修策略' }
-              ]
-            }
-          }
-        }
+        const { code, data } = await handlerAsk(sendInput)
+        // const { code, data } = {
+        //   code: 200,
+        //   msg: '',
+        //   data: {
+        //     user_id: 'user',
+        //     answer: '解决办法为:更换电池或遥控器',
+        //     file_name: '排故手册',
+        //     // ossID: '225825878820585472',//pdf
+        //     ossID: '225840762526433280', //word
+        //     graph: {
+        //       data: [
+        //         { name: '202310150010', category: 'HMC' },
+        //         { name: '电视', category: '成品' },
+        //         { name: '电视遥控器失灵', category: '故障描述' },
+        //         { name: '家用电器', category: '系统' },
+        //         { name: '更换电池或遥控器', category: '维修策略' }
+        //       ],
+        //       links: [
+        //         { source: '202310150010', target: '电视', value: '成品' },
+        //         { source: '202310150010', target: '电视遥控器失灵', value: '故障描述' },
+        //         { source: '202310150010', target: '家用电器', value: '系统' },
+        //         { source: '202310150010', target: '更换电池或遥控器', value: '维修策略' }
+        //       ]
+        //     }
+        //   }
+        // }
 
         if (code == 200) {
-          // const newData = this.handleData(JSON.parse(data))
-          const newData = this.handleData(data)
+          console.log(1111)
+          const newData = this.handleData(JSON.parse(data))
+          // const newData = this.handleData(data)
           this.chatInfo.pop()
           this.chatInfo.push(newData)
+          // this.getHistoryAll()
         }
         // 等处理过返回数据后,调用使视图保持在最底部
         let main = this.$refs.main
@@ -220,22 +238,25 @@ export default {
     },
 
     handleData(data) {
-      // const graphData = eval('(' + data.graph + ')')
-      // data.graph = graphData
-      const categories = []
-      data.graph.data.forEach((node) => {
-        const flag = categories.find((item) => {
-          return item.name === node.category
+      if (data.graph) {
+        const graphData = eval('(' + data.graph + ')')
+        data.graph = graphData
+        const categories = []
+        data.graph.data.forEach((node) => {
+          const flag = categories.find((item) => {
+            return item.name === node.category
+          })
+          if (!flag) {
+            categories.push({ name: node.category })
+          }
         })
-        if (!flag) {
-          categories.push({ name: node.category })
-        }
-      })
-      data.graph.categories = categories
+        data.graph.categories = categories
+      }
       return data
     },
 
     handleMore(data) {
+      console.log('data', data)
       this.getListById(data.ossID)
       this.moreData = data
       this.dialogVisible = true
@@ -248,6 +269,7 @@ export default {
 
     handleClose() {
       this.dialogVisible = false
+      this.fileInfo = {}
     },
 
     async historyDetail(id) {
@@ -257,6 +279,31 @@ export default {
         this.chatInfo = []
         this.chatInfo.push(newData)
       } catch (error) {}
+    },
+
+    deleteHistory(id) {
+      this.$confirm('是否删除该条记录?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          this.removeQAHistoryAPI(id)
+        })
+        .catch(() => {})
+    },
+
+    async removeQAHistoryAPI(params) {
+      try {
+        const { code } = await removeQAHistory(params)
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          this.getHistoryAll()
+        }
+      } catch (error) {}
     }
 
     // const { code, data } = {
@@ -288,6 +335,6 @@ export default {
 }
 </script>
 
-<style lang="scss">
+<style scoped lang="scss">
 @import './index.scss';
 </style>

+ 0 - 2
src/views/als/model/index.vue

@@ -217,7 +217,6 @@ export default {
         const { data: airConfigData } = await getAirConfiguration()
         this.allAirConfig = airConfigData
         this.aircraftTypeTreeData = data[0].children
-        console.log('this.aircraftTypeTreeData', this.aircraftTypeTreeData)
       } catch (error) {}
     },
 
@@ -257,7 +256,6 @@ export default {
     },
 
     partIdSelect(node) {
-      console.log('node', node)
       this.form.partId = node.id
     },
 

+ 69 - 48
src/views/als/systemCommunication/index.vue

@@ -1,13 +1,13 @@
 <template>
   <div class="view-table-content">
-    <div class="view-dataSpecies-right">
+    <div style="width: 100%">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
           <el-button type="success" @click="openDialog()" :disabled="currentNode && currentNode.type == 0">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
         </div>
         <div class="view-dataType-title-search">
-          <el-input placeholder="请输入关键字" v-model="keyWord" class="input1">
+          <el-input placeholder="请输入名称" v-model="keyWordData" class="input1">
             <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
           </el-input>
         </div>
@@ -15,42 +15,56 @@
       <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="600px" :before-close="handleClose">
-        <el-form ref="form" :model="form" label-width="80px">
-          <el-form-item label="id" prop="id">
-            <el-input v-model="form.id" placeholder="请输入名称" />
-          </el-form-item>
-          <el-form-item label="名称" prop="name">
-            <el-input v-model="form.name" placeholder="请输入名称" />
-          </el-form-item>
-          <el-form-item label="IP地址" prop="ipAddress">
-            <el-input v-model="form.ipAddress" placeholder="请输入IP地址" />
-          </el-form-item>
-          <el-form-item label="网段" prop="networkSegment">
-            <el-input v-model="form.networkSegment" placeholder="请输入网段" />
-          </el-form-item>
-          <el-form-item label="子网掩码" prop="subnetMask">
-            <el-input v-model="form.subnetMask" placeholder="请输入子网掩码" />
-          </el-form-item>
-          <el-form-item label="DNS" prop="dns">
-            <el-input v-model="form.dns" placeholder="请输入DNS" />
-          </el-form-item>
-          <el-form-item label="网关" prop="gateway">
-            <el-input v-model="form.gateway" placeholder="请输入网关" />
-          </el-form-item>
-          <el-form-item label="http" prop="http">
-            <el-input v-model="form.http" placeholder="请输入http" />
-          </el-form-item>
-          <el-form-item label="端口号" prop="port">
-            <el-input v-model="form.port" placeholder="请输入端口号" />
-          </el-form-item>
-          <el-form-item label="用户名" prop="userName">
-            <el-input v-model="form.userName" placeholder="请输入用户名" />
-          </el-form-item>
-          <el-form-item label="密码" prop="password">
-            <el-input v-model="form.password" placeholder="请输入密码" />
-          </el-form-item>
+      <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="800px" :before-close="handleClose">
+        <el-form ref="form" :inline="true" :model="form" label-width="80px">
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="名称" prop="name">
+                <el-input v-model="form.name" placeholder="请输入名称" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="IP地址" prop="ipAddress">
+                <el-input v-model="form.ipAddress" placeholder="请输入IP地址" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="网段" prop="networkSegment">
+                <el-input v-model="form.networkSegment" placeholder="请输入网段" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="子网掩码" prop="subnetMask">
+                <el-input v-model="form.subnetMask" placeholder="请输入子网掩码" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="DNS" prop="dns"> <el-input v-model="form.dns" placeholder="请输入DNS" /> </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="网关" prop="gateway"> <el-input v-model="form.gateway" placeholder="请输入网关" /> </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="12"
+              ><el-form-item label="http" prop="http"> <el-input v-model="form.http" placeholder="请输入http" /> </el-form-item>
+            </el-col>
+            <el-col :span="12"
+              ><el-form-item label="端口号" prop="port"> <el-input v-model="form.port" placeholder="请输入端口号" /> </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="12"
+              ><el-form-item label="用户名" prop="userName"> <el-input v-model="form.userName" placeholder="请输入用户名" /> </el-form-item>
+            </el-col>
+            <el-col :span="12"
+              ><el-form-item label="密码" prop="password"> <el-input v-model="form.password" placeholder="请输入密码" /> </el-form-item>
+            </el-col>
+          </el-row>
         </el-form>
 
         <span slot="footer" class="dialog-footer">
@@ -66,14 +80,14 @@
 import { getCommunication, addCommunication, updateCommunication, removeCommunication } from '@/api/als/communication'
 import { deepClone, debounce } from '@/utils/index'
 export default {
-  name: 'Aircraft',
+  name: 'Communication',
   components: {},
   data() {
     // 这里存放数据
     return {
       dialogTitle: '新增',
       dialogVisible: false,
-      keyWord: '',
+      keyWordData: '',
       communicationModelIdList: [],
       currentNodeKey: null,
       currentNode: null,
@@ -93,7 +107,6 @@ export default {
       },
       searchValue: '',
       columns: [
-        { prop: 'id', label: '序号' },
         {
           prop: 'name',
           label: '名称'
@@ -147,6 +160,15 @@ export default {
               onClick: (row, index, scope) => {
                 this.handUpdate(row)
               }
+            },
+            {
+              name: '删除',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.remove([row])
+              }
             }
           ]
         }
@@ -208,7 +230,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          await this.getCommunicationAPI({ communicationModelIdList: this.communicationModelIdList })
+          await this.getCommunicationAPI()
           this.handleClose()
         }
       } catch (error) {}
@@ -236,18 +258,17 @@ export default {
       const { pageSize, pageIndex } = this.tableRequset
       const {
         data: { list, total }
-      } = await getCommunication({ pageSize, pageIndex, keyWord, ...params })
+      } = await getCommunication({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
-      console.log(list)
       this.tableRequset.total = total
     },
 
     fetch() {
-      this.getCommunicationAPI({ communicationModelIdList: this.communicationModelIdList })
+      this.getCommunicationAPI()
     },
 
     searchClick() {
-      this.getCommunicationAPI({ communicationModelIdList: this.communicationModelIdList })
+      this.getCommunicationAPI({ name: this.keyWordData })
     },
 
     async addCommunicationAPI() {
@@ -260,7 +281,7 @@ export default {
             message: '操作成功!'
           })
           this.handleClose()
-          this.getCommunicationAPI({ communicationModelIdList: this.communicationModelIdList })
+          this.getCommunicationAPI()
         }
       } catch (error) {}
     },
@@ -274,7 +295,7 @@ export default {
             message: '操作成功!'
           })
           this.handleClose()
-          this.getCommunicationAPI({ communicationModelIdList: this.communicationModelIdList })
+          this.getCommunicationAPI()
         }
       } catch (error) {}
     },

+ 11 - 2
src/views/home/index.vue

@@ -32,7 +32,7 @@
       <el-col :span="24" style="margin-bottom: 15px">
         <Card title="维修状态">
           <template slot="content">
-            <LTable ref="table" :defaultFetch="true" :columns="columns" :dataSource="tableData" :options="options" :fetch="fetchTableData" class="tabl-box" />
+            <LTable ref="maintainTable" :defaultFetch="true" :columns="maintainColumns" :dataSource="maintainTableData" :options="maintainOptions" :fetch="maintainFetchTableData" class="tabl-box" />
           </template>
         </Card>
       </el-col>
@@ -90,9 +90,11 @@
 
 <script>
 import { getHomeLastMission, getAviationList, getHomeAviationProject, getHomeAviationAmount, getHomeAviationMoney } from '@/api/home'
+import { getFaultStatisticsListAll } from '@/api/als/faultStatistics'
+
 import * as echarts from 'echarts'
 import { setTopOptions, bottomLeftOptions, bottomCenterOptions, bottomRightOptions } from './index'
-import { columns, options } from './table.js'
+import { columns, options, maintainColumns, maintainOptions } from './table.js'
 export default {
   name: 'home',
 
@@ -100,8 +102,11 @@ export default {
     // 这里存放数据
     return {
       tableData: [],
+      maintainTableData: [],
       options,
       columns: columns(this),
+      maintainOptions,
+      maintainColumns: maintainColumns(this),
       selectOptions: [{ avmatCatalogCode: '全部', avmatCatalogName: '全部' }],
 
       model: '全部',
@@ -131,6 +136,10 @@ export default {
       this.tableData = data
       this.fetchIndexAnalysis()
     },
+    async maintainFetchTableData() {
+      const { data } = await getFaultStatisticsListAll()
+      this.maintainTableData = data
+    },
     handleChange(item) {
       switch (item) {
         case 1:

+ 249 - 0
src/views/home/table.js

@@ -57,6 +57,255 @@ export const options = {
   height: '100%'
 }
 
+export const maintainColumns = (_this) => [
+  {
+    prop: 'statisticsDate',
+    label: '日期'
+  },
+  {
+    prop: 'warZone',
+    label: '战区'
+  },
+  {
+    prop: 'army',
+    label: '军'
+  },
+  {
+    prop: 'division',
+    label: '师'
+  },
+  {
+    prop: 'groups',
+    label: '团'
+  },
+  {
+    prop: 'squadron',
+    label: '中队'
+  },
+  {
+    prop: 'aircraftNum',
+    label: '飞机号'
+  },
+  {
+    prop: 'aircraftModel',
+    label: '机型'
+  },
+  {
+    prop: 'factoryNum',
+    label: '出厂号码'
+  },
+  {
+    prop: 'machineType',
+    label: '机件类型'
+  },
+  {
+    prop: 'machineNum',
+    label: '机件号'
+  },
+  {
+    prop: 'machineModel',
+    label: '机件型别'
+  },
+  {
+    prop: 'machineName',
+    label: '机件名称'
+  },
+  {
+    prop: 'landingGear',
+    label: '起落'
+  },
+  {
+    prop: 'major',
+    label: '专业'
+  },
+  {
+    prop: 'faultyPartsName',
+    label: '故障件名称'
+  },
+  {
+    prop: 'faultyPartsModel',
+    label: '故障件型别'
+  },
+  {
+    prop: 'faultyPartsNum',
+    label: '故障件号码'
+  },
+  {
+    prop: 'engineModel',
+    label: '故障件所属发动机型别'
+  },
+  {
+    prop: 'engineNum',
+    label: '故障件所属发动机号码'
+  },
+  {
+    prop: 'engineSerialNum',
+    label: '故障件所属发动机号码'
+  },
+  {
+    prop: 'faultyPartsPosition',
+    label: '故障件位置'
+  },
+  {
+    prop: 'faultyPhenomenon',
+    label: '故障现象'
+  },
+  {
+    prop: 'faultyPlace',
+    label: '故障发生地点'
+  },
+  {
+    prop: 'findOpportunity',
+    label: '发现时机'
+  },
+  {
+    prop: 'systems',
+    label: '系统'
+  },
+  {
+    prop: 'timingType',
+    label: '计时类型'
+  },
+  {
+    prop: 'faultyPartsManufacturer',
+    label: '故障件制造厂'
+  },
+  {
+    prop: 'faultyPartsRenovate',
+    label: '故障件翻修厂'
+  },
+  {
+    prop: 'installationTime',
+    label: '故障件装本机工作时次'
+  },
+  {
+    prop: 'totalWorkTime',
+    label: '故障件总工作时次'
+  },
+  {
+    prop: 'repairTime',
+    label: '故障件修后时次'
+  },
+  {
+    prop: 'replacementPartsModel',
+    label: '故换件型别'
+  },
+  {
+    prop: 'replacementPartsNum',
+    label: '故换件号码'
+  },
+  {
+    prop: 'replacementPartsManufacturer',
+    label: '故换件制造厂'
+  },
+  {
+    prop: 'replacementTotalWorkTime',
+    label: '故换件总工作时次'
+  },
+  {
+    prop: 'replacementPartsRenovate',
+    label: '故换件翻修厂'
+  },
+  {
+    prop: 'replacementRepairTime',
+    label: '故换件修后时次'
+  },
+  {
+    prop: 'faultyAbnormalCode',
+    label: '故障失常码'
+  },
+  {
+    prop: 'faultyPartsInstallDate',
+    label: '故障件装机日期'
+  },
+  {
+    prop: 'faultyReason',
+    label: '故障原因'
+  },
+  {
+    prop: 'faultyNature',
+    label: '故障性质'
+  },
+  {
+    prop: 'faultyResponsibility',
+    label: '故障责任'
+  },
+  {
+    prop: 'faultyConsequence',
+    label: '故障后果'
+  },
+  {
+    prop: 'handlingSuggestions',
+    label: '处理意见'
+  },
+  {
+    prop: 'influenceFrequency',
+    label: '影响次数'
+  },
+  {
+    prop: 'errorFlyFrequency',
+    label: '误飞次数'
+  },
+  {
+    prop: 'identificationMethod',
+    label: '判明方法'
+  },
+  {
+    prop: 'discoveredPeople',
+    label: '发现人'
+  },
+  {
+    prop: 'exclusionMethod',
+    label: '排除方法'
+  },
+  {
+    prop: 'exclusionPeople',
+    label: '排故人'
+  },
+  {
+    prop: 'examinePeople',
+    label: '审核人'
+  },
+  {
+    prop: 'examineTime',
+    label: '审核时间'
+  },
+  {
+    prop: 'exclusionDate',
+    label: '排除日期'
+  },
+  {
+    prop: 'exclusionWorkTime',
+    label: '排故工时'
+  },
+  {
+    prop: 'exclusionPeopleNum',
+    label: '排故人数'
+  },
+  {
+    prop: 'exclusionTime',
+    label: '排故时间'
+  },
+  {
+    prop: 'isAchievement',
+    label: '是否立功'
+  },
+  {
+    prop: 'needTestFly',
+    label: '需要试飞'
+  }
+]
+
+export const maintainOptions = {
+  stripe: true, // 斑马纹
+  mutiSelect: false, // 多选框
+  index: false, // 显示序号, 多选则 mutiSelect
+  loading: false, // 表格动画
+  initTable: true, // 是否一挂载就加载数据
+  border: true,
+  height: '100%'
+}
+
 export const data = [
   { taskName: '任务一', taskTime: '2022-9-1', equipmentCompletion: '12%', guaranteeGoodRate: '41%', noForceUtilization: '13%', forceUtilization: '35%' },
   { taskName: '任务二', taskTime: '2023-9-1', equipmentCompletion: '23%', guaranteeGoodRate: '12%', noForceUtilization: '14%', forceUtilization: '36%' },