| | |
| | | import axios from 'axios'; |
| | | import { orderBy } from 'lodash-es'; |
| | | import moment from 'moment'; |
| | | import { computed, onActivated, onMounted, ref } from 'vue'; |
| | | import { computed, nextTick, onActivated, onMounted, ref } from 'vue'; |
| | | import { loadAmisSource } from '../amis/load'; |
| | | import { useScrollLoad } from './hooks/useScrollLoad'; |
| | | import type { ChatContent } from './model/types'; |
| | |
| | | import PlayBar from '/@/components/chat/components/playBar/PlayBar.vue'; |
| | | import CustomDrawer from '/@/components/drawer/CustomDrawer.vue'; |
| | | import { Logger } from '/@/model/logger/Logger'; |
| | | |
| | | import { triggerRef } from 'vue'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import ChatContainer from './components/ChatContainer.vue'; |
| | | import ShareLinkDlg from './components/shareLink/index.vue'; |
| | |
| | | if (chunkRes.mode === 'result') { |
| | | lastIsResult = true; |
| | | const res = chunkRes.value; |
| | | |
| | | if (checkReportEmpty()) { |
| | | const resReport = getResReport(); |
| | | resReport.reports.push(res); |
| | | questionRes = resReport; |
| | | // resReport.reports = resReport.reports.concat([]); |
| | | resolve(resReport); |
| | | } else { |
| | | const lastMsg = computedMessageList.value.at(-1); |
| | | |
| | | // lastMsg.content.values = lastMsg.content.values.concat([]); |
| | | // 已经解析过一次 reports |
| | | lastMsg.content.values.push({ |
| | | content: parseContent(res, true, { |
| | |
| | | |
| | | // 暂时不考虑多个 report情况 |
| | | |
| | | // if (lastIsResult && chunkRes.mode !== 'finish') { |
| | | // // 开始增加新的 stepGroup |
| | | // computedMessageList.value.at(-1).stepGroup.push({ |
| | | // value: [], |
| | | // isShow: true, |
| | | // }); |
| | | // lastIsResult = false; |
| | | // } |
| | | if (lastIsResult && chunkRes.mode !== 'finish') { |
| | | const lastTow = computedMessageList.value.at(-1); |
| | | lastTow.stepGroup.at(-1).value.at(-1).finishLoading = true; |
| | | // lastTow.content.values = lastTow.content.values.concat([]); |
| | | |
| | | // 开始增加新的 stepGroup |
| | | computedMessageList.value.at(-1).stepGroup.push({ |
| | | value: [], |
| | | isShow: true, |
| | | }); |
| | | lastIsResult = false; |
| | | } |
| | | const lastGroup = computedMessageList.value.at(-1).stepGroup.at(-1); |
| | | const stepList = lastGroup?.value ?? []; |
| | | const currentTimeStamp = new Date().getTime(); |