|
|
|
@ -68,7 +68,7 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import AbortController from "abort-controller/dist/abort-controller"; |
|
|
|
|
// import AbortController from "abort-controller/dist/abort-controller"; |
|
|
|
|
import TopTitle from "../../components/top-title.vue"; |
|
|
|
|
// import headerNavBar from '../../components/headerNavBar/headerNavBar.vue' |
|
|
|
|
import zeroMarkdownView from "../../components/zeroMarkdownView/zeroMarkdownView.vue"; |
|
|
|
@ -114,6 +114,7 @@ |
|
|
|
|
text: "请给我一个典型的视距不良路口案例。", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
timer: null |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
@ -143,6 +144,7 @@ |
|
|
|
|
methods: { |
|
|
|
|
async queryChat(voiceText) { |
|
|
|
|
// console.log(voiceText,"voiceText"); |
|
|
|
|
clearInterval(this.timer) |
|
|
|
|
this.loading = true; |
|
|
|
|
const [err, res] = await uni.request({ |
|
|
|
|
// url: 'http://10.16.3.159:8777/api/local_doc_qa/local_doc_chat', |
|
|
|
@ -186,8 +188,8 @@ |
|
|
|
|
if (err) { |
|
|
|
|
console.log("request fail", err.errMsg); |
|
|
|
|
} |
|
|
|
|
this.loading = false |
|
|
|
|
this.changeMsgList("1", "查询失败,请联系管理员或稍后重试!"); |
|
|
|
|
this.loading = false |
|
|
|
|
this.changeMsgList("1", "查询失败,请联系管理员或稍后重试!"); |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: "查询失败", |
|
|
|
|
icon: "error", |
|
|
|
@ -228,7 +230,7 @@ |
|
|
|
|
// 后台返回来的消息 |
|
|
|
|
let newdata = ""; |
|
|
|
|
let index = 0; |
|
|
|
|
const timer = setInterval(() => { |
|
|
|
|
this.timer = setInterval(() => { |
|
|
|
|
newdata = newdata += data[index]; |
|
|
|
|
if (this.msgList?.filter((item) => item.id == id).length == 0) { |
|
|
|
|
this.msgList = [ |
|
|
|
@ -253,7 +255,7 @@ |
|
|
|
|
this.scrollTop = this.scrollTop + 100; |
|
|
|
|
}); |
|
|
|
|
if (newdata == data) { |
|
|
|
|
clearInterval(timer); |
|
|
|
|
clearInterval(this.timer); |
|
|
|
|
} |
|
|
|
|
}, 50); |
|
|
|
|
} else { |
|
|
|
|