Jelajahi Sumber

接口联调

Rmengdi 2 minggu lalu
induk
melakukan
29f91c465d

+ 1 - 1
src/api/als/intelligentQA.js

@@ -2,7 +2,7 @@ import { get, post, deletes } from '@/http/index'
 
 // 问答接口
 export const handlerQAndA = async (data) => {
-  return await post('/kgqa/ask/', data)
+  return await post('/kgqa/ask', data)
 }
 // 问答接口
 export const handlerAsk = async (data) => {

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

@@ -93,15 +93,15 @@ export default [
           title: '飞机编目管理'
         }
       },
-      {
-        name: 'AirInstall',
-        path: '/dataManage/airInstall',
-        component: () => import('@/views/als/airInstall/index.vue'),
-        meta: {
-          parent: 'BasicData',
-          title: '装机管理'
-        }
-      },
+      // {
+      //   name: 'AirInstall',
+      //   path: '/dataManage/airInstall',
+      //   component: () => import('@/views/als/airInstall/index.vue'),
+      //   meta: {
+      //     parent: 'BasicData',
+      //     title: '装机管理'
+      //   }
+      // },
       // {
       //   name: 'DataSailingMaterialClassification',
       //   path: '/basicData/dataSailingMaterialClassification',
@@ -218,15 +218,15 @@ export default [
       //     title: '历年航材消耗数据-汇总计算'
       //   }
       // },
-      {
-        name: 'PreResult',
-        path: '/qualityManage/preProcessing',
-        component: () => import('@/views/als/preProcessing/index.vue'),
-        meta: {
-          parent: 'BasicData',
-          title: '数据预处理'
-        }
-      },
+      // {
+      //   name: 'PreResult',
+      //   path: '/qualityManage/preProcessing',
+      //   component: () => import('@/views/als/preProcessing/index.vue'),
+      //   meta: {
+      //     parent: 'BasicData',
+      //     title: '数据预处理'
+      //   }
+      // },
       // {
       //   name: 'FlightData',
       //   path: '/dataManage/flightData',
@@ -236,33 +236,33 @@ export default [
       //     title: '飞参数据'
       //   }
       // },
-      {
-        name: 'JudgeFaultLogic',
-        path: '/dataManage/judgeFaultLogic',
-        component: () => import('@/views/als/judgeFaultLogic/index.vue'),
-        meta: {
-          parent: 'BasicData',
-          title: '判故逻辑管理'
-        }
-      },
-      {
-        name: 'AirConfigParams',
-        path: '/dataManage/AirConfigParams',
-        component: () => import('@/views/als/airConfigParams/index.vue'),
-        meta: {
-          parent: 'BasicData',
-          title: '构型参数管理'
-        }
-      },
-      {
-        name: 'AtlasFile',
-        path: '/knowledgeGraph/atlasFile',
-        component: () => import('@/views/als/atlasFile/index.vue'),
-        meta: {
-          parent: 'BasicData',
-          title: '文件管理'
-        }
-      },
+      // {
+      //   name: 'JudgeFaultLogic',
+      //   path: '/dataManage/judgeFaultLogic',
+      //   component: () => import('@/views/als/judgeFaultLogic/index.vue'),
+      //   meta: {
+      //     parent: 'BasicData',
+      //     title: '判故逻辑管理'
+      //   }
+      // },
+      // {
+      //   name: 'AirConfigParams',
+      //   path: '/dataManage/AirConfigParams',
+      //   component: () => import('@/views/als/airConfigParams/index.vue'),
+      //   meta: {
+      //     parent: 'BasicData',
+      //     title: '构型参数管理'
+      //   }
+      // },
+      // {
+      //   name: 'AtlasFile',
+      //   path: '/knowledgeGraph/atlasFile',
+      //   component: () => import('@/views/als/atlasFile/index.vue'),
+      //   meta: {
+      //     parent: 'BasicData',
+      //     title: '文件管理'
+      //   }
+      // },
       // {
       //   name: 'LLM',
       //   path: '/dataManage/LLM',
@@ -272,15 +272,15 @@ export default [
       //     title: '知识库管理'
       //   }
       // },
-      {
-        name: 'KnowledgeExtraction',
-        path: '/knowledgeGraph/knowledgeExtraction',
-        component: () => import('@/views/als/knowledgeExtraction/index.vue'),
-        meta: {
-          parent: 'BasicData',
-          title: '知识抽取'
-        }
-      },
+      // {
+      //   name: 'KnowledgeExtraction',
+      //   path: '/knowledgeGraph/knowledgeExtraction',
+      //   component: () => import('@/views/als/knowledgeExtraction/index.vue'),
+      //   meta: {
+      //     parent: 'BasicData',
+      //     title: '知识抽取'
+      //   }
+      // },
       // {
       //   name: 'ExtractList',
       //   path: '/knowledgeGraph/extractList',
@@ -291,15 +291,15 @@ export default [
       //     title: '抽取列表'
       //   }
       // },
-      {
-        name: 'EntityManage',
-        path: '/knowledgeGraph/entityManage',
-        component: () => import('@/views/als/knowledgeManage/entityManage/index.vue'),
-        meta: {
-          parent: 'BasicData',
-          title: '实体管理'
-        }
-      },
+      // {
+      //   name: 'EntityManage',
+      //   path: '/knowledgeGraph/entityManage',
+      //   component: () => import('@/views/als/knowledgeManage/entityManage/index.vue'),
+      //   meta: {
+      //     parent: 'BasicData',
+      //     title: '实体管理'
+      //   }
+      // },
       {
         name: 'ERManage',
         path: '/knowledgeGraph/ERManage',

+ 2 - 1
src/views/als/components/Charts/graph.vue

@@ -36,7 +36,8 @@ export default {
           this.setOptions()
         }
       },
-      deep: true
+      deep: true,
+      immediate: true
     }
   },
   mounted() {

+ 20 - 49
src/views/als/faultDiagnosis/index.vue

@@ -21,7 +21,7 @@
       <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">
+      <el-dialog title="结果展示" :visible.sync="resultShowVisible" :before-close="resultShowDialogClose" v-loading="tagLoading" width="800px">
         <el-descriptions border :column="1">
           <el-descriptions-item label="评分">
             <div style="display: flex; align-items: center">
@@ -40,12 +40,11 @@
           <el-button type="primary" @click="resultShowDialogClose">确 定</el-button>
         </span>
       </el-dialog>
-      <el-dialog title="问答结果" :visible.sync="QAVisible" width="1000px" :before-close="QADialogClose">
+      <el-dialog title="问答结果" :visible.sync="QAVisible" width="1000px" :before-close="QADialogClose" append-to-body>
         <div style="color: white; font-size: 20px; margin-bottom: 20px">
           {{ QAData.graphAnswer.answer }}
         </div>
-        <graphECharts :width="950" :height="400" :graphData="QAData.graphAnswer.graph"></graphECharts>
-
+        <graphECharts :width="950" :height="400" v-if="QAData.graphAnswer.graph" :graphData="QAData.graphAnswer.graph"></graphECharts>
         <span slot="footer" class="dialog-footer">
           <el-button type="primary" @click="QAVisible = false">确 定</el-button>
         </span>
@@ -272,7 +271,8 @@ export default {
       QAData: {
         userId: '',
         graphAnswer: {}
-      }
+      },
+      tagLoading: false
     }
   },
   watch: {
@@ -488,57 +488,28 @@ export default {
         this.percentage = 0
       }
     },
-
-    async handelQA(question) {
+    handelQA(question) {
       this.loading = true
+      this.tagLoading = true
       const sendInput = {
         question: question,
         userId: String(store.state.user.userInfo.user.userId)
       }
-      try {
-        if (question.trim() === '') {
-          return
-        }
-
-        const { code, data } = await handlerQAndA(sendInput)
-        // const { code, data } = {
-        //   code: 200,
-        //   msg: '',
-        //   data: {
-        //     userId: 'user',
-        //     graphAnswer: {
-        //       answer: '解决办法为:更换电池或遥控器',
-        //       fileName: '排故手册',
-        //       ossId: '227701077942149120', //pdf
-        //       // ossID: '227692224508796928', //word
-        //       filePage: 2,
-        //       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))
-          this.QAData = this.handleData(JSON.parse(data))
+      handlerQAndA(sendInput)
+        .then((res) => {
+          if (res.code == 200) {
+            this.QAData = this.handleData(res.data)
+            this.QAVisible = true
+          }
+        })
+        .catch((e) => {
+          console.log(e)
+        })
+        .finally(() => {
           this.loading = false
-          this.QAVisible = true
-        }
-      } catch (error) {}
+          this.tagLoading = false
+        })
     },
-
     handleData(data) {
       if (data.graphAnswer?.graph) {
         const graphAnswer = eval('(' + data.graphAnswer.graph + ')')

+ 2 - 2
vue.config.js

@@ -17,7 +17,7 @@ module.exports = defineConfig({
       },
       ['/api/kgqa']: {
         // target: 'http://192.168.0.107:7073',
-        target: 'http://192.168.2.120:7073',
+        target: 'http://192.168.0.103:7074',
         ws: false,
         changeOrigin: true,
         pathRewrite: {
@@ -25,7 +25,7 @@ module.exports = defineConfig({
         }
       },
       ['/api/knowledge_base']: {
-        target: 'http://192.168.2.120:7861',
+        target: 'http://192.168.0.103:7861',
         ws: false,
         changeOrigin: true,
         pathRewrite: {