| | |
| | | <template> |
| | | <div class="flex h-full"> |
| | | <div class="flex flex-col h-full flex-auto"> |
| | | <div class="flex flex-col h-full flex-auto relative"> |
| | | <div ref="chatListDom" class="relative h-full flex flex-col items-center overflow-y-auto" style="height: calc(100% - 50px)"> |
| | | <span |
| | | class="more-loading absolute text-blue-400 left-[50%] translate-x-[-50%] cursor-pointer w-10" |
| | |
| | | |
| | | <!-- #region ====================== 过程输出 ======================--> |
| | | <el-steps v-show="item.stepIsShow" class="mt-3" direction="vertical" :active="activeStep"> |
| | | |
| | | <el-step |
| | | v-for="(subItem, index) in item.stepList" |
| | | :title="subItem.title" |
| | |
| | | <span class="ywifont ywicon-loading1 animate-spin !text-[24px]"></span> |
| | | </template> |
| | | <template #title> |
| | | <span class="" |
| | | >{{ subItem.title |
| | | }}<span v-if="subItem.ms" class="text-green-600">{{ `(${subItem.ms})` }}</span></span |
| | | <span class=""> |
| | | {{ subItem.title }} |
| | | |
| | | <span v-if="subItem.ms" class="text-green-600">{{ `(${subItem.ms})` }}</span></span |
| | | > |
| | | </template> |
| | | |
| | | <template #description v-if="subItem?.subStep?.length > 0"> |
| | | <div class="my-1 flex flex-col gap-1 text-[14px]"> |
| | | |
| | | |
| | | <component |
| | | :key="`${item.historyId}-${index + 1}-${multiChatIndex + 1}`" |
| | | v-for="(multiChatItem, multiChatIndex) in subItem.subStep" |
| | | :order="`${index + 1}-${multiChatIndex + 1}`" |
| | | :item="multiChatItem" |
| | | :is="multiChatTypeMapCom[multiChatItem.type]" |
| | | :disabled="!(index + 1 === item.stepList.length && isTalking && msgIndex === computedMessageList.length - 1)" |
| | | /> |
| | | </div> |
| | | </template> |
| | | </el-step> |
| | | </el-steps> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="absolute right-28 bottom-40" v-if="!isBottom"> |
| | | <div |
| | | class="flex items-center justify-center size-[38px] cursor-pointer hover:text-[#0284ff] border rounded-full hover:bg-[#f6f7f9] shadow bg-white" |
| | | @click="scrollToBottom" |
| | | > |
| | | <i class="ywifont ywicon-xiangxiajiantou !text-[20px]" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div |
| | | class="sticky bottom-0 w-full px-6 pt-12 pb-6 bg-[rgb(247,248,250)] flex justify-center" |
| | |
| | | <div class="sticky bottom-0 w-full p-6 bg-[rgb(247,248,250)] flex justify-center" v-if="isShareCheck"></div> |
| | | </div> |
| | | <CustomDrawer v-model:isShow="drawerIsShow" @updateChatInput="updateChatInput" /> |
| | | <el-dialog title="分享链接" v-model="shareCodeIsShow" width="25%" modal-append-to-body lock-scroll :before-close="closeShareClick"> |
| | | <el-dialog title="分享链接" v-model="shareCodeIsShow" width="12%" modal-append-to-body lock-scroll :before-close="closeShareClick"> |
| | | <div class="w100 h100 flex justify-center items-center flex-col text-center"> |
| | | <div class="qrcode h100" ref="qrcodeRef"></div> |
| | | </div> |
| | |
| | | isSharePage, |
| | | roomConfig, |
| | | } from '/@/stores/chatRoom'; |
| | | |
| | | import { multiChatTypeMapCom } from '/@/components/chat/chatComponents/multiChat'; |
| | | import emitter from '/@/utils/mitt'; |
| | | import { ErrorCode } from '/@/utils/request'; |
| | | import { toMyFixed } from '/@/utils/util'; |
| | | const chatWidth = '75%'; |
| | | const voicePageIsShow = ref(false); |
| | | let isTalking = ref(false); |
| | | |
| | | let messageContent = ref<ChatContent>({ |
| | | type: AnswerType.Text, |
| | | values: '', |
| | |
| | | computedMessageList.value.at(-1).conclusion = chunkRes.value; |
| | | chunkRes.value = '分析结束'; |
| | | } |
| | | |
| | | if (chunkRes.mode === 'question') { |
| | | const stepList = computedMessageList.value.at(-1).stepList; |
| | | const lastStepItem = stepList.at(-1); |
| | | if (!lastStepItem.subStep) { |
| | | lastStepItem.subStep = []; |
| | | } |
| | | lastStepItem.subStep.push({ |
| | | type: chunkRes.value.type, |
| | | data: chunkRes.value, |
| | | }); |
| | | scrollToBottom(); |
| | | return; |
| | | } |
| | | const stepList = computedMessageList.value.at(-1).stepList; |
| | | const currentTimeStamp = new Date().getTime(); |
| | | const ms = toMyFixed(currentTimeStamp - lastTimestamp, 2) + ' ms'; |
| | |
| | | stepList.at(-1).ms = ms; |
| | | } |
| | | lastTimestamp = currentTimeStamp; |
| | | |
| | | const stepItem = convertProcessItem(chunkRes); |
| | | |
| | | stepList.push(stepItem); |
| | | scrollToBottom(); |
| | | |
| | | if (chunkRes.mode !== 'result') { |
| | | scrollToBottom(); |
| | | } |
| | | }, |
| | | { |
| | | cancelToken: currentSource.token, |
| | |
| | | }); |
| | | |
| | | questionRes = await resultP; |
| | | isTalking.value = false; |
| | | // isTalking.value = false; |
| | | |
| | | const content = parseContent(res, true); |
| | | return content; |
| | |
| | | |
| | | const chatListLoading = ref(true); |
| | | |
| | | const { scrollToBottom, scrollToTop } = useScrollToBottom({ |
| | | const { scrollToBottom, scrollToTop, isBottom } = useScrollToBottom({ |
| | | chatListDom: chatListDom, |
| | | }); |
| | | |
| | |
| | | font-size: 16px !important; |
| | | } |
| | | :deep(.el-step__description) { |
| | | height: 20px; |
| | | min-height: 20px; |
| | | } |
| | | |
| | | :deep(.el-step:last-of-type .el-step__description) { |
| | | display: none; |
| | | // display: none; |
| | | } |
| | | </style> |