Browse Source

智能问答图谱显示问题修复

liuyiran 1 week ago
parent
commit
1f87b8b808
2 changed files with 12 additions and 13 deletions
  1. 1 3
      src/views/als/faultDiagnosis/index.vue
  2. 11 10
      src/views/als/intelligentQA/index.vue

+ 1 - 3
src/views/als/faultDiagnosis/index.vue

@@ -29,7 +29,7 @@
               <span style="margin-left: 3px; color: #f7ba2a; font-size: 1.2rem">{{ diagnosisResult.score }}</span>
               <span style="margin-left: 3px; color: #f7ba2a; font-size: 1.2rem">{{ diagnosisResult.score }}</span>
             </div>
             </div>
           </el-descriptions-item>
           </el-descriptions-item>
-          <el-descriptions-item label="退化结果">
+          <el-descriptions-item label="飞行能力影响">
             <el-tag class="fault" style="margin-right: 20px" type="danger" v-for="(item, index) in diagnosisResult.degradation" :key="index" @click="handelQA(item)">{{ item }}</el-tag>
             <el-tag class="fault" style="margin-right: 20px" type="danger" v-for="(item, index) in diagnosisResult.degradation" :key="index" @click="handelQA(item)">{{ item }}</el-tag>
           </el-descriptions-item>
           </el-descriptions-item>
           <el-descriptions-item label="故障结果">
           <el-descriptions-item label="故障结果">
@@ -512,8 +512,6 @@ export default {
     },
     },
     handleData(data) {
     handleData(data) {
       if (data.graphAnswer?.graph) {
       if (data.graphAnswer?.graph) {
-        const graphAnswer = eval('(' + data.graphAnswer.graph + ')')
-        data.graphAnswer.graph = graphAnswer
         const categories = []
         const categories = []
         data.graphAnswer.graph.data.forEach((node) => {
         data.graphAnswer.graph.data.forEach((node) => {
           const flag = categories.find((item) => {
           const flag = categories.find((item) => {

+ 11 - 10
src/views/als/intelligentQA/index.vue

@@ -135,7 +135,7 @@ export default {
       // TODO 问答给数据后将该字段替换
       // TODO 问答给数据后将该字段替换
       filePage: '2',
       filePage: '2',
       fileTotalPage: null,
       fileTotalPage: null,
-      sqlAnswerKey: [],
+      // sqlAnswerKey: [],
       collapseActiveNames: [],
       collapseActiveNames: [],
       main: null,
       main: null,
       askUrl: '/als/algorithm/execute/qa',
       askUrl: '/als/algorithm/execute/qa',
@@ -252,13 +252,14 @@ export default {
 
 
         const { code, data } = await handlerAsk(sendInput)
         const { code, data } = await handlerAsk(sendInput)
         if (code == 200) {
         if (code == 200) {
-          const newData = this.handleData(JSON.parse(data))
-          // const newData = this.handleData(data)
-          this.chatInfo.pop()
-          this.chatInfo.push(newData)
-
+          this.$nextTick(() => {
+            // const newData = this.handleData(data)
+            const newData = this.handleData(JSON.parse(data))
+            this.chatInfo.pop()
+            this.chatInfo.push(newData)
+          })
           // 获取sql回答的键
           // 获取sql回答的键
-          this.sqlAnswerKey = Object.keys(JSON.parse(data).sqlAnswer[0])
+          // this.sqlAnswerKey = Object.keys(JSON.parse(data).sqlAnswer[0])
         }
         }
       } catch (error) {}
       } catch (error) {}
     },
     },
@@ -321,9 +322,9 @@ export default {
             question: data.question,
             question: data.question,
             userId: data.userId
             userId: data.userId
           })
           })
-          if (newData.sqlAnswer) {
-            this.sqlAnswerKey = Object.keys(newData.sqlAnswer[0])
-          }
+          // if (newData.sqlAnswer) {
+          //   this.sqlAnswerKey = Object.keys(newData.sqlAnswer[0])
+          // }
           this.chatInfo.push(newData)
           this.chatInfo.push(newData)
         }
         }
         this.chatLoading = false
         this.chatLoading = false