diff --git a/src/views/DeepNineModel.vue b/src/views/DeepNineModel.vue index 79e44b8..082a367 100644 --- a/src/views/DeepNineModel.vue +++ b/src/views/DeepNineModel.vue @@ -149,7 +149,7 @@ const closeNoPermissionDialog = () => { height: auto; /* margin-top: 20px; */ position: absolute; - top: 3vh; + top: 10vh; } /* 顶部标题 */ @@ -302,7 +302,7 @@ const closeNoPermissionDialog = () => { .content-text { flex-direction: column; - /* 小屏幕时恢复纵向排列 */ + gap: 15px; } .content-text img { diff --git a/src/views/Selectmodel.vue b/src/views/Selectmodel.vue index a4308eb..d3a1e83 100644 --- a/src/views/Selectmodel.vue +++ b/src/views/Selectmodel.vue @@ -498,7 +498,7 @@ const goToDeepNineModel = () => { .footer-text1 { background-image: url("@/assets/img/Selectmodel/智能体.png"); width: 100vw; - height: 10vw; + height: 15vw; margin-top: 10px; background-size: 100% 100%; /* 保证全宽显示 */ diff --git a/src/views/components/HistoryRecord.vue b/src/views/components/HistoryRecord.vue index 89fd5c1..8d1c1a6 100644 --- a/src/views/components/HistoryRecord.vue +++ b/src/views/components/HistoryRecord.vue @@ -417,6 +417,7 @@ import moment from "moment"; import { ElMessage } from "element-plus"; import { useChatStore } from "../../store/chat"; const chatStore = useChatStore(); + import { useDataStore } from "@/store/dataList.js"; const dataStore = useDataStore(); import { useRouter } from "vue-router"; @@ -477,6 +478,7 @@ const historyRecords = ref([]); const categoryHistory = ref([]); let chatFirstFlag = true; let emotionTirstFlag = true; +let deepNineFirstFlag = true; // 添加缓存机制 let cachedCategoryHistory = null; let lastDataHash = null; @@ -524,6 +526,13 @@ const getHistoryList = async (params) => { emotionTirstFlag = false; } + if (deepNineFirstFlag && params.model == 3 && result.data.length != 0) { + if (!isMobile.value) { + chatStore.deepNineCall = true; + } + deepNineFirstFlag = false; + } + // 只在首次加载时根据chatStore状态设置折叠状态,避免搜索后自动弹出历史记录 if (isMobile.value) { @@ -537,7 +546,7 @@ const getHistoryList = async (params) => { } else if (props.currentType == "AiEmotion") { isCollapsed.value = !chatStore.aiEmotionCall; console.log("情绪大模型页面", isCollapsed.value); - }else if (props.currentType == "deepNine") { + } else if (props.currentType == "deepNine") { isCollapsed.value = !chatStore.deepNineCall; console.log("深度九大模型页面", isCollapsed.value); } @@ -642,12 +651,22 @@ const changeTopStatus = async (isTop, id) => { } await changeTop({ - model: props.currentType == "AIchat" ? 1 : props.currentType == "AiEmotion" ? 2 : 3, + model: + props.currentType == "AIchat" + ? 1 + : props.currentType == "AiEmotion" + ? 2 + : 3, recordId: id, isTop: isTop == 1 ? 0 : 1, }); await getHistoryList({ - model: props.currentType == "AIchat" ? 1 : props.currentType == "AiEmotion" ? 2 : 3, + model: + props.currentType == "AIchat" + ? 1 + : props.currentType == "AiEmotion" + ? 2 + : 3, token: localStorage.getItem("localToken"), }); } catch (error) { @@ -676,7 +695,7 @@ const openHistory = () => { chatStore.aiChatCall = true; } else if (props.currentType == "AiEmotion") { chatStore.aiEmotionCall = true; - }else if (props.currentType == "deepNine") { + } else if (props.currentType == "deepNine") { chatStore.deepNineCall = true; } }; @@ -687,7 +706,7 @@ const closeHistory = () => { chatStore.aiChatCall = false; } else if (props.currentType == "AiEmotion") { chatStore.aiEmotionCall = false; - }else if (props.currentType == "deepNine") { + } else if (props.currentType == "deepNine") { chatStore.deepNineCall = false; } }; @@ -699,10 +718,20 @@ const selectRecord = async (record) => { return; } + if (props.currentType == "deepNine" && deepNineStore.firstAPICall) { + ElMessage.warning("正在获取回复中,请稍后"); + return; + } + try { selectedRecordId.value = record.id; const result = await clickRecordAPI({ - model: props.currentType == "AIchat" ? 1 : props.currentType == "AiEmotion" ? 2 : 3, + model: + props.currentType == "AIchat" + ? 1 + : props.currentType == "AiEmotion" + ? 2 + : 3, parentId: record.parentId, recordId: record.id, }); @@ -715,13 +744,14 @@ const selectRecord = async (record) => { chatStore.aiChatCall = false; } else if (props.currentType == "AiEmotion") { chatStore.aiEmotionCall = false; - }else if (props.currentType == "deepNine") { + } else if (props.currentType == "deepNine") { chatStore.deepNineCall = false; } } dataStore.isFeedback = false; historyData.value = result.data; chatStore.dbqbClickRecord = historyData.value; + deepNineStore.dbqbClickRecord = historyData.value; // 构造股票数据对象,保持与现有结构一致 const stockData = { queryText: result.data.keyword, // 使用记录中的keyword字段作为查询文本 @@ -764,13 +794,23 @@ const deleteRecord = (id) => { const deleteRecordConfirm = async () => { try { const result = await deleteRecordAPI({ - model: props.currentType == "AIchat" ? 1 : props.currentType == "AiEmotion" ? 2 : 3, + model: + props.currentType == "AIchat" + ? 1 + : props.currentType == "AiEmotion" + ? 2 + : 3, recordId: delObj.value.id, }); console.log(result.msg); closeDeleteDialog(); await getHistoryList({ - model: props.currentType == "AIchat" ? 1 : props.currentType == "AiEmotion" ? 2 : 3, + model: + props.currentType == "AIchat" + ? 1 + : props.currentType == "AiEmotion" + ? 2 + : 3, token: localStorage.getItem("localToken"), }); } catch (e) { @@ -784,6 +824,10 @@ const handleAnnouncementClick = () => { ElMessage.warning("正在获取回复中,请稍后"); return; } + if (props.currentType == "deepNine" && deepNineStore.firstAPICall) { + ElMessage.warning("正在获取回复中,请稍后"); + return; + } emit("showAnnouncement"); }; @@ -793,15 +837,25 @@ const handleFeedbackClick = () => { ElMessage.warning("正在获取回复中,请稍后"); return; } + if (props.currentType == "deepNine" && deepNineStore.firstAPICall) { + ElMessage.warning("正在获取回复中,请稍后"); + return; + } emit("showFeedback"); }; +// 监听夺宝奇兵和情绪大模型的搜索记录状态 watch( () => chatStore.searchRecord, (newVal) => { if (chatStore.searchRecord) { getHistoryList({ - model: props.currentType == "AIchat" ? 1 : props.currentType == "AiEmotion" ? 2 : 3, + model: + props.currentType == "AIchat" + ? 1 + : props.currentType == "AiEmotion" + ? 2 + : 3, token: localStorage.getItem("localToken"), }); chatStore.searchRecord = false; @@ -809,6 +863,28 @@ watch( } ); +// 监听深度九大模型的搜索记录状态 +import { useDeepNineStore } from "@/store/deepNine.js"; +const deepNineStore = useDeepNineStore(); + +watch( + () => deepNineStore.searchRecord, + (newVal) => { + if (deepNineStore.searchRecord) { + getHistoryList({ + model: + props.currentType == "deepNine" + ? 3 + : props.currentType == "AIchat" + ? 1 + : 2, + token: localStorage.getItem("localToken"), + }); + deepNineStore.searchRecord = false; + } + } +); + // 暴露方法和状态给父组件 defineExpose({ isCollapsed, diff --git a/src/views/deepNine.vue b/src/views/deepNine.vue index a5381ef..4b44902 100644 --- a/src/views/deepNine.vue +++ b/src/views/deepNine.vue @@ -712,8 +712,8 @@ const createTypingEffect = (message, content, speed) => { flag: false, content: "系统正在为您努力加载中,请稍后再试", }); - chatStore.isLoading = false; - chatStore.chatInput = false; + homepageChatStore.isLoading = false; + homepageChatStore.deepNineInput = false; emit("enableInput"); if (message.error == "2") { apiStatus.two.isError = true; @@ -723,9 +723,9 @@ const createTypingEffect = (message, content, speed) => { } if (message.end) { homepageChatStore.getUserCount(); - chatStore.isLoading = false; - console.log("打印完毕,接触输入框禁用状态"); - chatStore.chatInput = false; + homepageChatStore.isLoading = false; + console.log("打印完毕,解除输入框禁用状态"); + homepageChatStore.deepNineInput = false; emit("enableInput"); } message.isTyping = false; @@ -810,8 +810,8 @@ const createTypingEffect = (message, content, speed) => { flag: false, content: "系统正在为您努力加载中,请稍后再试", }); - chatStore.isLoading = false; - chatStore.chatInput = false; + homepageChatStore.isLoading = false; + homepageChatStore.deepNineInput = false; emit("enableInput"); if (message.error == "2") { apiStatus.two.isError = true; @@ -840,8 +840,8 @@ const createTypingEffect = (message, content, speed) => { flag: false, content: "系统正在为您努力加载中,请稍后再试", }); - chatStore.isLoading = false; - chatStore.chatInput = false; + homepageChatStore.isLoading = false; + homepageChatStore.deepNineInput = false; emit("enableInput"); if (message.error == "2") { apiStatus.two.isError = true; @@ -1134,8 +1134,8 @@ watch( chatStore.messages.push(aiMsg); - chatStore.isLoading = false; - chatStore.chatInput = false; + homepageChatStore.isLoading = false; + homepageChatStore.deepNineInput = false; chatStore.firstAPICall = false; console.log("历史记录可以点击"); @@ -1157,8 +1157,8 @@ watch( flag: false, content: "系统正在为您努力加载中,请稍后再试", }); - chatStore.isLoading = false; - chatStore.chatInput = false; + homepageChatStore.isLoading = false; + homepageChatStore.deepNineInput = false; chatStore.firstAPICall = false; console.log("历史记录可以点击"); emit("enableInput"); @@ -1497,8 +1497,8 @@ watch( flag: false, content: "系统正在为您努力加载中,请稍后再试", }); - chatStore.isLoading = false; - chatStore.chatInput = false; + homepageChatStore.isLoading = false; + homepageChatStore.deepNineInput = false; emit("enableInput"); } } @@ -1569,11 +1569,9 @@ watch( // const ac33 = result22.data.zjqssc1; - const ac34 = `

【资金趋势导航】

`; const ac35 = result22.data.zjqssc1; - // const ac3 = `

${result23.data.DXTSC}

${result23.data.DXTSC2}

${result23.data.ZJQSSC1}

`; const ac3Arr = []; ac3Arr.push(ac31); @@ -1612,8 +1610,8 @@ watch( flag: false, content: "系统正在为您努力加载中,请稍后再试", }); - chatStore.isLoading = false; - chatStore.chatInput = false; + homepageChatStore.isLoading = false; + homepageChatStore.deepNineInput = false; emit("enableInput"); } } @@ -1655,7 +1653,7 @@ watch( class: "title3", type: "title3", content: - "https://d31zlh4on95l9h.cloudfront.net/images/ce71f75008422ed70e88b1ae0bc4d550.png", + "https://d31zlh4on95l9h.cloudfront.net/images/d1fa1f4cbd6452796a4c5368d9f57c4d.png", }, "", 50 @@ -1698,8 +1696,8 @@ watch( flag: false, content: "系统正在为您努力加载中,请稍后再试", }); - chatStore.isLoading = false; - chatStore.chatInput = false; + homepageChatStore.isLoading = false; + homepageChatStore.deepNineInput = false; emit("enableInput"); } } @@ -1870,8 +1868,8 @@ watch( flag: false, content: "数据缺失,请稍后重试", }); - chatStore.isLoading = false; - chatStore.chatInput = false; + homepageChatStore.isLoading = false; + homepageChatStore.deepNineInput = false; chatStore.firstAPICall = false; emit("enableInput"); } @@ -1960,8 +1958,8 @@ watch( isTypingInProgress.value = false; // 4. 重置加载状态 - chatStore.isLoading = false; - chatStore.chatInput = false; + homepageChatStore.isLoading = false; + homepageChatStore.deepNineInput = false; emit("enableInput"); // 在下一个事件循环中清空 dbqbClickRecord @@ -1976,8 +1974,7 @@ watch( if ( !clickRecord.value.wokeFlowData.One || !clickRecord.value.wokeFlowData.Two || - !clickRecord.value.wokeFlowData.Three || - !clickRecord.value.wokeFlowData.Four + !clickRecord.value.wokeFlowData.Three ) { return; } @@ -1985,18 +1982,25 @@ watch( // 清空聊天框内容 chatStore.messages = []; - chatStore.messages.push({ + const userAudioArray = [ + clickRecord.value.wokeFlowData.One.link1, + clickRecord.value.wokeFlowData.One.link, + clickRecord.value.wokeFlowData.Two.link3, + ]; + // if (clickRecord.value.wokeFlowData.Two.link2) { + // userAudioArray.push(clickRecord.value.wokeFlowData.Two.link2); + // } + userAudioArray.push(clickRecord.value.wokeFlowData.Two.link1); + userAudioArray.push(clickRecord.value.wokeFlowData.Three.link); + const userContent = { sender: "user", timestamp: clickRecord.value.createdTime, content: clickRecord.value.keyword, - audioArray: [ - clickRecord.value.wokeFlowData.One.url, - clickRecord.value.wokeFlowData.Two.url, - clickRecord.value.wokeFlowData.Three.url, - clickRecord.value.wokeFlowData.Four.url, - ], + audioArray: userAudioArray, audioStatus: false, - }); + }; + + chatStore.messages.push(userContent); chatStore.messages.push({ sender: "ai", @@ -2021,7 +2025,7 @@ watch( content: pc1, }); - const nineTurns = clickRecord.value.stockData.nineTurns; + const nineTurns = clickRecord.value.stockData.data; // 度牛尺K线图 if ( nineTurns && @@ -2096,6 +2100,7 @@ watch( } }); } + // 添加标题-数据分析时代下的认知变现 chatStore.messages.push({ sender: "ai", class: "title2", @@ -2103,64 +2108,64 @@ watch( content: "", }); - const pc2 = marked(clickRecord.value.wokeFlowData.Two.hxjzpg); - // 先推送初始消息 + // 添加图片-数据分析时代下的认知变现 chatStore.messages.push({ sender: "ai", class: "content3", - type: "content3", - content: pc2, + type: "img1", + content: + "https://d31zlh4on95l9h.cloudfront.net/images/5baa0a449cf74fb6a1afb1c909a21194.png", }); + // 添加标题-结构框架分析 chatStore.messages.push({ sender: "ai", class: "title3", type: "title3", - content: title2, + content: + "https://d31zlh4on95l9h.cloudfront.net/images/9ab9d76b6906eb914fa1842dbcd56841.png", }); - const ac3 = `

【主力行为】

${clickRecord.value.wokeFlowData.Three.zhuli1}

${clickRecord.value.wokeFlowData.Three.zhuli2}

${clickRecord.value.wokeFlowData.Three.zhuli3}

`; - + // 添加内容框1 + const pc2 = marked(clickRecord.value.wokeFlowData.One.jgkjfx); // 先推送初始消息 chatStore.messages.push({ sender: "ai", class: "content3", type: "content3", - content: ac3, - isTyping: true, + content: pc2, }); - + // 添加标题-资金动向监控 chatStore.messages.push({ sender: "ai", class: "title3", type: "title3", - content: title3, + content: + " https://d31zlh4on95l9h.cloudfront.net/images/f95c44f83b3e3c52e88964631c199060.png", }); - const arr = clickRecord.value.wokeFlowData.Three.kongjian.split(","); - const kongjian = `

【空间维度】

${arr[0]},${arr[1]}

${arr[2]},${arr[3]}

`; - const shijian = `

【时间维度】

${clickRecord.value.wokeFlowData.Three.shijian}

`; - const nengliang = `

【能量维度】

${clickRecord.value.wokeFlowData.Three.nengliang}

`; - const ac4 = kongjian + shijian + nengliang; + const ac3 = `

【资金异动信号】

${clickRecord.value.wokeFlowData.Two.dxtsc}

【资金趋势导航】

${clickRecord.value.wokeFlowData.Two.zjqssc1}

`; // 先推送初始消息 chatStore.messages.push({ sender: "ai", class: "content3", type: "content3", - content: ac4, + content: ac3, + isTyping: true, }); + // 添加标题-策略共振决策模型 chatStore.messages.push({ sender: "ai", class: "title3", type: "title3", - content: title4, + content: + "https://d31zlh4on95l9h.cloudfront.net/images/d1fa1f4cbd6452796a4c5368d9f57c4d.png", }); - const cftj = `

【触发条件】

${clickRecord.value.wokeFlowData.Four.cftl}

`; - const gfzl = `

【攻防指令】

${clickRecord.value.wokeFlowData.Four.gfzl}

`; - const ac5 = cftj + gfzl; + // 添加内容框4 + const ac5 = `

${clickRecord.value.wokeFlowData.Three.zjqssc2}

`; // 先推送初始消息 chatStore.messages.push({ @@ -2169,7 +2174,6 @@ watch( type: "content3", content: ac5, }); - chatStore.messages.push({ sender: "ai", class: "mianze", diff --git a/src/views/homePage.vue b/src/views/homePage.vue index f408a99..2ed67b4 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -344,6 +344,7 @@ watch( watch( () => chatStore.deepNineInput, async (newVal) => { + console.log("deepNineInput", chatStore.deepNineInput); if (activeTab.value == "deepNine") { isInputDisabled.value = chatStore.deepNineInput; } @@ -392,7 +393,7 @@ const sendMessage = async () => { if (activeTab.value === "deepNine") { // 禁用输入框 isInputDisabled.value = true; - + chatStore.deepNineInput = true; // 获取深度九大模型的 store const deepNineStore = useDeepNineStore(); @@ -453,19 +454,19 @@ const enableInput = () => { const handleHistorySelect = (stockData) => { console.log("接收到历史记录数据:", stockData); - // 如果当前不在AiEmotion页面,切换到AiEmotion页面 - // if (activeTab.value !== 'AiEmotion') { - // setActiveTab('AiEmotion', 1); - // } - - // 等待组件渲染完成后调用addStock方法 - nextTick(() => { - if (aiEmotionRef.value && aiEmotionRef.value.addStock) { - aiEmotionRef.value.addStock(stockData); - } else { - console.error("AiEmotion组件或addStock方法不可用"); - } - }); + // 只在情绪大模型中处理历史记录选择 + if (activeTab.value === 'AiEmotion') { + // 等待组件渲染完成后调用addStock方法 + nextTick(() => { + if (aiEmotionRef.value && aiEmotionRef.value.addStock) { + aiEmotionRef.value.addStock(stockData); + } else { + console.error("AiEmotion组件或addStock方法不可用"); + } + }); + } else { + console.log("历史记录选择仅在情绪大模型中有效"); + } }; // 公告 @@ -2039,7 +2040,8 @@ onUnmounted(() => {
Token兑换规则
- • 点击右上角"获取Token",即可进入Token兑换页进行金币兑换Token(只能兑换普通Token) + • + 点击右上角"获取Token",即可进入Token兑换页进行金币兑换Token(只能兑换普通Token)
• 金币兑换Token的比例为:1金币=1Token;一经兑换,不予退还