Browse Source

Merge branch 'milestone-20250710-上线前优化' of http://39.101.133.168:8807/hongxilin/AIxiaocaishen into dongqian/feature-20250702094358-小财神适配

dongqian/feature-20250702094358-小财神适配
dongqian 1 day ago
parent
commit
62dfe11d06
  1. BIN
      src/assets/img/AIchat/圈1.png
  2. 3
      src/views/AIchat.vue
  3. 394
      src/views/AiEmotion.vue
  4. 12
      src/views/homePage.vue
  5. 4
      vite.config.js

BIN
src/assets/img/AIchat/圈1.png

After

Width: 739  |  Height: 750  |  Size: 154 KiB

3
src/views/AIchat.vue

@ -31,6 +31,7 @@ import title4 from "@/assets/img/AIchat/综合作战.png";
import logo1 from "@/assets/img/AIchat/夺宝奇兵logo.png"; import logo1 from "@/assets/img/AIchat/夺宝奇兵logo.png";
import logo2 from "@/assets/img/AIchat/开启无限财富.png"; import logo2 from "@/assets/img/AIchat/开启无限财富.png";
import bgc from "@/assets/img/AIchat/圈.png"; import bgc from "@/assets/img/AIchat/圈.png";
import bgc1 from "@/assets/img/AIchat/圈1.png";
const chatStore = useChatStore(); const chatStore = useChatStore();
const audioStore = useAudioStore(); const audioStore = useAudioStore();
const dataStore = useDataStore(); const dataStore = useDataStore();
@ -3771,7 +3772,7 @@ onUnmounted(() => {
<div class="chat-container"> <div class="chat-container">
<!-- GIF区域 --> <!-- GIF区域 -->
<div class="gif-area"> <div class="gif-area">
<img :src="bgc" alt="夺宝奇兵大模型logo" class="bgc" />
<img :src="bgc1" alt="夺宝奇兵大模型logo" class="bgc" />
<img :src="logo1" alt="夺宝奇兵大模型logo" class="logo1" /> <img :src="logo1" alt="夺宝奇兵大模型logo" class="logo1" />
<img :src="logo2" alt="夺宝奇兵大模型logo" class="logo2" /> <img :src="logo2" alt="夺宝奇兵大模型logo" class="logo2" />
</div> </div>

394
src/views/AiEmotion.vue

@ -45,11 +45,11 @@
</div> </div>
<span class="span02">{{ displayDate }}</span> <span class="span02">{{ displayDate }}</span>
</div> </div>
<div class="class0201">
<div class="class0201" v-if="chartVisibility.marketTemperature">
<img src="@/assets/img/AiEmotion/L1.png" alt="情绪监控图标"> <img src="@/assets/img/AiEmotion/L1.png" alt="情绪监控图标">
</div> </div>
<!-- 温度计图表 --> <!-- 温度计图表 -->
<div class="class03">
<div class="class03" v-if="chartVisibility.marketTemperature">
<div class="class003"> <div class="class003">
<div class="content1"> <div class="content1">
<img class="img01" src="@/assets/img/AiEmotion/温度计.png" alt="温度计图标"> <img class="img01" src="@/assets/img/AiEmotion/温度计.png" alt="温度计图标">
@ -63,11 +63,11 @@
<marketTemperature ref="marketTemperatureRef" /> <marketTemperature ref="marketTemperatureRef" />
</div> </div>
</div> </div>
<div class="class0301">
<div class="class0301" v-if="chartVisibility.emotionDecod">
<img src="@/assets/img/AiEmotion/L2.png" alt="情绪解码图标"> <img src="@/assets/img/AiEmotion/L2.png" alt="情绪解码图标">
</div> </div>
<!-- 情绪解码器图表 --> <!-- 情绪解码器图表 -->
<div class="class04">
<div class="class04" v-if="chartVisibility.emotionDecod">
<div class="class0401"> <div class="class0401">
<img class="img02" src='@/assets/img/AiEmotion/emotionDecod.png' alt="情绪解码器图标"> <img class="img02" src='@/assets/img/AiEmotion/emotionDecod.png' alt="情绪解码器图标">
<span class="title2">情绪解码器</span> <span class="title2">情绪解码器</span>
@ -76,11 +76,11 @@
<emotionDecod ref="emotionDecodRef"></emotionDecod> <emotionDecod ref="emotionDecodRef"></emotionDecod>
</div> </div>
</div> </div>
<div class="class0403">
<div class="class0403" v-if="chartVisibility.emotionalBottomRadar">
<img src="@/assets/img/AiEmotion/L3.png" alt="情绪推演图标"> <img src="@/assets/img/AiEmotion/L3.png" alt="情绪推演图标">
</div> </div>
<!-- 情绪探底雷达图表 --> <!-- 情绪探底雷达图表 -->
<div class="class05">
<div class="class05" v-if="chartVisibility.emotionalBottomRadar">
<div class="class0502"> <div class="class0502">
<img class="img03" src="@/assets/img/AiEmotion/探底雷达.png" alt="探底雷达图表"> <img class="img03" src="@/assets/img/AiEmotion/探底雷达.png" alt="探底雷达图表">
<span class="title3">情绪探底雷达</span> <span class="title3">情绪探底雷达</span>
@ -89,11 +89,11 @@
<emotionalBottomRadar ref="emotionalBottomRadarRef"></emotionalBottomRadar> <emotionalBottomRadar ref="emotionalBottomRadarRef"></emotionalBottomRadar>
</div> </div>
</div> </div>
<div class="class0501">
<div class="class0501" v-if="chartVisibility.emoEnergyConverter">
<img src="@/assets/img/AiEmotion/L4.png" alt="情绪套利"> <img src="@/assets/img/AiEmotion/L4.png" alt="情绪套利">
</div> </div>
<!-- 情绪能量转化器图表 --> <!-- 情绪能量转化器图表 -->
<div class="class06">
<div class="class06" v-if="chartVisibility.emoEnergyConverter">
<div class="class0601"> <div class="class0601">
<img class="img04" src="@/assets/img/AiEmotion/能量转化器.png" alt="能量转化器图标"> <img class="img04" src="@/assets/img/AiEmotion/能量转化器.png" alt="能量转化器图标">
<span class="title4">情绪能量转化器</span> <span class="title4">情绪能量转化器</span>
@ -277,6 +277,14 @@ const moduleVisibility = ref({
four: false, four: false,
disclaimer: false disclaimer: false
}); });
//
const chartVisibility = ref({
marketTemperature: false,
emotionDecod: false,
emotionalBottomRadar: false,
emoEnergyConverter: false
});
const typewriterTimers = ref([]); const typewriterTimers = ref([]);
// //
const stockTypewriterShown = ref(new Map()); const stockTypewriterShown = ref(new Map());
@ -294,7 +302,7 @@ const displayDate = computed(() => {
if (!currentStock.value?.apiData) return ""; if (!currentStock.value?.apiData) return "";
const lastData = currentStock.value.apiData.GSWDJ?.at(-1); const lastData = currentStock.value.apiData.GSWDJ?.at(-1);
if (!lastData || !lastData[0]) return ""; if (!lastData || !lastData[0]) return "";
const dateStr = lastData[0]; const dateStr = lastData[0];
// YYYY-MM-DD YYYY/MM/DD // YYYY-MM-DD YYYY/MM/DD
const dateMatch = dateStr.match(/(\d{4})[\-\/](\d{1,2})[\-\/](\d{1,2})/); const dateMatch = dateStr.match(/(\d{4})[\-\/](\d{1,2})[\-\/](\d{1,2})/);
@ -303,7 +311,7 @@ const displayDate = computed(() => {
// DD/MM/YYYY // DD/MM/YYYY
return `更新时间:${day.padStart(2, '0')}/${month.padStart(2, '0')}/${year}`; return `更新时间:${day.padStart(2, '0')}/${month.padStart(2, '0')}/${year}`;
} }
// //
return dateStr; return dateStr;
}); });
@ -372,6 +380,13 @@ watch(() => emotionStore.stockList, (newStockList) => {
four: false, four: false,
disclaimer: false disclaimer: false
}; };
//
chartVisibility.value = {
marketTemperature: false,
emotionDecod: false,
emotionalBottomRadar: false,
emoEnergyConverter: false
};
console.log('股票列表已清空,页面数据已隐藏'); console.log('股票列表已清空,页面数据已隐藏');
} }
}, { deep: true }); }, { deep: true });
@ -583,6 +598,13 @@ watch(currentStock, (newStock) => {
} }
} else { } else {
console.log('股票数据不存在或API数据未加载'); console.log('股票数据不存在或API数据未加载');
//
chartVisibility.value = {
marketTemperature: false,
emotionDecod: false,
emotionalBottomRadar: false,
emoEnergyConverter: false
};
} }
}, { immediate: true }); }, { immediate: true });
@ -625,7 +647,7 @@ watch(parsedConclusion, (newConclusion) => {
}, { immediate: true }); }, { immediate: true });
// //
function startTypewriterEffect(conclusion) {
function startTypewriterEffect(conclusion, onComplete) {
console.log('开始打字机效果,结论数据:', conclusion); console.log('开始打字机效果,结论数据:', conclusion);
// //
@ -758,10 +780,14 @@ function startTypewriterEffect(conclusion) {
for (let i = 0; i <= disclaimerText.length; i++) { for (let i = 0; i <= disclaimerText.length; i++) {
const timer = setTimeout(() => { const timer = setTimeout(() => {
displayedTexts.value.disclaimer = disclaimerText.substring(0, i); displayedTexts.value.disclaimer = disclaimerText.substring(0, i);
//
//
if (i === disclaimerText.length) { if (i === disclaimerText.length) {
setTimeout(() => { setTimeout(() => {
scrollToBottom(); scrollToBottom();
//
if (onComplete && typeof onComplete === 'function') {
onComplete();
}
}, 100); }, 100);
} }
}, totalDelay + i * typeSpeed); }, totalDelay + i * typeSpeed);
@ -877,7 +903,7 @@ function startImageRotation() {
// //
async function handleSendMessage(input) {
async function handleSendMessage(input, onComplete) {
console.log("发送内容:", input); console.log("发送内容:", input);
// //
isUserInitiated.value = true; isUserInitiated.value = true;
@ -885,6 +911,10 @@ async function handleSendMessage(input) {
// //
if (!input || !input.trim()) { if (!input || !input.trim()) {
ElMessage.warning("输入内容不能为空"); ElMessage.warning("输入内容不能为空");
//
if (onComplete && typeof onComplete === 'function') {
onComplete();
}
return; return;
} }
@ -903,6 +933,10 @@ async function handleSendMessage(input) {
// //
isRotating.value = false; isRotating.value = false;
messages.value = [...previousMessages, ...messages.value]; messages.value = [...previousMessages, ...messages.value];
//
if (onComplete && typeof onComplete === 'function') {
onComplete();
}
return; return;
} }
@ -920,6 +954,10 @@ async function handleSendMessage(input) {
// //
isRotating.value = false; isRotating.value = false;
messages.value = [...previousMessages, ...messages.value]; messages.value = [...previousMessages, ...messages.value];
//
if (onComplete && typeof onComplete === 'function') {
onComplete();
}
return; return;
} }
@ -947,7 +985,6 @@ async function handleSendMessage(input) {
const result = await getReplyAPI(params); const result = await getReplyAPI(params);
const response = await result.json(); const response = await result.json();
const parsedData = JSON.parse(response.data); const parsedData = JSON.parse(response.data);
console.log("第一个接口解析后的数据:", parsedData);
// //
if (!parsedData || !parsedData.market || !parsedData.code) { if (!parsedData || !parsedData.market || !parsedData.code) {
@ -956,6 +993,10 @@ async function handleSendMessage(input) {
messages.value.push(aiMessage); messages.value.push(aiMessage);
isRotating.value = false; isRotating.value = false;
messages.value = [...previousMessages, ...messages.value]; messages.value = [...previousMessages, ...messages.value];
//
if (onComplete && typeof onComplete === 'function') {
onComplete();
}
return; return;
} }
@ -963,7 +1004,6 @@ async function handleSendMessage(input) {
// //
isLoading.value = true; isLoading.value = true;
console.log("工作流接口返回股票信息:", parsedData);
isPageLoaded.value = false; isPageLoaded.value = false;
// //
@ -985,7 +1025,6 @@ async function handleSendMessage(input) {
// //
const conclusionResponse = await conclusionResult.json(); const conclusionResponse = await conclusionResult.json();
console.log("第二个工作流接口返回数据:", conclusionResponse);
// //
if (conclusionResponse && conclusionResponse.data && fetchDataResult) { if (conclusionResponse && conclusionResponse.data && fetchDataResult) {
@ -1006,26 +1045,28 @@ async function handleSendMessage(input) {
console.error('更新用户次数失败:', error); console.error('更新用户次数失败:', error);
} }
console.log('所有数据加载完成,开始渲染页面');
// //
nextTick(() => { nextTick(() => {
if (currentStock.value && currentStock.value.apiData) { if (currentStock.value && currentStock.value.apiData) {
renderCharts(currentStock.value.apiData); renderCharts(currentStock.value.apiData);
console.log('数据加载完成后开始渲染图表');
// //
if (isUserInitiated.value && parsedConclusion.value && audioUrl.value) { if (isUserInitiated.value && parsedConclusion.value && audioUrl.value) {
const stockCode = currentStock.value.stockInfo?.code || currentStock.value.stockInfo?.symbol; const stockCode = currentStock.value.stockInfo?.code || currentStock.value.stockInfo?.symbol;
if (stockCode && !stockTypewriterShown.value.has(stockCode)) { if (stockCode && !stockTypewriterShown.value.has(stockCode)) {
console.log('用户主动搜索,立即触发音频和打字机效果');
startTypewriterEffect(parsedConclusion.value);
startTypewriterEffect(parsedConclusion.value, onComplete);
if (!stockAudioPlayed.value.has(stockCode)) { if (!stockAudioPlayed.value.has(stockCode)) {
stockAudioPlayed.value.set(stockCode, true); stockAudioPlayed.value.set(stockCode, true);
playAudio(audioUrl.value); playAudio(audioUrl.value);
} }
stockTypewriterShown.value.set(stockCode, true); stockTypewriterShown.value.set(stockCode, true);
} else {
//
if (onComplete && typeof onComplete === 'function') {
onComplete();
}
} }
} }
@ -1040,6 +1081,10 @@ async function handleSendMessage(input) {
messages.value.push(aiMessage); messages.value.push(aiMessage);
isRotating.value = false; isRotating.value = false;
messages.value = [...previousMessages, ...messages.value]; messages.value = [...previousMessages, ...messages.value];
//
if (onComplete && typeof onComplete === 'function') {
onComplete();
}
return; return;
} }
} catch (error) { } catch (error) {
@ -1048,6 +1093,10 @@ async function handleSendMessage(input) {
// //
isRotating.value = false; isRotating.value = false;
messages.value = [...previousMessages, ...messages.value]; messages.value = [...previousMessages, ...messages.value];
//
if (onComplete && typeof onComplete === 'function') {
onComplete();
}
return; return;
} finally { } finally {
// //
@ -1082,11 +1131,8 @@ async function fetchData(code, market, stockName, queryText) {
); );
const stockDataResponse = stockDataResult.data; // const stockDataResponse = stockDataResult.data; //
console.log('图表数据接口返回数据:', stockDataResponse.data);
if (stockDataResponse.code === 200 && stockDataResponse.data) { if (stockDataResponse.code === 200 && stockDataResponse.data) {
console.log(stockDataResponse.code)
// //
const stockData = { const stockData = {
queryText: queryText, queryText: queryText,
@ -1108,7 +1154,6 @@ async function fetchData(code, market, stockName, queryText) {
return false; // return false; //
} }
} catch (error) { } catch (error) {
console.error('fetchData error:', error);
const aiMessage = reactive({ sender: 'ai', text: '图表数据请求失败,请检查网络连接' }); const aiMessage = reactive({ sender: 'ai', text: '图表数据请求失败,请检查网络连接' });
messages.value.push(aiMessage); messages.value.push(aiMessage);
return false; // return false; //
@ -1117,52 +1162,114 @@ async function fetchData(code, market, stockName, queryText) {
// //
function renderCharts(data) { function renderCharts(data) {
console.log('开始渲染图表,数据:', data);
//
const clonedData = JSON.parse(JSON.stringify(data));
//
chartVisibility.value = {
marketTemperature: !!(clonedData.GSWDJ && clonedData.GSWDJ.length > 0),
emotionDecod: !!(clonedData.QXJMQ && clonedData.QXJMQ.length > 0),
emotionalBottomRadar: !!(clonedData.QXTDLD && clonedData.QXTDLD.length > 0),
emoEnergyConverter: !!(clonedData.QXNLZHQ && clonedData.QXNLZHQ.length > 0)
};
console.log('图表显示状态:', chartVisibility.value);
nextTick(() => { nextTick(() => {
// DOM
// DOM
setTimeout(() => { setTimeout(() => {
try { try {
//
const clonedData = JSON.parse(JSON.stringify(data));
console.log('已深拷贝数据,避免污染原始数据');
console.log('所有数据1111111111111:', clonedData)
console.log('图表组件ref状态:', {
marketTemperatureRef: !!marketTemperatureRef.value,
emotionDecodRef: !!emotionDecodRef.value,
emotionalBottomRadarRef: !!emotionalBottomRadarRef.value,
emoEnergyConverterRef: !!emoEnergyConverterRef.value
});
// //
if (marketTemperatureRef.value && clonedData.GSWDJ) {
console.log("开始渲染股市温度计图表");
console.log("股市温度计数据", clonedData.GSWDJ);
marketTemperatureRef.value.initChart(clonedData.GSWDJ, clonedData.KLine20, clonedData.WDRL);
console.log("股市温度计图表已渲染");
if (marketTemperatureRef.value && chartVisibility.value.marketTemperature) {
console.log('开始渲染股市温度计图表');
console.log('marketTemperatureRef方法:', typeof marketTemperatureRef.value.initChart);
if (typeof marketTemperatureRef.value.initChart === 'function') {
try {
marketTemperatureRef.value.initChart(clonedData.GSWDJ, clonedData.KLine20, clonedData.WDRL);
console.log('股市温度计图表渲染成功');
} catch (error) {
console.error('股市温度计图表渲染失败:', error);
}
} else {
console.error('marketTemperatureRef.initChart 方法不存在');
}
} else {
console.log('股市温度计图表未渲染,ref存在:', !!marketTemperatureRef.value, '数据存在:', chartVisibility.value.marketTemperature);
} }
// //
if (emotionDecodRef.value && clonedData.QXJMQ) {
console.log("开始渲染情绪解码器图表");
console.log("情绪解码器数据", clonedData.QXJMQ);
emotionDecodRef.value.initQXNLZHEcharts(clonedData.KLine20, clonedData.QXJMQ);
console.log("情绪解码器图表已渲染");
if (emotionDecodRef.value && chartVisibility.value.emotionDecod) {
console.log('开始渲染情绪解码器图表');
console.log('emotionDecodRef方法:', typeof emotionDecodRef.value.initQXNLZHEcharts);
if (typeof emotionDecodRef.value.initQXNLZHEcharts === 'function') {
try {
emotionDecodRef.value.initQXNLZHEcharts(clonedData.KLine20, clonedData.QXJMQ);
console.log('情绪解码器图表渲染成功');
} catch (error) {
console.error('情绪解码器图表渲染失败:', error);
}
} else {
console.error('emotionDecodRef.initQXNLZHEcharts 方法不存在');
}
} else {
console.log('情绪解码器图表未渲染,ref存在:', !!emotionDecodRef.value, '数据存在:', chartVisibility.value.emotionDecod);
} }
// //
if (emotionalBottomRadarRef.value && clonedData.QXTDLD) {
console.log("开始渲染情绪探底雷达图表");
console.log("探底雷达数据", clonedData.QXTDLD);
emotionalBottomRadarRef.value.initEmotionalBottomRadar(
clonedData.KLine20,
clonedData.QXTDLD
);
console.log("情绪探底雷达图表已渲染");
if (emotionalBottomRadarRef.value && chartVisibility.value.emotionalBottomRadar) {
console.log('开始渲染情绪探底雷达图表');
console.log('emotionalBottomRadarRef方法:', typeof emotionalBottomRadarRef.value.initEmotionalBottomRadar);
if (typeof emotionalBottomRadarRef.value.initEmotionalBottomRadar === 'function') {
try {
emotionalBottomRadarRef.value.initEmotionalBottomRadar(
clonedData.KLine20,
clonedData.QXTDLD
);
console.log('情绪探底雷达图表渲染成功');
} catch (error) {
console.error('情绪探底雷达图表渲染失败:', error);
}
} else {
console.error('emotionalBottomRadarRef.initEmotionalBottomRadar 方法不存在');
}
} else {
console.log('情绪探底雷达图表未渲染,ref存在:', !!emotionalBottomRadarRef.value, '数据存在:', chartVisibility.value.emotionalBottomRadar);
} }
// //
if (emoEnergyConverterRef.value && clonedData.QXNLZHQ) {
console.log("开始渲染情绪能量转化器图表");
console.log("KLine20:", clonedData.KLine20);
console.log("QXNLZHQ:", clonedData.QXNLZHQ);
emoEnergyConverterRef.value.initQXNLZHEcharts(clonedData.KLine20, clonedData.QXNLZHQ);
console.log("情绪能量转化器图表已渲染");
if (emoEnergyConverterRef.value && chartVisibility.value.emoEnergyConverter) {
console.log('开始渲染情绪能量转化器图表');
console.log('emoEnergyConverterRef方法:', typeof emoEnergyConverterRef.value.initQXNLZHEcharts);
if (typeof emoEnergyConverterRef.value.initQXNLZHEcharts === 'function') {
try {
emoEnergyConverterRef.value.initQXNLZHEcharts(clonedData.KLine20, clonedData.QXNLZHQ);
console.log('情绪能量转化器图表渲染成功');
} catch (error) {
console.error('情绪能量转化器图表渲染失败:', error);
}
} else {
console.error('emoEnergyConverterRef.initQXNLZHEcharts 方法不存在');
}
} else {
console.log('情绪能量转化器图表未渲染,ref存在:', !!emoEnergyConverterRef.value, '数据存在:', chartVisibility.value.emoEnergyConverter);
} }
console.log('图表渲染完成');
} catch (error) { } catch (error) {
console.error('图表渲染过程中发生错误:', error);
console.error('图表渲染错误:', error);
const aiMessage = reactive({ sender: 'ai', text: '图表渲染失败,请重试' }); const aiMessage = reactive({ sender: 'ai', text: '图表渲染失败,请重试' });
messages.value.push(aiMessage); messages.value.push(aiMessage);
} }
}, 100); // 100msDOM
}, 500); // 500msDOM
}); });
} }
@ -1172,7 +1279,7 @@ const scrollToBottom = async () => {
console.log('用户正在手动滚动,跳过自动滚动'); console.log('用户正在手动滚动,跳过自动滚动');
return; return;
} }
const container = userInputDisplayRef.value; const container = userInputDisplayRef.value;
if (!container) return; if (!container) return;
await nextTick(); await nextTick();
@ -1185,12 +1292,12 @@ const scrollToBottom = async () => {
// //
const handleUserScroll = () => { const handleUserScroll = () => {
isUserScrolling.value = true; isUserScrolling.value = true;
// //
if (scrollTimeout.value) { if (scrollTimeout.value) {
clearTimeout(scrollTimeout.value); clearTimeout(scrollTimeout.value);
} }
// 2 // 2
scrollTimeout.value = setTimeout(() => { scrollTimeout.value = setTimeout(() => {
isUserScrolling.value = false; isUserScrolling.value = false;
@ -1408,7 +1515,7 @@ onMounted(async () => {
// //
window.addEventListener('resize', globalResizeHandler); window.addEventListener('resize', globalResizeHandler);
window.aiEmotionGlobalResizeHandler = globalResizeHandler; window.aiEmotionGlobalResizeHandler = globalResizeHandler;
// //
const container = userInputDisplayRef.value; const container = userInputDisplayRef.value;
if (container) { if (container) {
@ -1488,7 +1595,7 @@ onUnmounted(() => {
window.removeEventListener('resize', window.aiEmotionGlobalResizeHandler); window.removeEventListener('resize', window.aiEmotionGlobalResizeHandler);
window.aiEmotionGlobalResizeHandler = null; window.aiEmotionGlobalResizeHandler = null;
} }
// //
const container = userInputDisplayRef.value; const container = userInputDisplayRef.value;
if (container) { if (container) {
@ -1496,7 +1603,7 @@ onUnmounted(() => {
container.removeEventListener('touchmove', handleTouchMove); container.removeEventListener('touchmove', handleTouchMove);
container.removeEventListener('scroll', handleUserScroll); container.removeEventListener('scroll', handleUserScroll);
} }
// //
if (scrollTimeout.value) { if (scrollTimeout.value) {
clearTimeout(scrollTimeout.value); clearTimeout(scrollTimeout.value);
@ -1515,10 +1622,10 @@ defineExpose({
</script> </script>
<style scoped> <style scoped>
.disclaimer-item {
p {
color: #ffffff !important;
}
.disclaimer-item p {
color: #ffffff !important;
font-size: 20px;
font-weight: bold;
} }
.container { .container {
@ -1700,8 +1807,6 @@ defineExpose({
padding-left: 15px; padding-left: 15px;
position: relative; position: relative;
&:last-child { &:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
@ -2002,6 +2107,7 @@ defineExpose({
transition: all 0.3s ease; transition: all 0.3s ease;
/* 添加平滑过渡效果 */ /* 添加平滑过渡效果 */
} }
.class04 { .class04 {
background-image: url('@/assets/img/AiEmotion/bk00000.png'); background-image: url('@/assets/img/AiEmotion/bk00000.png');
/* 使用导入的背景图片 */ /* 使用导入的背景图片 */
@ -2058,7 +2164,7 @@ defineExpose({
/* 确保不超出父容器 */ /* 确保不超出父容器 */
height: auto; height: auto;
/* 高度根据内容动态变化 */ /* 高度根据内容动态变化 */
min-height: 55rem;
/* min-height: 55rem; */
/* 设置最小高度,确保图片显示 */ /* 设置最小高度,确保图片显示 */
margin: 0 auto; margin: 0 auto;
box-sizing: border-box; box-sizing: border-box;
@ -2245,9 +2351,9 @@ defineExpose({
} }
/* 调整图表容器高度 */ /* 调整图表容器高度 */
.class00 {
/* .class00 {
min-height: 45rem; min-height: 45rem;
}
} */
.class03 { .class03 {
min-height: 60rem; min-height: 60rem;
@ -2274,9 +2380,9 @@ defineExpose({
} }
/* 调整图表容器高度 */ /* 调整图表容器高度 */
.class00 {
/* .class00 {
min-height: 40rem; min-height: 40rem;
}
} */
.class03 { .class03 {
min-height: 55rem; min-height: 55rem;
@ -2440,9 +2546,9 @@ defineExpose({
} }
/* 调整其他图表容器高度 */ /* 调整其他图表容器高度 */
.class00 {
/* .class00 {
min-height: 35rem; min-height: 35rem;
}
} */
.class03 { .class03 {
min-height: 45rem; min-height: 45rem;
@ -2576,68 +2682,66 @@ defineExpose({
transition: all 0.3s ease; transition: all 0.3s ease;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
}
&::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 2px;
background: linear-gradient(90deg, #00d4ff, #0099ff, #00d4ff);
opacity: 0.8;
}
.conclusion-item::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 2px;
background: linear-gradient(90deg, #00d4ff, #0099ff, #00d4ff);
opacity: 0.8;
}
.conclusion-item:last-child {
margin-bottom: 0;
}
.conclusion-item .conclusion-title {
color: #FFD700;
font-size: 22px;
font-weight: bold;
margin: 0 0 15px 0;
text-align: center;
letter-spacing: 2px;
}
&:last-child {
margin-bottom: 0;
}
.conclusion-item .conclusion-title::after {
content: '';
position: absolute;
bottom: -5px;
left: 50%;
transform: translateX(-50%);
width: 60px;
height: 2px;
background: linear-gradient(90deg, transparent, #00d4ff, transparent);
}
.conclusion-title {
color: #FFD700;
font-size: 22px;
font-weight: bold;
margin: 0 0 15px 0;
text-align: center;
letter-spacing: 2px;
&::after {
content: '';
position: absolute;
bottom: -5px;
left: 50%;
transform: translateX(-50%);
width: 60px;
height: 2px;
background: linear-gradient(90deg, transparent, #00d4ff, transparent);
}
}
.conclusion-item .conclusion-text {
color: #ffffff;
font-size: 20px;
line-height: 1.8;
margin: 0 0 12px 0;
text-align: left;
word-wrap: break-word;
padding-left: 15px;
position: relative;
}
.conclusion-text {
color: #ffffff;
font-size: 20px;
line-height: 1.8;
margin: 0 0 12px 0;
text-align: left;
word-wrap: break-word;
padding-left: 15px;
position: relative;
&::before {
content: '▶';
position: absolute;
left: 0;
top: 0;
color: #00d4ff;
font-size: 12px;
opacity: 0.7;
}
.conclusion-item .conclusion-text::before {
content: '▶';
position: absolute;
left: 0;
top: 0;
color: #00d4ff;
font-size: 12px;
opacity: 0.7;
}
&:last-child {
margin-bottom: 0;
}
}
.conclusion-item .conclusion-text:last-child {
margin-bottom: 0;
} }
} }
@ -2647,29 +2751,27 @@ defineExpose({
border-radius: 12px; border-radius: 12px;
background: rgba(255, 255, 255, 0.05); background: rgba(255, 255, 255, 0.05);
border: 1px dashed rgba(153, 153, 153, 0.3); border: 1px dashed rgba(153, 153, 153, 0.3);
}
p {
color: #999999;
font-size: 16px;
margin: 0;
font-style: italic;
}
.conclusion-placeholder p {
color: #999999;
font-size: 16px;
margin: 0;
font-style: italic;
} }
.disclaimer-item { .disclaimer-item {
margin-top: 30px;
/* margin-top: 30px; */
padding: 20px; padding: 20px;
border-top: 1px solid rgba(153, 153, 153, 0.2); border-top: 1px solid rgba(153, 153, 153, 0.2);
text-align: center; text-align: center;
}
p.disclaimer-text {
color: #ffffff !important;
font-size: 14px;
margin: 0;
font-style: italic;
opacity: 0.8;
letter-spacing: 1px;
}
.disclaimer-item p {
color: #ffffff !important;
font-size: 16px;
margin: 0;
letter-spacing: 1px;
} }
} }
@ -2817,9 +2919,9 @@ defineExpose({
} }
/* 调整图表容器高度适配超小屏幕 */ /* 调整图表容器高度适配超小屏幕 */
.class00 {
/* .class00 {
min-height: 25rem; min-height: 25rem;
}
} */
.class03 { .class03 {
min-height: 35rem; min-height: 35rem;

12
src/views/homePage.vue

@ -154,6 +154,8 @@ const messages = ref([]);
const isLoading = computed(() => { const isLoading = computed(() => {
chatStore.isLoading; chatStore.isLoading;
}); });
//
const isInputDisabled = ref(false);
// //
const updateMessage = (title) => { const updateMessage = (title) => {
@ -178,8 +180,13 @@ const sendMessage = async () => {
// AiEmotion // AiEmotion
if (activeTab.value === "AiEmotion") { if (activeTab.value === "AiEmotion") {
//
isInputDisabled.value = true;
// AiEmotion handleSendMessage // AiEmotion handleSendMessage
aiEmotionRef.value?.handleSendMessage(message.value);
aiEmotionRef.value?.handleSendMessage(message.value, () => {
//
isInputDisabled.value = false;
});
message.value = ""; // message.value = ""; //
return; return;
} }
@ -672,7 +679,8 @@ onUnmounted(() => {
:autosize="{ minRows: 1, maxRows: 4 }" :autosize="{ minRows: 1, maxRows: 4 }"
placeholder="请输入股票名称或股票代码..." placeholder="请输入股票名称或股票代码..."
class="msg-input" class="msg-input"
@keydown.enter.exact.prevent="isLoading ? null : sendMessage()"
@keydown.enter.exact.prevent="(isLoading || isInputDisabled) ? null : sendMessage()"
:disabled="isInputDisabled"
resize="none" resize="none"
> >
</el-input> </el-input>

4
vite.config.js

@ -38,10 +38,6 @@ export default defineConfig(({ command, mode }) => {
preprocessorOptions: { preprocessorOptions: {
scss: { scss: {
charset: false, // 避免出现: build时的 @charset 必须在第一行的警告 charset: false, // 避免出现: build时的 @charset 必须在第一行的警告
additionalData: `
@import "@/styles/mixin.scss";
@import "@/styles/variables.scss";
`,
}, },
}, },
}, },

Loading…
Cancel
Save