From 945e9b8d58ef8fa6fec1cf2aeaf3892e881c3108 Mon Sep 17 00:00:00 2001 From: yangyin <1850366751@qq.com> Date: 星期五, 08 十一月 2024 16:34:20 +0800 Subject: [PATCH] Merge branch 'test' of http://47.103.154.90:83/r/WI/Web.V1.0 into test --- src/components/chat/Chat.vue | 2 -- src/components/chat/hooks/useScrollLoad.ts | 9 ++++++--- src/components/chat/chatComponents/summaryCom/components/recordSet/components/TimeRange.vue | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/components/chat/Chat.vue b/src/components/chat/Chat.vue index 5444dc2..24b96e4 100644 --- a/src/components/chat/Chat.vue +++ b/src/components/chat/Chat.vue @@ -198,7 +198,6 @@ <el-tooltip effect="dark" content="鍒嗕韩" placement="top"> <div class="flex items-center justify-center size-[15px]"> <i - :class="{ 'text-[#0284ff]': item.state === AnswerState.Unlike }" class="p-2 ywifont ywicon-fenxiang cursor-pointer hover:text-[#0284ff] !text-[15px] hover:!text-[18px]" @click="shareClick(item)" /> @@ -620,7 +619,6 @@ }; const { loadRangeData, onChatListScroll, moreIsLoading, nextUserMsgEndIndex } = useScrollLoad({ - isSharePage: isSharePage, container: chatListDom, historyGroupId: currentRouteId, messageList, diff --git a/src/components/chat/chatComponents/summaryCom/components/recordSet/components/TimeRange.vue b/src/components/chat/chatComponents/summaryCom/components/recordSet/components/TimeRange.vue index a9ea3cd..ef234c6 100644 --- a/src/components/chat/chatComponents/summaryCom/components/recordSet/components/TimeRange.vue +++ b/src/components/chat/chatComponents/summaryCom/components/recordSet/components/TimeRange.vue @@ -37,10 +37,10 @@ :class="{ 'bg-[#1677ff]': parseInt(item) === quickPickValue, 'text-white': parseInt(item) === quickPickValue, - 'bg-[#f5f7fa]': isSharePage, - 'text-[#a9acb3]': isSharePage, - 'border-[#dcdfe6]': isSharePage, - '!cursor-not-allowed': isSharePage, + 'bg-[#f5f7fa]': disabled, + 'text-[#a9acb3]': disabled, + 'border-[#dcdfe6]': disabled, + '!cursor-not-allowed': disabled, }" v-for="item in Object.keys(timeRangeMapTitle)" :key="item" diff --git a/src/components/chat/hooks/useScrollLoad.ts b/src/components/chat/hooks/useScrollLoad.ts index 7a6108f..0309fed 100644 --- a/src/components/chat/hooks/useScrollLoad.ts +++ b/src/components/chat/hooks/useScrollLoad.ts @@ -4,12 +4,12 @@ import { AnswerType, ChatContent, ChatMessage, RoleEnum, StepEnum, StepItem } from '../model/types'; import { GetHistoryAnswer, QueryHistoryDetail, getShareChatJsonByPost } from '/@/api/ai/chat'; import router from '/@/router'; +import { isSharePage } from '/@/stores/chatRoom'; type UseScrollLoadOption = { container: ShallowRef<HTMLDivElement>; historyGroupId: string | Ref<string>; messageList: Ref<ChatMessage[]>; parseAnswerContent: (res: any) => ChatContent; - isSharePage: Ref<boolean>; }; export const convertProcessItem = (processItem: any) => { @@ -35,7 +35,7 @@ * @returns */ export const useScrollLoad = (option: UseScrollLoadOption) => { - const { container, historyGroupId, messageList, parseAnswerContent, isSharePage } = option; + const { container, historyGroupId, messageList, parseAnswerContent } = option; const moreIsLoading = ref(false); /** @description 涓嬫闇�瑕佸姞杞界殑鐢ㄦ埛缁撴潫绱㈠紩锛堝�掔潃鏁帮級 */ @@ -118,7 +118,10 @@ }); const msgValue = res?.values; - if (!msgValue) return undefined; + if (!msgValue) { + messageList.value = []; + return; + } const userMsg: ChatMessage = { historyId: msgValue.history_id, role: RoleEnum.user, -- Gitblit v1.9.3