|
@@ -44,7 +44,9 @@
|
|
</div>
|
|
</div>
|
|
</el-collapse-item>
|
|
</el-collapse-item>
|
|
</el-collapse>
|
|
</el-collapse>
|
|
- <div style="margin-top: 10px">{{ item.llmAnswer.answer }}</div>
|
|
|
|
|
|
+ <!-- <div style="margin-top: 10px">{{ item.llmAnswer.answer }}</div> -->
|
|
|
|
+ <div v-if="item.llmAnswer.think" class="think" v-html="renderMarkdown(item.llmAnswer.think)"></div>
|
|
|
|
+ <div style="margin-top: 10px" v-html="renderMarkdown(item.llmAnswer.answer)"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- sql -->
|
|
<!-- sql -->
|
|
@@ -156,15 +158,28 @@ export default {
|
|
filePage: '2',
|
|
filePage: '2',
|
|
fileTotalPage: null,
|
|
fileTotalPage: null,
|
|
sqlAnswerKey: [],
|
|
sqlAnswerKey: [],
|
|
- collapseActiveNames: []
|
|
|
|
|
|
+ collapseActiveNames: [],
|
|
|
|
+ main: null,
|
|
|
|
+ askUrl: '/als/algorithm/execute/qa'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
|
|
+ this.main = document.getElementsByClassName('main')[0]
|
|
this.getHistoryAll()
|
|
this.getHistoryAll()
|
|
this.getGroupAPI()
|
|
this.getGroupAPI()
|
|
this.adjustHeight()
|
|
this.adjustHeight()
|
|
},
|
|
},
|
|
- watch: {},
|
|
|
|
|
|
+ watch: {
|
|
|
|
+ chatInfo: {
|
|
|
|
+ handler() {
|
|
|
|
+ // 当原始列变化时,更新本地列
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.main.scrollTop = this.main.scrollHeight
|
|
|
|
+ }, 0)
|
|
|
|
+ },
|
|
|
|
+ deep: true
|
|
|
|
+ }
|
|
|
|
+ },
|
|
created() {},
|
|
created() {},
|
|
methods: {
|
|
methods: {
|
|
adjustHeight() {
|
|
adjustHeight() {
|
|
@@ -222,7 +237,8 @@ export default {
|
|
|
|
|
|
async sendQuestion() {
|
|
async sendQuestion() {
|
|
// 等处理过返回数据后,调用使视图保持在最底部
|
|
// 等处理过返回数据后,调用使视图保持在最底部
|
|
- let main = this.$refs.main
|
|
|
|
|
|
+ // let main = this.$refs.main
|
|
|
|
+ // let main = document.getElementsByClassName('main')
|
|
const sendInput = {
|
|
const sendInput = {
|
|
question: this.questionInput,
|
|
question: this.questionInput,
|
|
userId: String(store.state.user.userInfo.user.userId)
|
|
userId: String(store.state.user.userInfo.user.userId)
|
|
@@ -235,6 +251,10 @@ export default {
|
|
answer: '正在解析您的问题,请稍后......'
|
|
answer: '正在解析您的问题,请稍后......'
|
|
})
|
|
})
|
|
this.questionInput = ''
|
|
this.questionInput = ''
|
|
|
|
+ // const eventSource = new EventSource(this.askUrl)
|
|
|
|
+ // eventSource.onmessage = (event) => {
|
|
|
|
+ // console.log('数据', event.data)
|
|
|
|
+ // }
|
|
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(JSON.parse(data))
|
|
@@ -244,14 +264,7 @@ export default {
|
|
|
|
|
|
// 获取sql回答的键
|
|
// 获取sql回答的键
|
|
this.sqlAnswerKey = Object.keys(JSON.parse(data).sqlAnswer[0])
|
|
this.sqlAnswerKey = Object.keys(JSON.parse(data).sqlAnswer[0])
|
|
- setTimeout(() => {
|
|
|
|
- main.scrollTop = main.scrollHeight
|
|
|
|
- }, 0)
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
- setTimeout(() => {
|
|
|
|
- main.scrollTop = main.scrollHeight
|
|
|
|
- }, 0)
|
|
|
|
} catch (error) {}
|
|
} catch (error) {}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -274,7 +287,7 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
handleMore(data) {
|
|
handleMore(data) {
|
|
- this.getListById(data.ossId)
|
|
|
|
|
|
+ this.getListById(data.graphAnswer.ossId)
|
|
this.moreData = data
|
|
this.moreData = data
|
|
this.dialogVisible = true
|
|
this.dialogVisible = true
|
|
},
|
|
},
|