瀏覽代碼

郑州1.17演示版本

Rmengdi 4 月之前
父節點
當前提交
18db2b57e9

+ 6 - 6
src/api/als/ERManage.js

@@ -1,26 +1,26 @@
 import { get, post } from '@/http/index'
 
 //查询所有三元组
-export const getERList = async () => {
-  return await get('/kgqa/relation/getAllTriples/')
+export const getERList = async (data) => {
+  return await get('/kgqa/relation/getAllTriples', data)
 }
 
 //查询数据库中目前已经有的关系
 export const getAllRelationClass = async () => {
-  return await get('/kgqa/relation/getAllRelationClass/')
+  return await get('/kgqa/relation/getAllRelationClass')
 }
 
 // 新增关系
 export const addRelation = async (data) => {
-  return await post('/kgqa/relation/Add/', data)
+  return await post('/kgqa/relation/Add', data)
 }
 
 //修改关系
 export const updateRelation = async (data) => {
-  return await post('/kgqa/relation/Update/', data)
+  return await post('/kgqa/relation/Update', data)
 }
 
 //删除关系
 export const deleteRelation = async (data) => {
-  return await post('/kgqa/relation/Delete/', data)
+  return await post('/kgqa/relation/Delete', data)
 }

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

@@ -5,6 +5,11 @@ export const getDataImport = async (data) => {
   return await get('/als/dataImport/list', data)
 }
 
+// 查询数据导入信息列表
+export const getAllDataImport = async (data) => {
+  return await get('/als/dataImport/listAll', data)
+}
+
 // 新增数据导入信息
 export const addDataImport = async (data) => {
   return await post('/als/dataImport', data)

+ 7 - 7
src/api/als/entityManage.js

@@ -1,31 +1,31 @@
 import { get, post } from '@/http/index'
 
 //查询所有实体
-export const getEntityList = async () => {
-  return await get('/kgqa/entity/getAllEntities/')
+export const getEntityList = async (data) => {
+  return await get('/kgqa/entity/getAllEntities', data)
 }
 
 //	获取图数据库中的所有实体类名称
 export const getAllEntityClass = async () => {
-  return await get('/kgqa/entity/getAllEntityClass/')
+  return await get('/kgqa/entity/getAllEntityClass')
 }
 
 // 新增实体结点
 export const addEntity = async (data) => {
-  return await post('/kgqa/entity/add/', data)
+  return await post('/kgqa/entity/add', data)
 }
 
 //修改实体结点
 export const updateEntity = async (data) => {
-  return await post('/kgqa/entity/update/', data)
+  return await post('/kgqa/entity/update', data)
 }
 
 //查询实体结点
 export const checkEntity = async (data) => {
-  return await post('/kgqa/entity/Check/', data)
+  return await post('/kgqa/entity/Check', data)
 }
 
 //删除实体结点
 export const deleteEntity = async (data) => {
-  return await post('/kgqa/entity/delete/', data)
+  return await post('/kgqa/entity/delete', data)
 }

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

@@ -5,6 +5,16 @@ export const getFaultStatistics = async (data) => {
   return await get('/als/faultStatistics/list', data)
 }
 
+// 查询故障统计列表
+export const getExclusionList = async (data) => {
+  return await get('/als/faultStatistics/exclusionList', data)
+}
+
+// 查询故障统计列表不分页
+export const getExclusionListAll = async (data) => {
+  return await get('/als/faultStatistics/exclusionListAll', data)
+}
+
 // 查询故障统计列表
 export const getFaultStatisticsEcharts = async (data) => {
   return await get('/als/faultStatistics/statistics', data)
@@ -43,3 +53,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('/als/faultStatistics/extra/statistics', data)
+}

+ 38 - 8
src/api/als/knowledgeExtraction.js

@@ -12,12 +12,12 @@ export const addTask = async (data) => {
 
 // 修改任务
 export const updateTask = async (data) => {
-  // return await put('/als/lifePrediction', data)
+  return await put('/als/kGraphTask', data)
 }
 
 // 删除任务
 export const removeTask = async (id) => {
-  // return await deletes('/als/lifePrediction/' + id)
+  return await deletes('/als/kGraphTask/' + id)
 }
 
 // 获取文件信息
@@ -32,15 +32,45 @@ export const taskPro = async (data) => {
 
 // 获取分句列表
 export const getClauseList = async (data) => {
-  // return await post('/kgqa/ask/', data)
+  return await get('/als/kGraphClause/list', data)
 }
 
-// 修改知识抽取
-export const updateClause = async (data) => {
-  // return await put('/als/lifePrediction', data)
+// 获取分句详细信息
+export const getClauseInfo = async (id) => {
+  return await get('/als/kGraphClause/' + id)
 }
 
-// 删除知识抽取
+// 删除分句
 export const removeClause = async (id) => {
-  // return await deletes('/als/lifePrediction/' + id)
+  return await deletes('/als/kGraphClause/' + id)
+}
+
+// 修改分句
+export const updateClause = async (data) => {
+  return await put('/als/kGraphClause', data)
+}
+
+// 获取抽取列表
+export const getExtractList = async (data) => {
+  return await get('/als/kGraphEntity/list', data)
+}
+
+// 修改抽取结果
+export const updateExtractInfo = async (data) => {
+  return await put('/als/kGraphEntity', data)
+}
+
+// 删除抽取结果
+export const removeExtractInfo = async (id) => {
+  return await deletes('/als/kGraphEntity/' + id)
+}
+
+// 新增实体关系
+export const addER = async (data) => {
+  return await post('/als/kGraphEntity', data)
+}
+
+// 获取图谱可视化
+export const getVisually = async (data) => {
+  return await post('/kgqa/ossId/show', data)
 }

+ 1 - 1
src/layout/components/NavBar/index.vue

@@ -40,6 +40,6 @@ export default {
 }
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 @import './index.scss';
 </style>

+ 0 - 1
src/layout/components/NavBar/menu.vue

@@ -24,7 +24,6 @@ export default {
   }
 }
 </script>
-<style></style>
 <style lang="scss" scoped>
 .el-menu-demo {
   display: flex;

+ 10 - 10
src/router/modules/system.js

@@ -263,16 +263,16 @@ export default [
           title: '知识抽取'
         }
       },
-      {
-        name: 'ExtractList',
-        path: '/knowledgeGraph/extractList',
-        component: () => import('@/views/als/knowledgeExtraction/extractList.vue'),
-        name: 'ExtractList',
-        meta: {
-          parent: 'BasicData',
-          title: '抽取列表'
-        }
-      },
+      // {
+      //   name: 'ExtractList',
+      //   path: '/knowledgeGraph/extractList',
+      //   component: () => import('@/views/als/knowledgeExtraction/extractList.vue'),
+      //   name: 'ExtractList',
+      //   meta: {
+      //     parent: 'BasicData',
+      //     title: '抽取列表'
+      //   }
+      // },
       {
         name: 'EntityManage',
         path: '/knowledgeGraph/entityManage',

+ 1 - 1
src/views/als/components/FileUpload/index.vue

@@ -78,7 +78,7 @@ export default {
       number: 0,
       uploadList: [],
       // baseUrl: '/api',
-      uploadFileUrl: '/api/als/common/upload',
+      uploadFileUrl: '/api/als/resource/oss/upload',
       headers: { Authorization: getItem('token') },
       fileList: [],
       loading: null

+ 14 - 3
src/views/als/falseAlarm/index.vue

@@ -393,8 +393,20 @@ export default {
     async checkCurve(row) {
       this.isFalseAlarm = row.status
       this.form = deepClone(row)
-      const { data } = await getCurveData(row.code, row.sortieNo)
-      this.getResultData(data)
+      try {
+        const { code, data } = await getCurveData(row.code, row.sortieNo)
+        console.log('resultData', code, data)
+        if (code === 200) {
+          if (data) {
+            this.getResultData(data)
+          } else {
+            this.$message({
+              type: 'warning',
+              message: '无飞参数据!'
+            })
+          }
+        }
+      } catch (error) {}
     },
 
     getResultData(data) {
@@ -425,7 +437,6 @@ export default {
     },
 
     handleResultData(resultData) {
-      console.log('resultData', resultData)
       const headData = Object.keys(resultData)
       const contentData = {}
       headData.forEach((headItem) => {

+ 56 - 9
src/views/als/faultDiagnosis/index.vue

@@ -43,6 +43,14 @@
       <el-dialog title="执行进度" :visible.sync="progressVisible" width="800px">
         <el-progress :text-inside="true" :stroke-width="24" :percentage="percentage" status="success"></el-progress>
       </el-dialog>
+      <el-dialog title="结果展示" :visible.sync="resultShowVisible" :before-close="resultShowDialogClose" width="800px">
+        <div style="margin: 10px 0px">{{ resultShowData.result }}</div>
+        <el-image style="width: 500px" v-if="resultShowData.url !== ''" :src="resultShowData.url" :preview-src-list="[resultShowData.url]"></el-image>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="resultShowDialogClose">取 消</el-button>
+          <el-button type="primary" @click="resultShowDialogClose">确 定</el-button>
+        </span>
+      </el-dialog>
     </div>
   </div>
 </template>
@@ -58,6 +66,7 @@ import Treeselect from '@riophae/vue-treeselect'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 import { getAirConfiguration } from '@/api/als/airConfiguration'
 import { executeFault } from '@/api/als/algorithm'
+import { getListByIdsApi } from '@/api/als/oss'
 
 export default {
   name: 'FaultDiagnosis',
@@ -69,6 +78,7 @@ export default {
       dialogVisible: false,
       resultVisible: false,
       progressVisible: false,
+      resultShowVisible: false,
       keyWordData: '',
       aircaftModelIdList: [],
       currentNodeKey: '',
@@ -135,7 +145,7 @@ export default {
               }
             },
             {
-              name: '查看结果',
+              name: '查看',
               type: 'text',
               round: false,
               plain: false,
@@ -204,8 +214,20 @@ export default {
           }
         },
         {
-          prop: 'resultContent',
-          label: '结果'
+          button: true,
+          label: '操作',
+          width: '240px',
+          group: [
+            {
+              name: '查看结果',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.checkRelustShow(row)
+              }
+            }
+          ]
         }
       ],
       resultOptions: {
@@ -239,7 +261,11 @@ export default {
       currentSortieNo: '',
       partsData: [],
       allAirConfig: [],
-      percentage: 0
+      percentage: 0,
+      resultShowData: {
+        url: '',
+        result: ''
+      }
     }
   },
   watch: {
@@ -248,6 +274,7 @@ export default {
       this.debounceFn()
     }
   },
+  computed: {},
   mounted() {
     this.getAircaftCatalogTreeAPI()
   },
@@ -385,6 +412,14 @@ export default {
       }
     },
 
+    resultShowDialogClose() {
+      this.resultShowVisible = false
+      this.resultShowData = {
+        url: '',
+        result: ''
+      }
+    },
+
     submit() {
       this.beginExecute()
     },
@@ -399,6 +434,19 @@ export default {
       this.resultVisible = true
     },
 
+    async checkRelustShow(row) {
+      const { data } = await getListByIdsApi(JSON.parse(row.resultContent).ossId)
+      this.resultShowData.url = data[0].url
+      this.resultShowData.result = JSON.parse(row.resultContent).result
+      this.resultShowVisible = true
+    },
+
+    async getImgUrl(ossId) {
+      const { data } = await getListByIdsApi(ossId)
+      const newUrl = data[0].url
+      return newUrl
+    },
+
     async beginExecute() {
       this.progressVisible = true
 
@@ -421,11 +469,10 @@ export default {
             type: 'success',
             message: '执行成功!'
           })
-
-          const result = res.data
-          this.$alert(`故障诊断结果为:${result}`, '故障诊断结果', {
-            confirmButtonText: '确定'
-          })
+          const { data } = await getListByIdsApi(JSON.parse(res.data).ossId)
+          this.resultShowData.url = data[0].url
+          this.resultShowData.result = JSON.parse(res.data).result
+          this.resultShowVisible = true
           this.getFaultDiagnosisAPI({ sortieNo: this.currentSortieNo })
           this.handleClose()
         }

+ 15 - 13
src/views/als/faultStatistics/echarts.vue

@@ -20,7 +20,7 @@
         </div>
         <div class="input-with-select">
           <span>机型</span>
-          <el-select v-model="select.aircraftModel" placeholder="请选择" @change="getFaultStatisticsListAll({ distinctField: 'aircraft_num' })" filterable clearable>
+          <el-select v-model="select.aircraftModel" placeholder="请选择" @change="getFaultStatisticsListAllAPI({ distinctField: 'aircraft_num' })" filterable clearable>
             <el-option v-for="item in aircraftModelList" :key="item.aircraftModel" :label="item.aircraftModel" :value="item.aircraftModel"> </el-option>
           </el-select>
         </div>
@@ -95,8 +95,12 @@ export default {
       select: {
         startStatisticsDate: '',
         endStatisticsDate: '',
-        major: '',
-        aircraftModel: ''
+        // major: '',
+        // aircraftModel: '',
+        // groups: ''
+        major: '特设',
+        groups: '空56旅',
+        aircraftModel: '歼-20'
       },
       typeTree: {
         children: 'children',
@@ -193,11 +197,10 @@ export default {
     }
   },
   mounted() {
-    this.getFaultStatisticsAPI()
-    // this.getAircaftTypeAndModelTreeAPI()
+    this.getFaultStatisticsAPI(this.select)
   },
   methods: {
-    async getFaultStatisticsListAll(params) {
+    async getFaultStatisticsListAllAPI(params) {
       if (params.distinctField == 'aircraft_num') {
         params.aircraftModel = this.select.aircraftModel
       }
@@ -313,13 +316,12 @@ export default {
       echartRight.setOption(option)
     },
     async getFaultStatisticsAPI(params) {
-      const { keyWord } = this
-      const res = await getFaultStatisticsEcharts({ keyWord, ...params })
-      this.getFaultStatisticsListAll({ distinctField: 'groups' })
-      this.getFaultStatisticsListAll({ distinctField: 'major' })
-      this.getFaultStatisticsListAll({ distinctField: 'aircraft_model' })
-      this.getFaultStatisticsListAll({ distinctField: 'aircraft_num' })
-      this.getFaultStatisticsListAll({ distinctField: 'faulty_parts_name' })
+      const res = await getFaultStatisticsEcharts({ ...params })
+      this.getFaultStatisticsListAllAPI({ distinctField: 'groups' })
+      this.getFaultStatisticsListAllAPI({ distinctField: 'major' })
+      this.getFaultStatisticsListAllAPI({ distinctField: 'aircraft_model' })
+      this.getFaultStatisticsListAllAPI({ distinctField: 'aircraft_num' })
+      this.getFaultStatisticsListAllAPI({ distinctField: 'faulty_parts_name' })
       const names = []
       const values = []
       const data = []

+ 38 - 47
src/views/als/faultStatistics/index.vue

@@ -6,6 +6,7 @@
           <div class="view-carrierFlightMission-FlightMission-btn-box" style="width: 24%">
             <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>
+            <el-button type="danger" @click="handleSync" :disabled="currentNode && currentNode.type == 0">同步</el-button>
             <el-dropdown split-button type="primary" style="margin-left: 10px" trigger="click" @command="handleExport">
               更多
               <el-dropdown-menu slot="dropdown">
@@ -35,7 +36,7 @@
             </div>
             <div class="input-with-select">
               <span>机型</span>
-              <el-select v-model="select.aircraftModel" placeholder="请选择" @change="getFaultStatisticsListAll({ distinctField: 'aircraft_num' })" filterable clearable>
+              <el-select v-model="select.aircraftModel" placeholder="请选择" @change="getFaultStatisticsListAllAPI({ distinctField: 'aircraft_num' })" filterable clearable>
                 <el-option v-for="item in aircraftModelList" :key="item.aircraftModel" :label="item.aircraftModel" :value="item.aircraftModel"> </el-option>
               </el-select>
             </div>
@@ -373,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'
@@ -409,8 +410,9 @@ export default {
       select: {
         startStatisticsDate: '',
         endStatisticsDate: '',
-        major: '',
-        aircraftModel: ''
+        groups: '空56旅',
+        major: '特设',
+        aircraftModel: '歼-20'
       },
       typeTree: {
         children: 'children',
@@ -774,7 +776,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: {
@@ -785,10 +788,9 @@ export default {
   },
   mounted() {
     this.getFaultStatisticsAPI()
-    // this.getAircaftTypeAndModelTreeAPI()
   },
   methods: {
-    async getFaultStatisticsListAll(params) {
+    async getFaultStatisticsListAllAPI(params) {
       if (params.distinctField == 'aircraft_num') {
         params.aircraftModel = this.select.aircraftModel
       }
@@ -806,17 +808,6 @@ export default {
       }
     },
 
-    async getAircaftTypeAndModelTreeAPI(params) {
-      const { data } = await getAircaftTypeAndModelTree(params)
-      this.menuTreeData = data
-      if (data.length) {
-        this.currentNodeKey = data[0].value
-        this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children).map((e) => e.id)
-        this.getFaultStatisticsAPI({ aircaftModelIdList: this.aircaftModelIdList })
-      }
-    },
-
     async removeFaultStatisticsAPI(params) {
       try {
         const { code } = await removeFaultStatistics(params)
@@ -831,22 +822,6 @@ export default {
       } catch (error) {}
     },
 
-    getTreeLeafData(list) {
-      const newArr = []
-      function getLeaf(data, arr) {
-        data.forEach((e) => {
-          if (e.type === 1) {
-            arr.push(e)
-          }
-          if (e.children.length) {
-            getLeaf(e.children, arr)
-          }
-        })
-      }
-      getLeaf(list, newArr)
-      return newArr
-    },
-
     async getFaultStatisticsAPI(params) {
       if (this.$refs.table) this.$refs.table.clearSelection()
       const { keyWord } = this
@@ -856,11 +831,11 @@ export default {
       } = await getFaultStatistics({ pageSize, pageNum: pageIndex, keyWord, ...params })
       this.tableData = list
       this.tableRequset.total = total
-      this.getFaultStatisticsListAll({ distinctField: 'groups' })
-      this.getFaultStatisticsListAll({ distinctField: 'major' })
-      this.getFaultStatisticsListAll({ distinctField: 'aircraft_model' })
-      this.getFaultStatisticsListAll({ distinctField: 'aircraft_num' })
-      this.getFaultStatisticsListAll({ distinctField: 'faulty_parts_name' })
+      this.getFaultStatisticsListAllAPI({ distinctField: 'groups' })
+      this.getFaultStatisticsListAllAPI({ distinctField: 'major' })
+      this.getFaultStatisticsListAllAPI({ distinctField: 'aircraft_model' })
+      this.getFaultStatisticsListAllAPI({ distinctField: 'aircraft_num' })
+      this.getFaultStatisticsListAllAPI({ distinctField: 'faulty_parts_name' })
     },
 
     fetch() {
@@ -913,14 +888,6 @@ export default {
       })
     },
 
-    treeNodeClick(data) {
-      this.$refs.table.clearSelection()
-      this.currentNodeKey = data.id
-      this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id)
-      this.getFaultStatisticsAPI()
-    },
-
     openDialog() {
       this.dialogTitle = '新增'
       this.dialogVisible = true
@@ -1037,6 +1004,30 @@ export default {
         })
         .catch(() => {})
     },
+
+    // 同步
+    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) {
       this[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', 'txt']" />
               </el-form-item>
             </el-col>
             <el-col :span="12">

+ 31 - 31
src/views/als/intelligentQA/index.vue

@@ -193,37 +193,37 @@ 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: '227701077942149120', //pdf
-            // ossID: '227692224508796928', //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: '227701077942149120', //pdf
+        //     // ossID: '227692224508796928', //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)
+          const newData = this.handleData(JSON.parse(data))
+          // const newData = this.handleData(data)
           this.chatInfo.pop()
           this.chatInfo.push(newData)
           // this.getHistoryAll()
@@ -238,8 +238,8 @@ export default {
 
     handleData(data) {
       if (data.graph) {
-        // const graphData = eval('(' + data.graph + ')')
-        // data.graph = graphData
+        const graphData = eval('(' + data.graph + ')')
+        data.graph = graphData
         const categories = []
         data.graph.data.forEach((node) => {
           const flag = categories.find((item) => {

+ 49 - 46
src/views/als/judgeFaultLogic/index.vue

@@ -21,7 +21,7 @@
         <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-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="model">
             <el-select v-model="form.model" placeholder="请选择机型">
@@ -38,11 +38,11 @@
               </div>
             </el-checkbox-group>
           </el-form-item>
-          <el-form-item label="模型" prop="pattern">
+          <!-- <el-form-item label="模型" prop="pattern">
             <el-select v-model="form.pattern" placeholder="请选择模型">
               <el-option v-for="item in modelData.list" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
-          </el-form-item>
+          </el-form-item> -->
         </el-form>
 
         <span slot="footer" class="dialog-footer">
@@ -90,12 +90,13 @@ export default {
       },
       searchValue: '',
       columns: [
-        { prop: 'id', label: '编号' },
+        // { prop: 'id', label: '编号' },
         {
           prop: 'model',
           label: '机型',
+          width: '300px',
           render: (h, params) => {
-            const matchedItem = this.aircaftModelAll.find((item) => params.row.model === item.aircaftModelId)
+            const matchedItem = this.aircaftModelAll?.find((item) => params.row.model === item.aircaftModelId)
             if (matchedItem) {
               return h('span', matchedItem.aircaftModelName)
             } else {
@@ -105,24 +106,25 @@ export default {
         },
         {
           prop: 'hmcCode',
-          label: 'HMC码'
+          label: 'HMC码',
+          width: '300px'
         },
         {
           prop: 'parameterColumn',
           label: '参数列'
         },
-        {
-          prop: 'pattern',
-          label: '模型',
-          render: (h, params) => {
-            const matchedItem = this.modelData.list.find((item) => params.row.pattern === item.id)
-            if (matchedItem) {
-              return h('span', matchedItem.name)
-            } else {
-              return h('span', {}, '')
-            }
-          }
-        },
+        // {
+        //   prop: 'pattern',
+        //   label: '模型',
+        //   render: (h, params) => {
+        //     const matchedItem = this.modelData.list?.find((item) => params.row.pattern === item.id)
+        //     if (matchedItem) {
+        //       return h('span', matchedItem.name)
+        //     } else {
+        //       return h('span', {}, '')
+        //     }
+        //   }
+        // },
         {
           button: true,
           label: '操作',
@@ -182,10 +184,10 @@ export default {
         updateTime: ''
       },
       rules: {
-        model: [{ required: true, message: '机型不能为空', trigger: 'blur' }],
+        model: [{ required: true, message: '机型不能为空', trigger: 'change' }],
         hmcCode: [{ required: true, message: 'HMC码不能为空', trigger: 'blur' }],
-        parameterColumn: [{ required: true, message: '参数列不能为空', trigger: 'blur' }],
-        pattern: [{ required: true, message: '模型不能为空', trigger: 'blur' }]
+        parameterColumn: [{ required: true, message: '参数列不能为空', trigger: 'change' }]
+        // pattern: [{ required: false, message: '模型不能为空', trigger: 'blur' }]
       },
       debounceFn: debounce(this.fetch, 500),
       aircaftModelAll: []
@@ -212,6 +214,7 @@ export default {
     async getModelAPI() {
       const { data } = await getModel({ pageSize: 100, pageNum: 1, ...{ type: 5 } })
       this.modelData = data
+      console.log('this.modelData', this.modelData)
     },
 
     async getAircaftTypeAndModelTreeAPI(params) {
@@ -260,10 +263,10 @@ export default {
       const { keyWord } = this
       const { pageSize, pageIndex } = this.tableRequset
       const {
-        data: { list, totalCount }
+        data: { list, total }
       } = await getJudgeFaultLogic({ pageSize, pageNum: pageIndex, keyWord, ...params })
       this.tableData = list
-      this.tableRequset.total = totalCount
+      this.tableRequset.total = total
       const getAircaftModelAllParams = {
         aircaftTypeCode: '',
         aircaftTypeId: '',
@@ -283,22 +286,18 @@ export default {
 
     async addJudgeFaultLogicAPI() {
       this.form.parameterColumn = this.form.parameterColumn.toString()
-      this.$refs['form'].validate(async (valid) => {
-        if (valid) {
-          try {
-            delete this.form.aircaftModelName
-            const { code } = await addJudgeFaultLogic({ ...this.form })
-            if (code === 200) {
-              this.$message({
-                type: 'success',
-                message: '操作成功!'
-              })
-              this.getJudgeFaultLogicAPI()
-              this.handleClose()
-            }
-          } catch (error) {}
+      try {
+        delete this.form.aircaftModelName
+        const { code } = await addJudgeFaultLogic({ ...this.form })
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          this.getJudgeFaultLogicAPI()
+          this.handleClose()
         }
-      })
+      } catch (error) {}
     },
 
     async updateJudgeFaultLogicAPI() {
@@ -358,14 +357,18 @@ export default {
     },
 
     submit() {
-      switch (this.dialogTitle) {
-        case '编辑':
-          this.updateJudgeFaultLogicAPI()
-          break
-        case '新增':
-          this.addJudgeFaultLogicAPI()
-          break
-      }
+      this.$refs['form'].validate((valid) => {
+        if (valid) {
+          switch (this.dialogTitle) {
+            case '编辑':
+              this.updateJudgeFaultLogicAPI()
+              break
+            case '新增':
+              this.addJudgeFaultLogicAPI()
+              break
+          }
+        }
+      })
     },
 
     selection(val) {

+ 750 - 40
src/views/als/knowledgeExtraction/index.vue

@@ -13,9 +13,9 @@
         </div>
       </div>
       <div class="view-dataType-table">
-        <LTable ref="table" @selection-change="selection" :defaultFetch="false" :fetch="fetch" :columns="columns" :dataSource="tableData" :options="options" :pagination="tableRequset"></LTable>
+        <LTable ref="table" @selection-change="selection" :defaultFetch="false" :fetch="fetch" :columns="columns" :dataSource="tableData" :options="options" :pagination="tableRequest"></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="任务名称" prop="taskName">
@@ -38,10 +38,10 @@
           <!-- 分句、抽取、审核、入库 -->
           <el-steps :active="active" finish-status="success" process-status="finish">
             <!-- 需要判断分句中、抽取中、。。。。 -->
-            <el-step title="分句"></el-step>
-            <el-step title="抽取"></el-step>
-            <el-step title="审核"></el-step>
-            <el-step title="入库"></el-step>
+            <el-step :title="zeroTitle"></el-step>
+            <el-step :title="oneTitle"></el-step>
+            <el-step :title="twoTitle"></el-step>
+            <el-step :title="threeTitle"></el-step>
           </el-steps>
         </div>
         <div class="view-dataType-table">
@@ -59,21 +59,98 @@
             </el-form>
           </div>
 
-          <LTable ref="table" v-if="active === 1" @selection-change="clauseSelection" :defaultFetch="false" :fetch="fetch" :columns="clauseColumns" :dataSource="clauseTableData" :options="clauseOptions" :pagination="clauseTableRequset"></LTable>
+          <LTable
+            ref="clauseTableRef"
+            v-if="active === 1 || active === 2"
+            @selection-change="clauseSelection"
+            :defaultFetch="false"
+            :fetch="clauseFetch"
+            :columns="clauseColumns"
+            :dataSource="clauseTableData"
+            :options="clauseOptions"
+            :pagination="clauseTableRequest"
+          ></LTable>
+          <graphECharts v-if="active === 3" style="margin: 0 auto" :width="1400" :height="500" :graphData="graphData" class="charts"></graphECharts>
+          <!-- <LTable ref="extractTable" v-if="active === 2" @selection-change="extractSelection" :defaultFetch="false" :fetch="fetch" :columns="extractColumns" :dataSource="extractTableData" :options="extractOptions" :pagination="extractTableRequest"></LTable> -->
         </div>
+
+        <el-dialog width="50%" title="详情" :visible.sync="clauseDialogVisible" :before-close="clauseHandleClose" append-to-body>
+          <el-form ref="clauseFormRef" :model="clauseForm" label-width="80px">
+            <el-form-item label="内容" prop="clause">
+              <el-input type="textarea" :rows="7" v-model="clauseForm.clause" placeholder="请输入内容" />
+            </el-form-item>
+          </el-form>
+
+          <div slot="footer" class="dialog-footer">
+            <el-button @click="clauseDialogVisible = false">取 消</el-button>
+            <el-button type="primary" @click="clauseSubmit">确 定</el-button>
+          </div>
+        </el-dialog>
+
+        <el-dialog width="80%" title="抽取详情" :visible.sync="extractDialogVisible" :before-close="extractHandleClose" append-to-body>
+          <div class="content">
+            <div class="left">
+              <p>{{ extractData.content }}</p>
+            </div>
+            <div class="right">
+              <LTable ref="extractDetailTableRef" :defaultFetch="false" :fetch="extractDetailFetch" :columns="extractDetailColumns" :dataSource="extractData.extractDetailTable" :pagination="extractDetailRequest" :options="extractDetailOptions"></LTable>
+            </div>
+          </div>
+          <div slot="footer" class="dialog-footer">
+            <el-button type="success" @click="addER">新增实体关系</el-button>
+            <el-button @click="handleCancel">作 废</el-button>
+            <el-button type="primary" @click="passThrough">通 过</el-button>
+          </div>
+        </el-dialog>
         <span slot="footer" class="dialog-footer">
           <!-- <el-button @click="handleClose">取 消</el-button> -->
-          <el-button type="primary" v-if="active === 0" @click="handleClause">分 句</el-button>
-          <el-button type="primary" v-if="active === 1" @click="handleExtract">抽 取</el-button>
-          <el-button type="primary" v-if="active === 2" @click="submit">入 库</el-button>
+          <el-button type="primary" v-if="active === 0 && zeroTitle !== '分句中'" :loading="clauseLoading" @click="handleClause">分 句</el-button>
+          <el-button type="primary" v-if="active === 1 && oneTitle !== '抽取中'" :loading="extractLoading" @click="handleExtract">抽 取</el-button>
+          <el-button type="primary" v-if="active === 2 && oneTitle !== '入库中'" :loading="storageLoading" @click="handleStorage">入 库</el-button>
         </span>
       </el-dialog>
+
+      <el-dialog width="30%" title="增加实体关系" :visible.sync="addERDialogVisible" :before-close="addERHandleClose" append-to-body>
+        <el-form ref="addERFormRef" :model="addERForm" label-width="80px">
+          <el-form-item label="头实体" prop="headEntity">
+            <el-input v-model="addERForm.headEntity" placeholder="请输入内容" />
+          </el-form-item>
+          <el-form-item label="头实体类" prop="headEntityClass">
+            <!-- <el-input  v-model="addERForm.headEntityClass" placeholder="请输入内容" /> -->
+            <el-select v-model="addERForm.headEntityClass" placeholder="请选择实体类型">
+              <el-option v-for="(item, index) in entityClassList" :key="index" :label="item" :value="item" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="关系" prop="relation">
+            <!-- <el-input  v-model="addERForm.relation" placeholder="请输入内容" /> -->
+            <el-select v-model="addERForm.relation" placeholder="请选择实体类型">
+              <el-option v-for="(item, index) in relationClassList" :key="index" :label="item" :value="item" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="尾实体" prop="tailEntity">
+            <el-input v-model="addERForm.tailEntity" placeholder="请输入内容" />
+          </el-form-item>
+          <el-form-item label="尾实体类" prop="tailEntityClass">
+            <el-select v-model="addERForm.tailEntityClass" placeholder="请选择实体类型">
+              <el-option v-for="(item, index) in entityClassList" :key="index" :label="item" :value="item" />
+            </el-select>
+          </el-form-item>
+        </el-form>
+
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="addERHandleClose">取 消</el-button>
+          <el-button type="primary" @click="addERSubmit">确 定</el-button>
+        </div>
+      </el-dialog>
     </div>
   </div>
 </template>
 
 <script>
-import { getTaskList, addTask, updateTask, removeTask, taskPro } from '@/api/als/knowledgeExtraction'
+import { getTaskList, addTask, updateTask, removeTask, taskPro, getVisually, removeClause, updateClause, getClauseList, getExtractList, updateExtractInfo, removeExtractInfo, addER } from '@/api/als/knowledgeExtraction'
+import { getAllEntityClass } from '@/api/als/entityManage'
+import { getAllRelationClass } from '@/api/als/ERManage'
+import graphECharts from '@/views/als/components/Charts/graph.vue'
 import { getAtlasFile } from '@/api/als/atlasFile'
 import { getOssIdDataAPI } from '@/api/als/algorithm'
 import { deepClone, debounce } from '@/utils/index'
@@ -81,13 +158,19 @@ import { deepClone, debounce } from '@/utils/index'
 
 export default {
   name: 'KnowledgeExtraction',
-  components: {},
+  components: { graphECharts },
   data() {
     // 这里存放数据
     return {
       dialogTitle: '新增',
       dialogVisible: false,
       detailDialogVisible: false,
+      clauseDialogVisible: false,
+      extractDialogVisible: false,
+      addERDialogVisible: false,
+      clauseLoading: false,
+      extractLoading: false,
+      storageLoading: false,
       keyWordData: '',
       searchValue: '',
       columns: [
@@ -114,6 +197,7 @@ export default {
             const matchedItem = this.$enumData.extractStatus.find((item) => params.row.status === item.key)
             if (matchedItem) {
               return h('span', matchedItem.name)
+              // return h('span', { class: matchedItem.colorType }, matchedItem.name)
             } else {
               return h('span', {}, '')
             }
@@ -132,6 +216,24 @@ export default {
               onClick: (row, index, scope) => {
                 this.checkProcess(row)
               }
+            },
+            {
+              name: '编辑',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.handUpdate(row)
+              }
+            },
+            {
+              name: '删除',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.remove([row])
+              }
             }
           ]
         }
@@ -147,7 +249,7 @@ export default {
       },
       tableCheckItems: [],
       tableData: [],
-      tableRequset: {
+      tableRequest: {
         total: 0,
         pageIndex: 1,
         pageSize: 10,
@@ -155,7 +257,7 @@ export default {
       },
       clauseColumns: [
         {
-          prop: 'content',
+          prop: 'clause',
           label: '内容'
         },
         {
@@ -163,9 +265,39 @@ export default {
           label: '状态',
           width: '240px',
           render: (h, params) => {
-            return h('span', { class: 'success-state' }, '已分句')
+            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: '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: '操作',
@@ -174,6 +306,8 @@ export default {
             {
               name: '编辑',
               type: 'text',
+              statusKey: 'statusKey',
+              disableKey: [3, 4],
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
@@ -183,11 +317,25 @@ export default {
             {
               name: '删除',
               type: 'text',
+              statusKey: 'statusKey',
+              disableKey: [3, 4],
               round: false,
               plain: false,
               onClick: (row, index, scope) => {
                 this.clauseRemove([row])
               }
+            },
+            {
+              name: '查看抽取结果',
+              type: 'text',
+              statusKey: 'statusKey',
+              unDisableKey: '4',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                // this.getExtractListAPI({ clauseId: row.id })
+                this.checkExtractResult(row)
+              }
             }
           ]
         }
@@ -202,8 +350,8 @@ export default {
         height: 'calc(100vh - 470px)'
       },
       clauseTableCheckItems: [],
-      clauseTableData: [{ content: 'XXXXXXXXX水水水水水水水' }, { content: 'mmmmmmmmmmmAAAAAAAAAAA' }, { content: 'mmmmmmmmmmmAAAAAAAAAAA' }, { content: 'mmmmmmmmmmmAAAAAAAAAAA' }],
-      clauseTableRequset: {
+      clauseTableData: [],
+      clauseTableRequest: {
         total: 0,
         pageIndex: 1,
         pageSize: 10,
@@ -216,33 +364,177 @@ export default {
       },
       taskForm: {
         id: '',
-        taskName: '任务名称',
-        fileName: '抽取文件'
+        ossId: '',
+        status: '',
+        taskName: '',
+        fileName: '',
+        taskType: ''
       },
       debounceFn: debounce(this.fetch, 500),
       fileList: [],
       active: 0,
       clauseForm: {
-        content: ''
-      }
+        id: '',
+        taskId: '',
+        clause: '',
+        status: ''
+      },
+      extractData: {
+        content: '',
+        extractDetailTable: []
+      },
+      extractDetailColumns: [
+        {
+          prop: 'headEntity',
+          label: '头实体',
+          edit: true,
+          editStatus: false,
+          onChange: (scope, oldRow) => {
+            const { row } = scope
+            if (oldRow.headEntity == row.headEntity) return
+            this.updateExtractInfoAPI(row)
+          }
+        },
+        {
+          prop: 'headEntityClass',
+          label: '头实体类',
+          edit: true,
+          editStatus: false,
+          onChange: (scope, oldRow) => {
+            const { row } = scope
+            if (oldRow.headEntity == row.headEntityClass) return
+            this.updateExtractInfoAPI(row)
+          }
+        },
+        {
+          prop: 'relation',
+          label: '关系',
+          edit: true,
+          editStatus: false,
+          onChange: (scope, oldRow) => {
+            const { row } = scope
+            if (oldRow.headEntity == row.relation) return
+            this.updateExtractInfoAPI(row)
+          }
+        },
+        {
+          prop: 'tailEntity',
+          label: '尾实体',
+          edit: true,
+          editStatus: false,
+          onChange: (scope, oldRow) => {
+            const { row } = scope
+            if (oldRow.headEntity == row.tailEntity) return
+            this.updateExtractInfoAPI(row)
+          }
+        },
+        {
+          prop: 'tailEntityClass',
+          label: '尾实体类',
+          edit: true,
+          editStatus: false,
+          onChange: (scope, oldRow) => {
+            const { row } = scope
+            if (oldRow.headEntity == row.tailEntityClass) return
+            this.updateExtractInfoAPI(row)
+          }
+        },
+        {
+          button: true,
+          label: '操作',
+          width: '120px',
+          group: [
+            {
+              name: '删除',
+              type: 'text',
+              round: false,
+              plain: false,
+              onClick: (row, index, scope) => {
+                this.removeExtractDetail([row])
+              }
+            }
+          ]
+        }
+      ],
+      extractDetailOptions: {
+        stripe: true, // 斑马纹
+        mutiSelect: false, // 多选框
+        index: true, // 显示序号, 多选则 mutiSelect
+        loading: false, // 表格动画
+        initTable: false, // 是否一挂载就加载数据
+        border: true,
+        height: '450px'
+      },
+      extractDetailRequest: {
+        total: 0,
+        pageIndex: 1,
+        pageSize: 10,
+        searchValue: ''
+      },
+      // extractDetailTableData: [{ content: 'qqq' }, { content: 'www' }, { content: 'eee' }]
+      zeroTitle: '分句',
+      oneTitle: '抽取',
+      twoTitle: '审核',
+      threeTitle: '入库',
+      taskStatus: null,
+      entityClassList: [],
+      relationClassList: [],
+      addERForm: {
+        clauseId: '',
+        headEntity: '',
+        headEntityClass: '',
+        relation: '',
+        tailEntity: '',
+        tailEntityClass: ''
+      },
+      graphData: {}
     }
   },
   watch: {
     keyWord() {
-      this.tableRequset.pageIndex = 1
+      this.tableRequest.pageIndex = 1
       this.debounceFn()
     }
   },
   mounted() {
-    this.getTaskListAPI()
-    this.getAtlasFileAPI()
+    this.init()
   },
   methods: {
+    init() {
+      this.getTaskListAPI()
+      this.getAtlasFileAPI()
+      this.getEntityClassAPI()
+      this.getAllRelationClassAPI()
+    },
     async getAtlasFileAPI(params) {
-      const {
-        data: { list, total }
-      } = await getAtlasFile()
-      this.fileList = list
+      try {
+        const {
+          data: { list, total }
+        } = await getAtlasFile()
+        this.fileList = list
+      } catch (error) {}
+    },
+
+    async getEntityClassAPI(params) {
+      try {
+        const {
+          data: { dataList }
+        } = await getAllEntityClass()
+        dataList.forEach((item) => {
+          this.entityClassList.push(item.name)
+        })
+      } catch (error) {}
+    },
+
+    async getAllRelationClassAPI(params) {
+      try {
+        const {
+          data: { dataList }
+        } = await getAllRelationClass()
+        dataList.forEach((item) => {
+          this.relationClassList.push(item.name)
+        })
+      } catch (error) {}
     },
 
     async removeTaskAPI(params) {
@@ -259,21 +551,67 @@ export default {
       } catch (error) {}
     },
 
+    async removeClauseAPI(params) {
+      try {
+        const { code } = await removeClause(params)
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          await this.getClauseListAPI({ taskId: this.taskForm.id })
+          this.clauseHandleClose()
+        }
+      } catch (error) {}
+    },
+
     async getTaskListAPI(params) {
       if (this.$refs.table) this.$refs.table.clearSelection()
       const { keyWord } = this
-      const { pageSize, pageIndex } = this.tableRequset
+      const { pageSize, pageIndex } = this.tableRequest
       const {
         data: { list, total }
       } = await getTaskList({ pageSize, pageNum: pageIndex, ...params })
       this.tableData = list
-      this.tableRequset.total = total
+      this.tableRequest.total = total
+    },
+
+    async getClauseListAPI(params) {
+      if (this.$refs.clauseTableRef) this.$refs.clauseTableRef.clearSelection()
+      const { keyWord } = this
+      const { pageSize, pageIndex } = this.clauseTableRequest
+      const {
+        data: { list, total }
+      } = await getClauseList({ pageSize, pageNum: pageIndex, ...params })
+      this.clauseTableData = list.map((el) => {
+        return { ...el, statusKey: this.taskStatus }
+      })
+      this.clauseTableRequest.total = total
+    },
+
+    async getExtractListAPI(params) {
+      if (this.$refs.extractDetailTableRef) this.$refs.extractDetailTableRef.clearSelection()
+      const { keyWord } = this
+      const { pageSize, pageIndex } = this.extractDetailRequest
+      const {
+        data: { list, total }
+      } = await getExtractList({ pageSize, pageNum: pageIndex, ...params })
+      this.extractData.extractDetailTable = list
+      this.extractDetailRequest.total = total
     },
 
     fetch() {
       this.getTaskListAPI()
     },
 
+    clauseFetch() {
+      this.getClauseListAPI({ taskId: this.taskForm.id })
+    },
+
+    extractDetailFetch() {
+      this.getExtractListAPI({ clauseId: this.clauseForm.id })
+    },
+
     async searchClick() {
       this.getTaskListAPI({ name: keyWordData })
     },
@@ -307,6 +645,21 @@ export default {
       } catch (error) {}
     },
 
+    async updateClauseAPI() {
+      try {
+        const { code } = await updateClause({ ...this.clauseForm })
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          this.clauseHandleClose()
+          this.extractHandleClose()
+          this.getClauseListAPI({ taskId: this.taskForm.id })
+        }
+      } catch (error) {}
+    },
+
     openDialog() {
       this.dialogTitle = '新增'
       this.dialogVisible = true
@@ -327,6 +680,116 @@ export default {
       this.dialogVisible = true
     },
 
+    // 分句编辑
+    clauseHandUpdate(row) {
+      this.clauseForm = deepClone(row)
+      this.clauseDialogVisible = true
+    },
+
+    // 查看抽取结果
+    checkExtractResult(row) {
+      this.extractData.content = row.clause
+      this.clauseForm = deepClone(row)
+      this.getExtractListAPI({ clauseId: row.id })
+      this.extractDialogVisible = true
+    },
+
+    // 表格更新抽取结果
+    async updateExtractInfoAPI(row) {
+      if (this.handleVerify(row)) {
+        try {
+          console.log('row', row)
+          const { code } = await updateExtractInfo({ ...row })
+          if (code === 200) {
+            this.$message({
+              type: 'success',
+              message: '操作成功!'
+            })
+            // this.clauseHandleClose()
+            // this.getClauseListAPI({ taskId: this.taskForm.id })
+            this.getExtractListAPI({ clauseId: this.clauseForm.id })
+          }
+        } catch (error) {}
+      }
+    },
+
+    // 校验实体关系
+    handleVerify(data) {
+      const { headEntity, headEntityClass, relation, tailEntity, tailEntityClass } = data
+      let str = this.extractData.content
+      if (str.indexOf(headEntity) == -1 || str.indexOf(tailEntity) == -1) {
+        this.extractDetailFetch()
+        this.$message({
+          type: 'warning',
+          message: '实体与文本中匹配有误,请重新输入'
+        })
+        return false
+      }
+      if (!this.entityClassList.includes(headEntityClass) || !this.entityClassList.includes(tailEntityClass)) {
+        this.extractDetailFetch()
+        this.$message({
+          type: 'warning',
+          message: `实体类有误,请重新输入。目前实体类有<${this.entityClassList}>`,
+          duration: 5000
+        })
+        return false
+      }
+
+      if (!this.relationClassList.includes(relation)) {
+        this.extractDetailFetch()
+        this.$message({
+          type: 'warning',
+          message: `关系有误,请重新输入。目前关系有<${this.relationClassList}>`,
+          duration: 5000
+        })
+        return false
+      }
+      return true
+    },
+
+    // 新增实体关系
+    addER() {
+      this.addERDialogVisible = true
+    },
+
+    async addERSubmit() {
+      if (this.handleVerify(this.addERForm)) {
+        try {
+          this.addERForm.clauseId = this.clauseForm.id
+          const { code } = await addER({ ...this.addERForm })
+          if (code === 200) {
+            this.$message({
+              type: 'success',
+              message: '操作成功!'
+            })
+            this.addERHandleClose()
+            this.getExtractListAPI({ clauseId: this.clauseForm.id })
+          }
+        } catch (error) {}
+      }
+    },
+
+    // 作废
+    handleCancel() {
+      this.clauseForm.status = 2
+      this.$confirm('是否将该抽取结果作废?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          // this.removeTaskAPI(row.map((e) => e.id))
+          this.updateClauseAPI()
+        })
+        .catch(() => {})
+    },
+
+    // 通过
+    passThrough() {
+      this.clauseForm.status = 1
+      this.updateClauseAPI()
+    },
+
     submit() {
       switch (this.dialogTitle) {
         case '编辑':
@@ -339,6 +802,14 @@ export default {
       }
     },
 
+    clauseSubmit() {
+      this.updateClauseAPI()
+    },
+
+    extractSubmit() {
+      // this.updateClauseAPI()
+    },
+
     selection(val) {
       this.tableCheckItems = val
     },
@@ -347,8 +818,12 @@ export default {
       this.clauseTableCheckItems = val
     },
 
+    // extractSelection(val) {
+    //   this.extractTableCheckItems = val
+    // },
+
     remove(row) {
-      this.$confirm('是否删除该模型', '提示', {
+      this.$confirm('是否删除该数据', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
@@ -359,33 +834,252 @@ export default {
         .catch(() => {})
     },
 
+    removeExtractDetail(row) {
+      console.log('row', row)
+      this.$confirm('是否删除该条实体关系', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          this.removeExtractInfoAPI(row.map((e) => e.id))
+        })
+        .catch(() => {})
+    },
+
+    async removeExtractInfoAPI(params) {
+      try {
+        const { code } = await removeExtractInfo(params)
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          this.getExtractListAPI({ clauseId: this.clauseForm.id })
+        }
+      } catch (error) {}
+    },
+
+    clauseRemove(row) {
+      this.$confirm('是否删除该数据', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          this.removeClauseAPI(row.map((e) => e.id))
+        })
+        .catch(() => {})
+    },
+
     checkProcess(row) {
-      // this.$router.push({ name: 'ExtractList', query: { id: row.id } })
+      this.taskStatus = row.status
       this.taskForm = deepClone(row)
+      switch (this.taskStatus) {
+        case '0':
+          this.active = 0
+          this.zeroTitle = '待分句'
+          break
+        case '1':
+          this.active = 0
+          this.zeroTitle = '分句中'
+          break
+        case '2':
+          this.active = 1
+          this.zeroTitle = '分句'
+          this.getClauseListAPI({ taskId: row.id })
+          this.oneTitle = '待抽取'
+          break
+        case '3':
+          this.active = 1
+          this.oneTitle = '抽取中'
+          this.getClauseListAPI({ taskId: row.id })
+          break
+        case '4':
+          this.active = 2
+          this.oneTitle = '抽取'
+          this.getClauseListAPI({ taskId: row.id })
+          this.twoTitle = '审核中'
+          break
+        case '5':
+          this.active = 2
+          this.getClauseListAPI({ taskId: row.id })
+          this.twoTitle = '入库中'
+          break
+        case '6':
+          this.twoTitle = '审核'
+          this.threeTitle = '已入库'
+          this.getVisuallyAPI(row)
+          this.active = 3
+          break
+
+        default:
+          break
+      }
       this.detailDialogVisible = true
     },
 
+    async getVisuallyAPI(row) {
+      try {
+        const { code, data } = await getVisually({ ossId: row.ossId })
+        if (code === 200) {
+          // const newData = this.handleData(JSON.parse(data))
+          // console.log('newData', newData)
+          const categories = []
+          data.data.forEach((node) => {
+            const flag = categories.find((item) => {
+              return item.name === node.category
+            })
+            if (!flag) {
+              categories.push({ name: node.category })
+            }
+          })
+          data.categories = categories
+          this.graphData = data
+          console.log('this.graphData', this.graphData)
+        }
+      } catch (error) {}
+    },
+
+    handleData(data) {
+      if (data) {
+        // const newData = eval('(' + data + ')')
+        // data.data = graphData
+        const categories = []
+        data.data.forEach((node) => {
+          const flag = categories.find((item) => {
+            return item.name === node.category
+          })
+          if (!flag) {
+            categories.push({ name: node.category })
+          }
+        })
+        data.categories = categories
+      }
+      return data
+    },
+
     detailHandleClose() {
       this.detailDialogVisible = false
       this.taskForm = {
         id: '',
+        ossId: '',
+        status: '',
         taskName: '',
-        ossId: ''
+        fileName: '',
+        taskType: ''
       }
       this.clauseForm = {
-        content: ''
+        id: '',
+        taskId: '',
+        clause: '',
+        status: ''
+      }
+    },
+
+    clauseHandleClose() {
+      this.clauseDialogVisible = false
+      this.clauseForm = {
+        id: '',
+        taskId: '',
+        clause: '',
+        status: ''
+      }
+    },
+
+    extractHandleClose() {
+      this.extractDialogVisible = false
+      this.extractData = {
+        content: '',
+        extractDetailTable: []
+      }
+    },
+
+    addERHandleClose() {
+      this.addERDialogVisible = false
+      this.addERForm = {
+        clauseId: '',
+        headEntity: '',
+        headEntityClass: '',
+        relation: '',
+        tailEntity: '',
+        tailEntityClass: ''
       }
     },
 
     async handleClause() {
-      // 调用分句接口
-      // const res=await taskPro()
-      this.active = 1
+      this.clauseLoading = true
+      this.taskForm.taskType = 0
+      try {
+        const { code } = await taskPro(this.taskForm)
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '文件开始分句中,稍后刷新页面查看进度',
+            duration: 5000
+          })
+          this.getTaskListAPI()
+          this.detailDialogVisible = false
+          this.clauseLoading = false
+          this.active = 1
+        }
+      } catch (error) {
+        this.clauseLoading = false
+        this.$message({
+          type: 'warning',
+          message: '接口错误请联系管理员'
+        })
+      }
+    },
+
+    async handleExtract() {
+      this.extractLoading = true
+      this.taskForm.taskType = 2
+      try {
+        const { code } = await taskPro(this.taskForm)
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '文件开始抽取中,稍后刷新页面查看进度',
+            duration: 5000
+          })
+          this.getTaskListAPI()
+          this.detailDialogVisible = false
+          this.extractLoading = false
+          this.active = 2
+        }
+      } catch (error) {
+        this.extractLoading = false
+        this.$message({
+          type: 'warning',
+          message: '接口错误请联系管理员'
+        })
+      }
     },
 
-    handleExtract() {
-      // 调用分句接口
-      this.active = 2
+    async handleStorage() {
+      this.storageLoading = true
+      this.taskForm.taskType = 4
+      try {
+        const { code } = await taskPro(this.taskForm)
+        if (code === 200) {
+          this.$message({
+            type: 'success',
+            message: '文件开始入库中,稍后刷新页面查看进度',
+            duration: 5000
+          })
+          this.getTaskListAPI()
+          this.detailDialogVisible = false
+          this.storageLoading = false
+          this.active = 2
+        }
+      } catch (error) {
+        this.storageLoading = false
+        this.$message({
+          type: 'warning',
+          message: '接口错误请联系管理员'
+        })
+      }
     }
   }
 }
@@ -393,4 +1087,20 @@ export default {
 
 <style lang="scss" scoped>
 @import '../index.scss';
+.content {
+  width: 100%;
+  height: 500px;
+  display: flex;
+  .left {
+    width: 30%;
+    padding: 20px;
+    // font-size: 1.1rem;
+    color: white;
+    border-right: 1px solid #eeeeee;
+    overflow: hidden;
+  }
+  .right {
+    width: 70%;
+  }
+}
 </style>

+ 14 - 6
src/views/als/knowledgeManage/ERManage/index.vue

@@ -13,7 +13,7 @@
         </div>
       </div>
       <div class="view-dataType-table">
-        <LTable ref="table" @selection-change="selection" :defaultFetch="false" :fetch="fetch" :columns="columns" :dataSource="tableData" :options="options"></LTable>
+        <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">
@@ -144,7 +144,8 @@ export default {
         relationName: ''
       },
       debounceFn: debounce(this.fetch, 500),
-      relationList: []
+      relationList: [],
+      loading: null
     }
   },
   watch: {
@@ -196,12 +197,18 @@ export default {
     async getRelationAPI(params) {
       try {
         if (this.$refs.table) this.$refs.table.clearSelection()
+        const { pageSize, pageIndex } = this.tableRequset
+        this.loading = this.$loading({
+          lock: true,
+          text: '正在获取知识图谱实体关系数据,请稍候...',
+          spinner: 'el-icon-loading'
+        })
         const {
           data: { dataList, total }
-        } = await getERList()
-        const tableData = this.handleERData(dataList)
-        this.tableData = tableData
-        // this.tableRequset.total = total
+        } = await getERList({ pageSize, pageNum: pageIndex, ...params })
+        this.tableData = dataList
+        this.tableRequset.total = total
+        this.loading.close()
       } catch (error) {}
     },
 
@@ -236,6 +243,7 @@ export default {
           data: { dataList }
         } = await getAllRelationClass()
         this.relationList = dataList
+        this.loading.close()
       } catch (error) {}
     },
 

+ 16 - 2
src/views/als/knowledgeManage/entityManage/index.vue

@@ -13,7 +13,7 @@
         </div>
       </div>
       <div class="view-dataType-table">
-        <LTable ref="table" @selection-change="selection" :defaultFetch="false" :fetch="fetch" :columns="columns" :dataSource="tableData" :options="options"></LTable>
+        <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">
@@ -146,11 +146,24 @@ export default {
     async getEntityAPI(params) {
       try {
         if (this.$refs.table) this.$refs.table.clearSelection()
+        const { pageSize, pageIndex } = this.tableRequset
+        this.loading = this.$loading({
+          lock: true,
+          text: '正在获取知识图谱实体数据,请稍候...',
+          spinner: 'el-icon-loading'
+        })
         const {
           data: { dataList, total }
-        } = await getEntityList()
+        } = await getEntityList({ pageSize, pageNum: pageIndex, ...params })
         this.tableData = dataList
         this.tableRequset.total = total
+        this.loading.close()
+
+        // const {
+        //   data: { dataList, total }
+        // } = await getEntityList()
+        // this.tableData = dataList
+        // this.tableRequset.total = total
       } catch (error) {}
     },
 
@@ -160,6 +173,7 @@ export default {
           data: { dataList }
         } = await getAllEntityClass()
         this.categoryList = dataList
+        this.loading.close()
       } catch (error) {}
     },
 

+ 126 - 24
src/views/als/lifePrediction/index.vue

@@ -21,13 +21,16 @@
         <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"></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,11 +44,11 @@
       <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%" :before-close="resultShowDialogClose">
+        <el-image style="width: 500px" :src="resultShowData.url" :preview-src-list="[resultShowData.url]"></el-image>
         <span slot="footer" class="dialog-footer">
-          <el-button @click="resultVisible = false">取 消</el-button>
-          <el-button type="primary" @click="resultVisible = false">确 定</el-button>
+          <el-button @click="resultShowDialogClose">取 消</el-button>
+          <el-button type="primary" @click="resultShowDialogClose">确 定</el-button>
         </span>
       </el-dialog>
     </div>
@@ -62,6 +65,8 @@ 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 { getAllDataImport } from '@/api/als/dataImport'
+import { getListByIdsApi } from '@/api/als/oss'
 
 export default {
   name: 'LifePrediction',
@@ -123,11 +128,14 @@ export default {
         },
         {
           prop: 'status',
-          label: '状态'
-        },
-        {
-          prop: 'resultContent',
-          label: '结果'
+          label: '状态',
+          render: (h, params) => {
+            if (params.row.status == 0) {
+              return h('span', { class: 'warning-state' }, '失败')
+            } else {
+              return h('span', { class: 'success-state' }, '成功')
+            }
+          }
         },
         {
           button: true,
@@ -135,7 +143,7 @@ export default {
           width: '240px',
           group: [
             {
-              name: '查看',
+              name: '查看结果',
               type: 'text',
               round: false,
               plain: false,
@@ -172,6 +180,38 @@ 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'
+      },
+      sortieNoList: [],
+      sortieNoCheckItems: [],
       form: {
         id: '',
         aircraftId: '',
@@ -182,12 +222,26 @@ 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: '',
+      resultShowData: {
+        url: ''
+      }
     }
   },
   watch: {
@@ -266,6 +320,25 @@ 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 { code, data } = await getAllDataImport({ ...params, source: 1 })
+        if (code === 200) {
+          this.sortieNoList = data
+        }
+      } catch (error) {}
+    },
+
     async searchClick() {
       this.getLifePredictionAPI({ aircraftId: this.aircaftModelIdList, name: this.keyWordData })
     },
@@ -282,7 +355,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 +386,34 @@ export default {
         model: '',
         methodType: '',
         status: '',
-        resultContent: ''
+        resultContent: '',
+        ossIds: []
       }
     },
-    checkResult(row) {
-      // this.form = deepClone(row)
+
+    resultShowDialogClose() {
+      this.resultVisible = false
+      this.resultShowData = {
+        url: ''
+      }
+    },
+
+    async checkResult(row) {
+      const { data } = await getListByIdsApi(JSON.parse(row.resultContent).ossId)
+      this.resultShowData.url = data[0].url
       this.resultVisible = true
     },
     async beginExecute() {
+      this.sortieNoCheckItems.forEach((item) => {
+        this.form.ossIds.push(item.ossId)
+      })
+      if (this.sortieNoCheckItems.length == 0) {
+        this.$message({
+          type: 'success',
+          message: '请选择架次号!'
+        })
+        return
+      }
       this.progressVisible = true
 
       let myTimer = setInterval(() => {
@@ -341,6 +436,9 @@ export default {
             type: 'success',
             message: '执行成功!'
           })
+          const { data } = await getListByIdsApi(JSON.parse(res.data).ossId)
+          this.resultShowData.url = data[0].url
+          this.resultVisible = true
           this.getLifePredictionAPI({ aircraftId: this.aircaftModelIdList })
         }
       } catch (error) {
@@ -363,13 +461,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) {

+ 7 - 7
src/views/als/utils/enum-data.js

@@ -12,13 +12,13 @@ export const agloModelList = [
 
 // 抽取状态
 export const extractStatus = [
-  { key: '0', name: '待分句' },
-  { key: '1', name: '分句中' },
-  { key: '2', name: '待抽取' },
-  { key: '3', name: '抽取中' },
-  { key: '4', name: '审核中' },
-  { key: '5', name: '入库中' },
-  { key: '6', name: '已入库' }
+  { key: '0', name: '待分句', colorType: 'info-state' },
+  { key: '1', name: '分句中', colorType: 'info-state' },
+  { key: '2', name: '待抽取', colorType: 'warning-state' },
+  { key: '3', name: '抽取中', colorType: 'warning-state' },
+  { key: '4', name: '审核中', colorType: 'danger-state' },
+  { key: '5', name: '入库中', colorType: 'danger-state' },
+  { key: '6', name: '已入库', colorType: 'success-state' }
 ]
 
 const enumData = {

+ 1 - 1
src/views/basicData/dataAircraftCataloging/index.js

@@ -48,7 +48,7 @@ export const columns = (_this) => [
     prop: 'status',
     label: '状态',
     render: (h, params) => {
-      if (params.row.status == 0) {
+      if (params.row.status == 1) {
         return h('span', { class: 'success-state' }, '服役')
       } else {
         return h('span', { class: 'warning-state' }, '退役')

+ 2 - 2
src/views/basicData/dataAircraftCataloging/index.vue

@@ -184,10 +184,10 @@ export default {
       const { keyWord } = this
       const { pageSize, pageIndex } = this.tableRequset
       const {
-        data: { list, totalCount }
+        data: { list, total }
       } = await getAircaftCatalog({ pageSize, pageIndex, keyWord, ...params })
       this.tableData = list
-      this.tableRequset.total = totalCount
+      this.tableRequset.total = total
     },
 
     fetch() {

+ 5 - 5
src/views/carrierStandard/carrierComputationalModel/index.vue

@@ -31,11 +31,11 @@
         </el-table-column>
         <el-table-column label="操作" align="center" width="300">
           <template slot-scope="scope">
-            <el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button>
-            <el-button @click="remove(scope.row)" type="text" size="small">删除</el-button>
-            <el-button :disabled="scope.row.status == 1" @click="updateState(scope.row, '启用')" type="text" size="small">启用</el-button>
-            <el-button :disabled="scope.row.status == 0" @click="updateState(scope.row, '禁用')" type="text" size="small">禁用</el-button>
-            <el-button @click="openDrawer(scope.row)" type="text" size="small">历史版本</el-button>
+            <el-button :disabled="scope.row.isEdit == 0" @click="edit(scope.row)" type="text" size="small">编辑</el-button>
+            <el-button :disabled="scope.row.isEdit == 0" @click="remove(scope.row)" type="text" size="small">删除</el-button>
+            <el-button :disabled="scope.row.status == 1 || scope.row.isEdit == 0" @click="updateState(scope.row, '启用')" type="text" size="small">启用</el-button>
+            <el-button :disabled="scope.row.status == 0 || scope.row.isEdit == 0" @click="updateState(scope.row, '禁用')" type="text" size="small">禁用</el-button>
+            <el-button :disabled="scope.row.isEdit == 0" @click="openDrawer(scope.row)" type="text" size="small">历史版本</el-button>
           </template>
         </el-table-column>
       </el-table>

+ 2 - 2
src/views/carrierStandard/carrierListShipping/components/compile/index.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="view-CarrierListMachineryPreparation-c">
     <div class="view-CarrierListMachineryPreparation-box">
-      <div class="view-CarrierListMachineryPreparation-box-left">
+      <!-- <div class="view-CarrierListMachineryPreparation-box-left">
         <el-radio-group v-model="summarizing">
           <el-radio-button label="汇总数据"></el-radio-button>
           <el-radio-button label="原数据"></el-radio-button>
         </el-radio-group>
-      </div>
+      </div> -->
 
       <div class="view-CarrierListMachineryPreparation-box-right">
         <MissionDetail :detail="detail" />

+ 33 - 17
src/views/home/index.vue

@@ -6,7 +6,7 @@
           <template slot="content">
             <div class="airStatus">
               <div class="firstRow">
-                <div v-for="item of aircaftCatalogAll" :key="item.aircaftCatalogId" class="cell">
+                <div v-for="item of airMap" :key="item.aircaftCatalogId" class="cell">
                   <el-image style="width: 80px; height: 80px; margin-top: 10px" :src="imgUrl"></el-image>
                   <div class="info">
                     <p>{{ item.aircaftCatalogCode }}</p>
@@ -29,10 +29,10 @@
       </el-col>
     </el-row>
     <el-row>
-      <el-col :span="24" style="margin-bottom: 15px">
+      <el-col :span="24" style="margin-bottom: 65px">
         <Card title="维修状态">
           <template slot="content">
-            <LTable ref="maintainTable" :defaultFetch="true" :columns="maintainColumns" :dataSource="maintainTableData" :options="maintainOptions" :fetch="maintainFetchTableData" class="tabl-box" />
+            <LTable ref="maintainTable" :defaultFetch="true" :columns="maintainColumns" :dataSource="maintainTableData" :options="maintainOptions" :fetch="maintainFetchTableData" :pagination="tableRequset" class="tabl-box" />
           </template>
         </Card>
       </el-col>
@@ -90,7 +90,7 @@
 
 <script>
 import { getHomeLastMission, getAviationList, getHomeAviationProject, getHomeAviationAmount, getHomeAviationMoney } from '@/api/home'
-import { getFaultStatisticsListAll } from '@/api/als/faultStatistics'
+import { getExclusionList, getExclusionListAll } from '@/api/als/faultStatistics'
 import { getAircaftCatalogAll } from '@/api/als/aircraft'
 
 import * as echarts from 'echarts'
@@ -119,7 +119,15 @@ export default {
       bottomCenterOptions,
       bottomRightOptions,
       imgUrl: require('@/assets/images/飞机.png'),
-      aircaftCatalogAll: []
+      aircaftCatalogAll: [],
+      airMap: [],
+      tableRequset: {
+        total: 0,
+        pageIndex: 1,
+        pageSize: 10,
+        searchValue: ''
+      },
+      allFaultRecord: []
     }
   },
   mounted() {
@@ -149,26 +157,34 @@ export default {
       this.fetchIndexAnalysis()
     },
     async maintainFetchTableData() {
-      const { data } = await getFaultStatisticsListAll({})
-      this.maintainTableData = data.filter((item) => {
-        return item.repairStatus !== '已完成'
+      const { pageSize, pageIndex } = this.tableRequset
+      const {
+        data: { list, total }
+      } = await getExclusionList({ pageSize, pageNum: pageIndex })
+      this.tableRequset.total = total
+      this.maintainTableData = list.map((item) => {
+        return { ...item, repairStatus: '排故中' }
       })
-      // this.getAircaftCatalogAllAPI()
+      const res = await getExclusionListAll({})
+      this.allFaultRecord = res.data
       const { data: AircaftCatalogData } = await getAircaftCatalogAll({
         keyWord: '',
         aircaftModelIdList: []
       })
       this.aircaftCatalogAll = AircaftCatalogData
-      this.maintainTableData.forEach((item) => {
-        this.aircaftCatalogAll.forEach((airItem) => {
-          if (airItem.aircaftCatalogCode === item.aircraftNum) {
-            airItem.healthStatus = '故障'
-          } else {
-            airItem.healthStatus = '健康'
-          }
+      this.airMap = []
+      this.aircaftCatalogAll.forEach((item) => {
+        const obj = this.allFaultRecord.find((airItem) => {
+          return item.aircaftCatalogCode == airItem.aircraftNum
         })
+        if (obj) {
+          item.healthStatus = '故障'
+        } else {
+          item.healthStatus = '健康'
+        }
+        this.airMap.push({ ...item })
       })
-      console.log('this.aircaftCatalogAll', this.aircaftCatalogAll)
+      console.log('this.aircaftCatalogAll', this.airMap)
     },
     handleChange(item) {
       switch (item) {

+ 1 - 1
src/views/home/table.js

@@ -111,7 +111,7 @@ export const maintainColumns = (_this) => [
 export const maintainOptions = {
   stripe: true, // 斑马纹
   mutiSelect: false, // 多选框
-  index: false, // 显示序号, 多选则 mutiSelect
+  index: true, // 显示序号, 多选则 mutiSelect
   loading: false, // 表格动画
   initTable: true, // 是否一挂载就加载数据
   border: true,

+ 2 - 2
src/views/system/systemBackup/importDialog/index.vue

@@ -2,10 +2,10 @@
   <el-dialog :title="dialogtitle" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center>
     <div class="upload">
       <div class="upload-left">导入文件</div>
-      <el-upload class="upload-right" ref="upload" accept=".arff" :action="fileApi" :file-list="fileList" :data="fileData" :auto-upload="false" :on-success="onSuccess" :limit="1">
+      <el-upload class="upload-right" ref="upload" accept=".arff,.csv" :action="fileApi" :file-list="fileList" :data="fileData" :auto-upload="false" :on-success="onSuccess" :limit="1">
         <el-button slot="trigger" style="margin-right: 30px" size="small" type="primary">选择文件</el-button>
         <el-button size="small" type="success" @click="submitUpload">导入数据</el-button>
-        <div slot="tip" class="el-upload__tip" style="margin-left: 10px; margin-top: 10px; font-size: 14px">只能导入 arff 文件</div>
+        <div slot="tip" class="el-upload__tip" style="margin-left: 10px; margin-top: 10px; font-size: 14px">只能导入 csv / arff 文件</div>
       </el-upload>
     </div>
   </el-dialog>

+ 1 - 1
vue.config.js

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