|
|
@@ -377,6 +377,7 @@ export default defineComponent({
|
|
|
|
|
|
const addData = (data) => {
|
|
|
dialogList.splice(dialogIndex, 1, data);
|
|
|
+
|
|
|
randomKey.value = Math.random();
|
|
|
scrollToEnd();
|
|
|
};
|
|
|
@@ -479,8 +480,16 @@ export default defineComponent({
|
|
|
const answerCode = ref(undefined);
|
|
|
const answerSql = ref(undefined);
|
|
|
const addQuestion = (question, file = null) => {
|
|
|
- let result = { question, capacity: null, answer: "", other: null, file: null, };
|
|
|
+ let result = {
|
|
|
+ question,
|
|
|
+ capacity: null,
|
|
|
+ answer: "",
|
|
|
+ other: null,
|
|
|
+ file: null,
|
|
|
+ };
|
|
|
+
|
|
|
addData(result);
|
|
|
+
|
|
|
return result;
|
|
|
};
|
|
|
const addAnswer = (data) => {
|
|
|
@@ -701,14 +710,6 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
if (msg_type === "close") {
|
|
|
- if (!answerData.value) {
|
|
|
- answerLoaded();
|
|
|
- answerData.value = getHTML(message);
|
|
|
- addAnswer(loadingData.value);
|
|
|
- }
|
|
|
- stopWriting();
|
|
|
- answerData.value = "";
|
|
|
- isLoaded.value = false;
|
|
|
|
|
|
/**
|
|
|
* 在小数绘图对话结束时
|
|
|
@@ -723,24 +724,33 @@ export default defineComponent({
|
|
|
|
|
|
// 小数绘图
|
|
|
if(res_data.message_files){
|
|
|
- console.log(11);
|
|
|
const arr = [];
|
|
|
|
|
|
if(Array.isArray(res_data.message_files)){
|
|
|
- console.log(12);
|
|
|
-
|
|
|
res_data.message_files.forEach((item, index) => {
|
|
|
- console.log(13, index);
|
|
|
- arr.push(item.url);
|
|
|
+ arr.push(item);
|
|
|
});
|
|
|
|
|
|
- console.log(arr, 'arr');
|
|
|
-
|
|
|
fullImageUrls.url = arr;
|
|
|
}else{
|
|
|
fullImageUrls.url = arr;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ answerLoaded();
|
|
|
+
|
|
|
+ stopWriting();
|
|
|
+ answerData.value = "";
|
|
|
+ isLoaded.value = false;
|
|
|
+ }else{
|
|
|
+ if (!answerData.value) {
|
|
|
+ answerLoaded();
|
|
|
+ answerData.value = getHTML(message);
|
|
|
+ addAnswer(loadingData.value);
|
|
|
+ }
|
|
|
+ stopWriting();
|
|
|
+ answerData.value = "";
|
|
|
+ isLoaded.value = false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -778,7 +788,9 @@ export default defineComponent({
|
|
|
|
|
|
const question = chat_type === "report" ? value.inputs.report_name : value;
|
|
|
const data = addQuestion(question);
|
|
|
+
|
|
|
loadingData.value = addLoading(data);
|
|
|
+
|
|
|
|
|
|
let sendData = {
|
|
|
message: value
|
|
|
@@ -792,12 +804,6 @@ export default defineComponent({
|
|
|
sendData = value;
|
|
|
}
|
|
|
|
|
|
- // chat_type === "report" || chat_type === "excel"
|
|
|
- // ? value
|
|
|
- // : {
|
|
|
- // message: value
|
|
|
- // };
|
|
|
-
|
|
|
if (chat_type === 'doc') {
|
|
|
sendData.doc_ids = [helper.read('docId')];
|
|
|
}
|