| | |
| | | |
| | | <script setup lang="ts"> |
| | | import { ElMessage } from 'element-plus'; |
| | | import _ from 'lodash'; |
| | | import moment from 'moment'; |
| | | import { computed, onActivated, onMounted, ref } from 'vue'; |
| | | import useClipboard from 'vue-clipboard3'; |
| | |
| | | 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, SHARE_URL } from '/@/constants'; |
| | | import { SHARE_URL } from '/@/constants'; |
| | | import { Logger } from '/@/model/logger/Logger'; |
| | | import router from '/@/router'; |
| | | import { |
| | |
| | | isSharePage, |
| | | roomConfig, |
| | | } from '/@/stores/chatRoom'; |
| | | import emitter from '/@/utils/mitt'; |
| | | import { ErrorCode } from '/@/utils/request'; |
| | | import { toMyFixed } from '/@/utils/util'; |
| | | import emitter from '/@/utils/mitt'; |
| | | import { findLast, orderBy } from 'lodash-es'; |
| | | const chatWidth = '75%'; |
| | | const voicePageIsShow = ref(false); |
| | | let isTalking = ref(false); |
| | |
| | | }; |
| | | break; |
| | | } |
| | | content.askMoreList = _.orderBy(res.context_history, [(item) => Number(item.radio)], ['desc']); |
| | | content.askMoreList = orderBy(res.context_history, [(item) => Number(item.radio)], ['desc']); |
| | | content.errCode = res?.err_code; |
| | | content.errMsg = res?.json_msg; |
| | | content.origin = res; |
| | |
| | | currentSectionAId = activeSectionAId.value; |
| | | activeSectionAId.value = ''; |
| | | } else { |
| | | const lastSectionAItem = _.findLast( |
| | | const lastSectionAItem = findLast( |
| | | computedMessageList.value as any, |
| | | (item) => item.role === RoleEnum.assistant && !!item.sectionAId |
| | | ); |
| | |
| | | }, 300); |
| | | |
| | | if (messageList.value.length === 0) { |
| | | |
| | | |
| | | messageContent.value = { |
| | | type: AnswerType.Text, |
| | | values: activeChatRoom.value?.title, |