| | |
| | | v-loading="moreIsLoading" |
| | | ></span> |
| | | <div class="h-full relative" v-loading="chatListLoading" :style="{ width: chatWidth }"> |
| | | <template v-if="computedMessageList?.length > 0"> |
| | | <div |
| | | class="flex px-4 py-6 rounded-lg relative" |
| | | :class="{ 'flex-row-reverse': item.role === RoleEnum.user, 'px-10': isShareCheck }" |
| | |
| | | <span> |
| | | {{ toggleStepLabel(item) }} |
| | | </span> |
| | | <span class="ywifont" :class="{ 'ywicon-unfold': !item.stepIsShow, 'ywicon-fold': item.stepIsShow }"></span> |
| | | <span |
| | | class="ywifont" |
| | | :class="{ 'ywicon-unfold': !item.stepIsShow, 'ywicon-fold': item.stepIsShow }" |
| | | ></span> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </template> |
| | | <template #title> |
| | | <span class="text-sm" |
| | | >{{ subItem.title }}<span v-if="subItem.ms" class="text-green-600">{{ `(${subItem.ms})` }}</span></span |
| | | >{{ subItem.title |
| | | }}<span v-if="subItem.ms" class="text-green-600">{{ `(${subItem.ms})` }}</span></span |
| | | > |
| | | </template> |
| | | </el-step> |
| | |
| | | </div> |
| | | |
| | | <div |
| | | v-if="item.role === RoleEnum.user && item.content?.values && chatDisplayMode === 'default' && !isShareCheck" |
| | | v-if="item.role === RoleEnum.user && item.content?.values && !isSharePage && !isShareCheck" |
| | | class="absolute flex items-center bottom-0 group invisible" |
| | | > |
| | | <div class="bg-[#fff] flex items-center mr-4 space-x-2 flex-nowrap rounded-[6px] py-2 px-2 group-hover:visible"> |
| | | <div |
| | | class="bg-[#fff] flex items-center mr-4 space-x-2 flex-nowrap rounded-[6px] py-2 px-2 group-hover:visible" |
| | | > |
| | | <el-tooltip effect="dark" content="复制" placement="top"> |
| | | <div class="flex items-center justify-center size-[20px]"> |
| | | <i |
| | |
| | | </template> |
| | | </template> |
| | | </div> |
| | | <!-- 操作 --> |
| | | |
| | | <div |
| | | v-if="item.role === RoleEnum.assistant && item.content?.values && chatDisplayMode === 'default' && !isShareCheck" |
| | | v-if="item.role === RoleEnum.assistant && item.content?.values && !isSharePage && !isShareCheck" |
| | | class="absolute flex items-center right-0 mr-4 mt-2 space-x-2" |
| | | > |
| | | <div |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <el-empty v-else-if="isSharePage && !chatListLoading" :image-size="200" > |
| | | <template #description> |
| | | |
| | | <span class="text-[15px]"> |
| | | 分享的对话不存在或已失效 |
| | | </span> |
| | | </template> |
| | | </el-empty> |
| | | <div v-if="showAskMore && !isShareCheck" class="ml-4 mt-5 text-sm pb-10"> |
| | | <div class="text-gray-600 mb-5">你可以继续问我:</div> |
| | | <div class="space-y-2 inline-flex flex-col"> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <div |
| | | class="sticky bottom-0 w-full p-6 bg-[rgb(247,248,250)] flex justify-center" |
| | | v-if="chatDisplayMode === 'default' && !isShareCheck" |
| | | > |
| | | <div class="sticky bottom-0 w-full p-6 bg-[rgb(247,248,250)] flex justify-center" v-if="!isSharePage && !isShareCheck"> |
| | | <PlayBar |
| | | v-model:voicePageIsShow="voicePageIsShow" |
| | | :isTalking="isTalking" |
| | |
| | | import { extCallQuery, questionStreamByPost, shareChatHistoryByPost } from '/@/api/ai/chat'; |
| | | import PlayBar from '/@/components/chat/components/playBar/PlayBar.vue'; |
| | | import CustomDrawer from '/@/components/drawer/CustomDrawer.vue'; |
| | | import { SERVE_URL } from '/@/constants'; |
| | | import { Logger } from '/@/model/logger/Logger'; |
| | | import router from '/@/router'; |
| | | import { |
| | |
| | | activeRoomId, |
| | | activeSampleId, |
| | | activeSectionAId, |
| | | chatDisplayMode, |
| | | getRoomConfig, |
| | | isSharePage, |
| | | roomConfig, |
| | | } from '/@/stores/chatRoom'; |
| | | import { ErrorCode } from '/@/utils/request'; |
| | |
| | | messageList.value.at(-1).createTime = currentTime; |
| | | } |
| | | }; |
| | | |
| | | const { loadRangeData, onChatListScroll, moreIsLoading, nextUserMsgEndIndex } = useScrollLoad({ |
| | | isSharePage: isSharePage, |
| | | container: chatListDom, |
| | | historyGroupId: currentRouteId, |
| | | messageList, |
| | | parseAnswerContent: parseContent, |
| | | }); |
| | | |
| | | const chatListLoading = ref(false); |
| | | const chatListLoading = ref(true); |
| | | |
| | | const { scrollToBottom } = useScrollToBottom({ |
| | | const { scrollToBottom, scrollToTop } = useScrollToBottom({ |
| | | chatListDom: chatListDom, |
| | | }); |
| | | |
| | |
| | | messageList.value = []; |
| | | // 加载初始数据 |
| | | chatListLoading.value = true; |
| | | |
| | | await loadRangeData().finally(() => { |
| | | |
| | | chatListLoading.value = false; |
| | | }); |
| | | |
| | | if (messageList.value.length === 0) { |
| | | messageContent.value = { |
| | | type: AnswerType.Text, |
| | | values: activeChatRoom.value.title, |
| | | values: activeChatRoom.value?.title, |
| | | }; |
| | | |
| | | sendChatMessage(); |
| | | } else { |
| | | if (isSharePage.value) { |
| | | setTimeout(() => { |
| | | // 滚动到顶部 |
| | | scrollToTop(); |
| | | }, 300); |
| | | } else { |
| | | setTimeout(() => { |
| | | // 初始状态滚一下 |
| | |
| | | chatListDom.value.addEventListener('scroll', onChatListScroll); |
| | | }, 300); |
| | | }, 300); |
| | | } |
| | | } |
| | | }); |
| | | //#region ====================== 关联查询 ====================== |
| | |
| | | if (!res.values) return; |
| | | const shareId = Object.values(res.values)[0]; |
| | | if (!shareId) return; |
| | | |
| | | return `${shareId}`; |
| | | const relativeHref = router.resolve(`share?id=${shareId}`).href; |
| | | const shareLink = `${SERVE_URL}${relativeHref}`; |
| | | return shareLink; |
| | | }; |
| | | |
| | | //#endregion |