From 75e6912a8d93725e1038d1ecd9c1438ec223f2ca Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期四, 14 十一月 2024 14:38:10 +0800 Subject: [PATCH] refactor(layout): 重构布局组件并优化登录功能 --- src/components/chat/Chat.vue | 28 +++++++++++++++++++--------- 1 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/components/chat/Chat.vue b/src/components/chat/Chat.vue index b38c456..a3b3c99 100644 --- a/src/components/chat/Chat.vue +++ b/src/components/chat/Chat.vue @@ -118,15 +118,15 @@ <p class="text-red-500"> {{ item.content.errMsg }} </p> - <div class="mt-5 flex" v-if="showFixQuestion(item)"> - <div class="text-gray-600 flex-0 mt-4"> + <div class="mt-3 flex" v-if="showFixQuestion(item)"> + <div class="text-gray-600 flex-0 mb-auto py-3"> {{ '鐚滀綘鎯抽棶锛�' }} </div> - <div class="ml-1 space-x-2 inline-flex flex-wrap"> + <div class="flex-auto space-x-2 space-y-1 inline-flex flex-wrap items-center"> <div v-for="fixItem in item.content.origin?.sample_question" :key="fixItem" - class="bg-gray-200 p-3 mt-1 hover:bg-[#c5e0ff] hover:text-[#1c86ff] cursor-pointer rounded-lg" + class="bg-gray-200 p-3 hover:bg-[#c5e0ff] hover:text-[#1c86ff] cursor-pointer rounded-lg first-of-type:ml-2 first-of-type:mt-1" @click="fixQuestionClick(fixItem, item.content.origin)" > {{ fixItem }} @@ -278,7 +278,7 @@ import { ElMessage } from 'element-plus'; import _ from 'lodash'; import moment from 'moment'; -import { computed, onMounted, ref } from 'vue'; +import { computed, onActivated, onMounted, ref } from 'vue'; import useClipboard from 'vue-clipboard3'; import FeedbackPanel from './components/FeedbackPanel.vue'; import { useAssistantContentOpt } from './hooks/useAssistantContentOpt'; @@ -306,6 +306,7 @@ } from '/@/stores/chatRoom'; import { ErrorCode } from '/@/utils/request'; import { toMyFixed } from '/@/utils/util'; +import emitter from '/@/utils/mitt'; const chatWidth = '75%'; const voicePageIsShow = ref(false); let isTalking = ref(false); @@ -635,6 +636,10 @@ chatListDom: chatListDom, }); +onActivated(() => { + emitter.emit('updateHeaderTitle', activeChatRoom.value?.title ?? ''); +}); + onMounted(async () => { messageList.value = []; // 鍔犺浇鍒濆鏁版嵁 @@ -642,8 +647,13 @@ await loadRangeData().finally(() => { chatListLoading.value = false; }); + setTimeout(() => { + emitter.emit('updateHeaderTitle', activeChatRoom.value?.title ?? ''); + }, 300); if (messageList.value.length === 0) { + + messageContent.value = { type: AnswerType.Text, values: activeChatRoom.value?.title, @@ -652,10 +662,10 @@ sendChatMessage(); } else { if (isSharePage.value) { - setTimeout(() => { - // 婊氬姩鍒伴《閮� - scrollToTop(); - }, 300); + // setTimeout(() => { + // // 婊氬姩鍒伴《閮� + // scrollToTop(); + // }, 300); } else { setTimeout(() => { // 鍒濆鐘舵�佹粴涓�涓� -- Gitblit v1.9.3