| | |
| | | } from '/@/stores/chatRoom'; |
| | | import emitter from '/@/utils/mitt'; |
| | | import { useCompRef } from '/@/utils/types'; |
| | | import { toMyFixed } from '/@/utils/util'; |
| | | import { toFormData, toMyFixed } from '/@/utils/util'; |
| | | import { useLoadData } from './hooks/useLoadData'; |
| | | import { useSyncMsg } from './hooks/useSyncMsg'; |
| | | import { getCurrentPosition } from '/@/utils/brower'; |
| | | const containerRef = useCompRef(ChatContainer); |
| | | const chatListDom = computed(() => containerRef.value?.chatListDom); |
| | | const attachFileList = computed(() => playBarRef.value?.attachFileList ?? []); |
| | | const scrollToBottom = () => { |
| | | containerRef.value?.scrollToBottom(); |
| | | }; |
| | | const { loadReplyData, parseContent, parseExtraContent, convertProcessItem, convertProcessToStep, formatShowTimeYear, getStepGroupList } = useLoadData(); |
| | | const { |
| | | loadReplyData, |
| | | parseContent, |
| | | parseExtraContent, |
| | | convertProcessItem, |
| | | convertProcessToStep, |
| | | formatShowTimeYear, |
| | | getStepGroupList, |
| | | } = useLoadData(); |
| | | const voicePageIsShow = ref(false); |
| | | let isTalking = ref(false); |
| | | const chatWidth = computed(() => containerRef.value?.chatWidth); |
| | |
| | | raw_mode: roomConfig.value?.[currentRouteId]?.isAnswerByLLM ?? false, |
| | | ...judgeParams, |
| | | } as any; |
| | | |
| | | const formDataParams = toFormData(params); |
| | | for (const item of attachFileList.value) { |
| | | formDataParams.append('files', item.file); |
| | | } |
| | | // if (!position) { |
| | | // const loadingInstance = ElLoadingService({ |
| | | // text: '获取位置中...', |
| | |
| | | const ms = toMyFixed(currentTimeStamp - lastTimestamp, 2) + ' ms'; |
| | | |
| | | stepList.at(-1).ms = ms; |
| | | } |
| | | } |
| | | |
| | | if (!streamOutputIsStart) { |
| | | lastTimestamp = currentTimeStamp; |