wujingjing
2025-01-15 0647fd26414fc8a3ab077d355f50da6e3e36ad63
src/components/chat/Chat.vue
@@ -49,7 +49,7 @@
import moment from 'moment';
import { computed, onActivated, onMounted, ref } from 'vue';
import { loadAmisSource } from '../amis/load';
import {   useScrollLoad } from './hooks/useScrollLoad';
import { useScrollLoad } from './hooks/useScrollLoad';
import type { ChatContent } from './model/types';
import { AnswerState, AnswerType, RoleEnum, type ChatMessage } from './model/types';
import { getShareChatJsonByPost, questionStreamByPost } from '/@/api/ai/chat';
@@ -402,9 +402,11 @@
      updateLoadIndex();
      userItem.historyId = questionRes?.history_id;
      const current = moment().format('YYYY-MM-DD HH:mm:ss');
      userItem.createTime = current;
      userItem.content.values = questionRes?.question ?? userItem.content.values;
      assistantItem.historyId = questionRes?.history_id;
      const currentTime = formatShowTimeYear(moment().format('YYYY-MM-DD HH:mm:ss'));
      const currentTime = formatShowTimeYear(current);
      assistantItem.createTime = currentTime;
      assistantItem.content = resMsgContent;
      setTimeout(() => {
@@ -418,7 +420,6 @@
   sendChatMessage(messageContent.value);
};
const { loadRangeData, onChatListScroll, moreIsLoading, updateLoadIndex } = useScrollLoad({
   container: chatListDom,
   historyGroupId: currentRouteId,
@@ -426,8 +427,9 @@
   loadReplyData,
});
useSyncMsg({
   msgList: messageList,
   msgList: computedMessageList,
   updateLoadIndex,
   historyGroupId: currentRouteId,
});
const chatListLoading = ref(true);