Просмотр исходного кода

路由调整、首页维修状态、问答界面统计列表、历史记录删除

Rmengdi 4 месяцев назад
Родитель
Сommit
74c415e789

+ 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 - 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: '故障统计'
         }
       }
     ]

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

@@ -2,7 +2,7 @@ import Layout from '@/layout/index.vue'
 /**
  *
  * LifetimeSpareParts               有寿件管理
- * FaultDiagnosis           退化分析
+ * LifePrediction           退化分析/寿命预测
  */
 
 export default [
@@ -26,7 +26,7 @@ export default [
         }
       },
       {
-        name: 'FaultDiagnosis',
+        name: 'LifePrediction',
         path: '/lifePrediction',
         component: () => import('@/views/als/lifePrediction/index.vue'),
         meta: {

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

@@ -1,8 +1,8 @@
 import Layout from '@/layout/index.vue'
 /**
  *
- * FalseAlarm               有寿件管理
- * FaultDiagnosis           退化分析
+ * FaultCase               故障字典
+ * IntelligentQA           智能辅助决策
  */
 
 export default [
@@ -17,9 +17,9 @@ 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: '故障字典'

+ 12 - 69
src/router/modules/system.js

@@ -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() {
     // 这里存放数据

+ 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>

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

@@ -1,6 +1,6 @@
 <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>

+ 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%' },