Browse Source

Merge branch 'milestone-20250710-上线前优化' of http://39.101.133.168:8807/hongxilin/AIxiaocaishen into milestone-20250710-上线前优化

dev
宋杰 2 days ago
parent
commit
9ad6acd078
  1. 2
      src/store/chat.js
  2. 8
      src/views/AIchat.vue
  3. 49
      src/views/components/HistoryRecord.vue
  4. 5
      src/views/homePage.vue

2
src/store/chat.js

@ -11,6 +11,8 @@ export const useChatStore = defineStore("chat", {
searchRecord: false, searchRecord: false,
currentUserIndex: null, currentUserIndex: null,
announcementMsg: null, announcementMsg: null,
aiChatCall:false,
aiEmotionCall:false
}), }),
actions: { actions: {
async getUserCount() { async getUserCount() {

8
src/views/AIchat.vue

@ -1064,6 +1064,10 @@ watch(
previousMessagesLength.value = newVal.length; previousMessagesLength.value = newVal.length;
if (newVal.length > 0) { if (newVal.length > 0) {
// //
console.log("chatStore.currentUserIndex", chatStore.currentUserIndex);
if (chatStore.currentUserIndex!=null) {
chatStore.messages[chatStore.currentUserIndex].audioStatus = false;
}
chatStore.currentUserIndex = null; chatStore.currentUserIndex = null;
audioStore.stop(); // audioStore.stop(); //
@ -1178,7 +1182,7 @@ watch(
class: "ing", class: "ing",
type: "ing", type: "ing",
flag: flag, flag: flag,
content: aiContent,
content: AIcontent,
}); });
chatStore.isLoading = false; chatStore.isLoading = false;
@ -5088,7 +5092,7 @@ p {
.ai-message-content { .ai-message-content {
display: flex; display: flex;
align-items: center; align-items: center;
white-space: nowrap;
/* white-space: nowrap; */
width: fit-content; width: fit-content;
overflow: visible; overflow: visible;
} }

49
src/views/components/HistoryRecord.vue

@ -452,24 +452,53 @@ const closeDeleteDialog = () => {
const historyRecords = ref([]); const historyRecords = ref([]);
const categoryHistory = ref([]); const categoryHistory = ref([]);
let firstFlag = false;
let chatFirstFlag = true;
let emotionTirstFlag = true;
const getHistoryList = async (params) => { const getHistoryList = async (params) => {
try { try {
const result = await getHistoryListAPI(params); const result = await getHistoryListAPI(params);
historyRecords.value = result.data; historyRecords.value = result.data;
let remainingRecords = result.data; // let remainingRecords = result.data; //
console.log("result", result.data, "firstFlag", firstFlag);
if (result.data.length != 0 && !firstFlag) {
console.log(
"params",
params,
"result",
result.data,
"chatFirstFlag",
chatFirstFlag,
"emotionTirstFlag",
emotionTirstFlag
);
if (chatFirstFlag && params.model == 1 && result.data.length != 0) {
const userAgent = navigator.userAgent; const userAgent = navigator.userAgent;
if ( if (
!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
userAgent userAgent
) )
) { ) {
isCollapsed.value = false;
chatStore.aiChatCall = true;
} }
firstFlag = true;
chatFirstFlag = false;
} }
if (emotionTirstFlag && params.model == 2 && result.data.length != 0) {
const userAgent = navigator.userAgent;
if (
!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
userAgent
)
) {
chatStore.aiEmotionCall = true;
}
emotionTirstFlag = false;
}
if (props.currentType == "AIchat") {
isCollapsed.value = !chatStore.aiChatCall;
} else {
isCollapsed.value = !chatStore.aiEmotionCall;
}
// 1. // 1.
let topList = remainingRecords.filter((record) => record.isTop === 1); let topList = remainingRecords.filter((record) => record.isTop === 1);
remainingRecords = remainingRecords.filter((record) => record.isTop !== 1); remainingRecords = remainingRecords.filter((record) => record.isTop !== 1);
@ -606,10 +635,20 @@ const openHistory = () => {
// token: localStorage.getItem("localToken"), // token: localStorage.getItem("localToken"),
// }); // });
isCollapsed.value = false; isCollapsed.value = false;
if (props.currentType == "AIchat") {
chatStore.aiChatCall = true;
} else if (props.currentType == "AiEmotion") {
chatStore.aiEmotionCall = true;
}
}; };
const closeHistory = () => { const closeHistory = () => {
isCollapsed.value = true; isCollapsed.value = true;
if (props.currentType == "AIchat") {
chatStore.aiChatCall = false;
} else if (props.currentType == "AiEmotion") {
chatStore.aiEmotionCall = false;
}
}; };
const openDetail = (record) => { const openDetail = (record) => {

5
src/views/homePage.vue

@ -634,6 +634,11 @@ const expandHistory = () => {
) { ) {
console.log("存在"); console.log("存在");
historyRecordRef.value.isCollapsed = !historyRecordRef.value.isCollapsed; historyRecordRef.value.isCollapsed = !historyRecordRef.value.isCollapsed;
if (activeTab.value == "AIchat") {
chatStore.aiChatCall = true;
} else if (activeTab.value == "AiEmotion") {
chatStore.aiEmotionCall = true;
}
} }
}; };

Loading…
Cancel
Save