From 74cdd0f00c6e6640871f35d8dd951a858ddcefa2 Mon Sep 17 00:00:00 2001
From: yangyin <18723093654@163.com>
Date: 星期日, 07 七月 2024 11:44:41 +0800
Subject: [PATCH] fix:提交代码

---
 src/views/project/ch/home/component/waterRight/top.vue |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/views/project/ch/home/component/waterRight/top.vue b/src/views/project/ch/home/component/waterRight/top.vue
index d261cee..b771ebd 100644
--- a/src/views/project/ch/home/component/waterRight/top.vue
+++ b/src/views/project/ch/home/component/waterRight/top.vue
@@ -31,15 +31,25 @@
 import { GetLLMList, SetLLM } from '/@/api/ai/chat';
 import PlayBar from '/@/components/chat/components/playBar/PlayBar.vue';
 import router from '/@/router';
-import { activeChatRoom } from '/@/stores/chatRoom';
+import { activeChatRoom, activeLLMId, activeSectionAId } from '/@/stores/chatRoom';
+import emitter from '/@/utils/mitt';
+import { ElMessage } from 'element-plus';
 const emits = defineEmits(['sendClick']);
 const inputValue = ref('');
 
 const sendClick = () => {
 	if (!inputValue.value) return;
+	if (!activeSectionAId.value) {
+		ElMessage.warning('璇烽�夋嫨搴旂敤鍦烘櫙');
+		return;
+	}
 	activeChatRoom.value.title = inputValue.value;
+	activeChatRoom.value.isInitial = false;
 	router.push({
 		name: 'AskAnswer',
+		query: {
+			id: activeChatRoom.value.id,
+		},
 	});
 };
 let state = reactive({
@@ -68,7 +78,6 @@
 	activeRole: 0,
 });
 
-const activeLLMId = ref();
 const llmList = ref([]);
 const iconList = ['/static/images/wave/Glm.jpg', '/static/images/wave/Glm.jpg', '/static/images/wave/Glm.jpg'];
 const getLLMList = async () => {
@@ -92,10 +101,9 @@
 };
 
 const setLLm = async (llmId: string) => {
-	
-	const res = await SetLLM({
-		llm: llmId,
-	});
+	// const res = await SetLLM({
+	// 	llm: llmId,
+	// });
 	activeLLMId.value = llmId;
 
 	return true;
@@ -106,6 +114,9 @@
 
 onMounted(() => {
 	getLLMList();
+	emitter.on('updateChatInput', (value) => {
+		inputValue.value = value;
+	});
 });
 </script>
 <style scoped lang="scss">

--
Gitblit v1.9.3