|
@@ -14,7 +14,7 @@
|
|
|
<div class="chat">
|
|
|
<!-- <div class="header">Header</div> -->
|
|
|
<div ref="main" class="main">
|
|
|
- <div class="chatLine">
|
|
|
+ <div class="chatLine" v-loading="chatLoading">
|
|
|
<div v-for="(item, index) in chatInfo" :key="index">
|
|
|
<div class="chatRow chatQ" v-if="item.question">
|
|
|
<div class="questionContent">{{ item.question }}</div>
|
|
@@ -139,6 +139,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
loading: false,
|
|
|
+ chatLoading: false,
|
|
|
dialogVisible: false,
|
|
|
chatInfo: [],
|
|
|
questionInput: '', //202310150010
|
|
@@ -274,6 +275,7 @@ export default {
|
|
|
// eventSource.onmessage = (event) => {
|
|
|
// console.log('数据', event.data)
|
|
|
// }
|
|
|
+
|
|
|
const { code, data } = await handlerAsk(sendInput)
|
|
|
if (code == 200) {
|
|
|
const newData = this.handleData(JSON.parse(data))
|
|
@@ -335,6 +337,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
async historyDetail(id) {
|
|
|
+ this.chatLoading = true
|
|
|
try {
|
|
|
const { code, data } = await getQAHistoryDetail(id)
|
|
|
if (code == 200) {
|
|
@@ -348,6 +351,7 @@ export default {
|
|
|
this.sqlAnswerKey = Object.keys(newData.sqlAnswer[0])
|
|
|
}
|
|
|
this.chatInfo.push(newData)
|
|
|
+ this.chatLoading = false
|
|
|
}
|
|
|
} catch (error) {}
|
|
|
},
|