From 68994735dddb8d2be65149aa605ec0ac12e8775a Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期二, 10 九月 2024 15:26:59 +0800
Subject: [PATCH] 未滑动到底部 bug;多次点开对话测试 bug;数据对接SQL为选项之一

---
 src/views/project/yw/dataManage/knowledge/Knowledge.vue |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/views/project/yw/dataManage/knowledge/Knowledge.vue b/src/views/project/yw/dataManage/knowledge/Knowledge.vue
index ddf6d4a..a2dd4a2 100644
--- a/src/views/project/yw/dataManage/knowledge/Knowledge.vue
+++ b/src/views/project/yw/dataManage/knowledge/Knowledge.vue
@@ -88,6 +88,7 @@
 import { useCompRef } from '/@/utils/types';
 import { SupervisorPublished, supervisorPublishedMap } from '/@/views/project/yw/lowCode/sqlAmis/types';
 import knowledgeLeft from '/static/images/knowledge/data_type_1.png';
+import axios, { CancelTokenSource } from 'axios';
 const router = useRouter();
 //#region ====================== 鑾峰彇鐭ヨ瘑搴搒heet鍒楄〃 ======================
 const knowledgeBaseList = ref([]);
@@ -168,7 +169,9 @@
 	chatTestIsShow.value = true;
 	nextTick(() => {
 		chatRef.value.clear();
-		chatRef.value.autoSend(row.prompt);
+		setTimeout(() => {
+			chatRef.value.autoSend(row.prompt);
+		}, 30);
 	});
 };
 
@@ -190,7 +193,9 @@
 	},
 });
 
-const questionAi = async (text) => {
+const questionAi = async (text, sourceObj: { source: CancelTokenSource }) => {
+	const currentSource = axios.CancelToken.source();
+	sourceObj.source = currentSource;
 	const res = await check_docvector_validate(
 		{
 			knowlg_id: chatTestMapRow.value.id,
@@ -198,6 +203,7 @@
 		},
 		{
 			loading: false,
+			cancelToken: currentSource.token,
 		}
 	);
 	return res;

--
Gitblit v1.9.3