From fa1f2d3453128c686d19504796426d9c27b8c0fb Mon Sep 17 00:00:00 2001
From: yangyin <1850366751@qq.com>
Date: 星期五, 25 十月 2024 17:13:36 +0800
Subject: [PATCH] 修改提示问题

---
 src/views/project/ch/home/component/waterRight/top.vue |   45 ++++++++++++++++++++++++++++++---------------
 1 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/src/views/project/ch/home/component/waterRight/top.vue b/src/views/project/ch/home/component/waterRight/top.vue
index 6c97248..8f3e1f9 100644
--- a/src/views/project/ch/home/component/waterRight/top.vue
+++ b/src/views/project/ch/home/component/waterRight/top.vue
@@ -1,7 +1,7 @@
 <template>
 	<div class="flex items-center">
-		<img src="/static/images/logo/logo-mini.svg" alt="logo" class="layout-logo-medium-img" />
-		<p class="set-waterTitle"><strong>WI 姘村姟鏅鸿兘涓撳</strong>鏅烘収姘村姟鍔╂墜</p>
+		<img src="/static/images/logo/logoWithNoName.png" alt="logo" class="layout-logo-medium-img" />
+		<p class="set-waterTitle"><strong>WI 姘村姟鏅鸿兘绠″</strong>鏅烘収姘村姟鍔╂墜</p>
 	</div>
 	<div class="flex items-center pc-roleList">
 		<!-- <div v-for="(item, index) in llmList" :key="item.logicId" class="flex items-center pl-6" @click="handleClick(item)">
@@ -17,26 +17,40 @@
 			</div>
 		</div> -->
 	</div>
-	<PlayBar v-model="inputValue" @send-click="sendClick" />
+	<PlayBar v-model="inputValue" @send-click="sendClick" :is-home="true" />
 </template>
 
 <script setup lang="ts">
 import { ElMessage } from 'element-plus';
-import { onMounted, ref } from 'vue';
-import { GetLLMList } from '/@/api/ai/chat';
+import { ref } from 'vue';
+import { GetLLMList, setHistoryGroupTitle } from '/@/api/ai/chat';
 import PlayBar from '/@/components/chat/components/playBar/PlayBar.vue';
 import router from '/@/router';
 import { activeChatRoom, activeLLMId, activeSectionAId } from '/@/stores/chatRoom';
-import emitter from '/@/utils/mitt';
-const emits = defineEmits(['sendClick']);
-const inputValue = ref('');
+import { handleNormalAuth } from '/@/utils/request';
 
-const sendClick = () => {
-	if (!inputValue.value) return;
+import logo from './logo.png'
+const emits = defineEmits(['sendClick']);
+const inputValue = ref('浣犳槸璋侊紵');
+
+const sendClick = async (cb) => {
+	if (!inputValue.value.trim()) return;
 	if (!activeSectionAId.value) {
 		ElMessage.warning('璇烽�夋嫨搴旂敤鍦烘櫙');
 		return;
 	}
+	if (!handleNormalAuth()) {
+		return;
+	}
+
+	const res = await setHistoryGroupTitle({
+		history_group_id: activeChatRoom.value.id,
+		title: inputValue.value,
+	});
+	if (!res.json_ok) {
+		return ElMessage.error('淇敼鑱婂ぉ瀹ゅ悕绉板け璐�');
+	}
+
 	activeChatRoom.value.title = inputValue.value;
 	activeChatRoom.value.isInitial = false;
 	router.push({
@@ -81,11 +95,12 @@
 	setLLm(item.logicId);
 };
 
-onMounted(() => {
-	// getLLMList();
-	emitter.on('updateChatInput', (value) => {
-		inputValue.value = value;
-	});
+const updateChatInput = (val) => {
+	inputValue.value = val;
+};
+
+defineExpose({
+	updateChatInput,
 });
 </script>
 <style scoped lang="scss">

--
Gitblit v1.9.3