From fc42a3c9fb49ecf6c72d22738757c5cda8c06130 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期四, 10 十月 2024 16:10:18 +0800 Subject: [PATCH] 主动 scrollToBottom --- src/stores/chatRoom.ts | 23 +++++++++++++++++++++-- 1 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/stores/chatRoom.ts b/src/stores/chatRoom.ts index 5d86755..2c94b02 100644 --- a/src/stores/chatRoom.ts +++ b/src/stores/chatRoom.ts @@ -1,10 +1,11 @@ -import { computed, ref, watch } from 'vue'; +import { computed, ref } from 'vue'; import type { ChatRoomItem } from '../layout/component/sidebar/components/types'; -import { Local } from '../utils/storage'; export type RoomConfig = { /** 鏄惁鐩存帴璋冪敤澶фā鍨嬶紙閫氫箟鍗冮棶锛夊洖绛� */ isAnswerByLLM: boolean; + /** @description 浠庨椤佃繘鍘昏幏鍙栫殑绗竴涓洖澶嶏紝鍥炶皟鍑芥暟 */ + firstResCb: any; }; export type RoomConfigKey = keyof RoomConfig; @@ -23,6 +24,17 @@ } }; +export const getRoomConfig = <T extends RoomConfigKey>(roomId: string, key: T) => { + if (!roomConfig.value) { + return null; + } + if (!roomConfig.value[roomId]) { + return null; + } else { + return roomConfig.value[roomId][key]; + } +}; + export const chatRoomList = ref<ChatRoomItem[]>([]); export const activeRoomId = ref(null); @@ -30,3 +42,10 @@ export const activeSampleId = ref(null); export const activeSectionAId = ref(null); export const activeLLMId = ref(null); + + + +/** + * 鍏ㄥ眬浣跨敤鐨� ref + */ +export const sectionAList = ref([]); \ No newline at end of file -- Gitblit v1.9.3