Browse Source

情绪大模型使用全权限;止盈线和止损线加入了白色描边;修复夺宝奇兵大模型报错只显示提示的问题,标题字体统一;情绪大模型取消自动滚动;去除解码器第三个网格的显示标签;

dev
宋杰 3 days ago
parent
commit
6aafdc50b7
  1. 7
      src/views/AIchat.vue
  2. 219
      src/views/AiEmotion.vue
  3. 40
      src/views/components/emoEnergyConverter.vue
  4. 46
      src/views/components/emotionDecod.vue

7
src/views/AIchat.vue

@ -791,8 +791,9 @@ watch(
marketList: userStore.aiGoldMarketList, marketList: userStore.aiGoldMarketList,
}); });
const HomePage = result20.data.HomePage;
const AIGoldBull = result20.data.AIGoldBull;
// 访null
const HomePage = result20.data?.HomePage || null;
const AIGoldBull = result20.data?.AIGoldBull || null;
const isLiuSe = HomePage ? true : false; const isLiuSe = HomePage ? true : false;
const isAIGoldBull = const isAIGoldBull =
@ -1787,7 +1788,7 @@ watch(
const ac44 = `${arr[2]},${arr[3]}</p>`; const ac44 = `${arr[2]},${arr[3]}</p>`;
const ac45 = `<p style="margin:0;color:#FFD700;font-weight:bold;display:flex;justify-content:center;font-size:22px">【时间维度】</p><p style="display:flex;justify-content:center;">`; const ac45 = `<p style="margin:0;color:#FFD700;font-weight:bold;display:flex;justify-content:center;font-size:22px">【时间维度】</p><p style="display:flex;justify-content:center;">`;
const ac46 = `${result23.data.shijian}</p>`; const ac46 = `${result23.data.shijian}</p>`;
const ac47 = `<p style="margin:0;color:#FADC0C;display:flex;justify-content:center;font-size:22px">【能量维度】</p><p style="display:flex;justify-content:center;">`;
const ac47 = `<p style="margin:0;color:#FADC0C;font-weight:bold;display:flex;justify-content:center;font-size:22px">【能量维度】</p><p style="display:flex;justify-content:center;">`;
const ac48 = `${result23.data.nengliang}</p>`; const ac48 = `${result23.data.nengliang}</p>`;
// const pc4 = marked( // const pc4 = marked(

219
src/views/AiEmotion.vue

@ -168,11 +168,12 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 返回顶部按钮 --> <!-- 返回顶部按钮 -->
<div class="back-to-top" @click="scrollToTop" v-show="isPageLoaded"> <div class="back-to-top" @click="scrollToTop" v-show="isPageLoaded">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 4L12 20M12 4L6 10M12 4L18 10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M12 4L12 20M12 4L6 10M12 4L18 10" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round" />
</svg> </svg>
</div> </div>
</div> </div>
@ -797,18 +798,6 @@ function startTypewriterEffect(conclusion, onComplete) {
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) {
setTimeout(() => {
scrollToBottom();
//
if (onComplete && typeof onComplete === 'function') {
onComplete();
//
currentOnCompleteCallback.value = null;
}
}, 100);
}
}, totalDelay + i * typeSpeed); }, totalDelay + i * typeSpeed);
typewriterTimers.value.push(timer); typewriterTimers.value.push(timer);
} }
@ -858,9 +847,9 @@ function playAudio(url) {
emotionAudioStore.isPlaying = true; emotionAudioStore.isPlaying = true;
console.log('开始播放场景应用语音'); console.log('开始播放场景应用语音');
// //
setTimeout(() => {
scrollToBottom();
}, 100);
// setTimeout(() => {
// scrollToBottom();
// }, 100);
}, },
onend: () => { onend: () => {
isAudioPlaying.value = false; isAudioPlaying.value = false;
@ -964,27 +953,27 @@ async function handleSendMessage(input, onComplete) {
} }
// 使 // 使
const hasPermission = userStore.brainPerssion || userStore.swordPerssion ||
userStore.pricePerssion || userStore.timePerssion ||
userStore.aibullPerssion || userStore.aiGnbullPerssion ||
userStore.airadarPerssion;
if (!hasPermission) {
const userMessage = reactive({ sender: 'user', text: input });
messages.value.push(userMessage);
const aiMessage = reactive({ sender: 'ai', text: '您当前没有可用权限,请联系客服或购买服务包。' });
messages.value.push(aiMessage);
//
isRotating.value = false;
messages.value = [...previousMessages, ...messages.value];
//
if (onComplete && typeof onComplete === 'function') {
onComplete();
//
currentOnCompleteCallback.value = null;
}
return;
}
// const hasPermission = userStore.brainPerssion || userStore.swordPerssion ||
// userStore.pricePerssion || userStore.timePerssion ||
// userStore.aibullPerssion || userStore.aiGnbullPerssion ||
// userStore.airadarPerssion;
// if (!hasPermission) {
// const userMessage = reactive({ sender: 'user', text: input });
// messages.value.push(userMessage);
// const aiMessage = reactive({ sender: 'ai', text: '' });
// messages.value.push(aiMessage);
// //
// isRotating.value = false;
// messages.value = [...previousMessages, ...messages.value];
// //
// if (onComplete && typeof onComplete === 'function') {
// onComplete();
// //
// currentOnCompleteCallback.value = null;
// }
// return;
// }
const userMessage = reactive({ sender: 'user', text: input }); const userMessage = reactive({ sender: 'user', text: input });
messages.value.push(userMessage); messages.value.push(userMessage);
@ -996,14 +985,22 @@ async function handleSendMessage(input, onComplete) {
userData: { userData: {
token: localStorage.getItem('localToken'), token: localStorage.getItem('localToken'),
language: "cn", language: "cn",
brainPrivilegeState: userStore.brainPerssion,
swordPrivilegeState: userStore.swordPerssion,
stockForecastPrivilegeState: userStore.pricePerssion,
spaceForecastPrivilegeState: userStore.timePerssion,
aibullPrivilegeState: userStore.aibullPerssion,
aigoldBullPrivilegeState: userStore.aiGnbullPerssion,
airadarPrivilegeState: userStore.airadarPerssion,
marketList: userStore.aiGoldMarketList,
// brainPrivilegeState: userStore.brainPerssion,
// swordPrivilegeState: userStore.swordPerssion,
// stockForecastPrivilegeState: userStore.pricePerssion,
// spaceForecastPrivilegeState: userStore.timePerssion,
// aibullPrivilegeState: userStore.aibullPerssion,
// aigoldBullPrivilegeState: userStore.aiGnbullPerssion,
// airadarPrivilegeState: userStore.airadarPerssion,
// marketList: userStore.aiGoldMarketList,
brainPrivilegeState: '1',
swordPrivilegeState: '1',
stockForecastPrivilegeState: '1',
spaceForecastPrivilegeState: '1',
aibullPrivilegeState: '1',
aigoldBullPrivilegeState: '1',
airadarPrivilegeState: '1',
marketList: "hk,cn,usa,my,sg,vi,in,gb",
}, },
}; };
@ -1116,7 +1113,7 @@ async function handleSendMessage(input, onComplete) {
} }
isRotating.value = false; isRotating.value = false;
messages.value = [...previousMessages, ...messages.value]; messages.value = [...previousMessages, ...messages.value];
// //
if (isPageLoaded.value && emotionStore.activeStock && emotionStore.activeStock.apiData) { if (isPageLoaded.value && emotionStore.activeStock && emotionStore.activeStock.apiData) {
nextTick(() => { nextTick(() => {
@ -1124,7 +1121,7 @@ async function handleSendMessage(input, onComplete) {
console.log('搜索失败,恢复显示之前股票的图表:', emotionStore.activeStock.stockInfo.name); console.log('搜索失败,恢复显示之前股票的图表:', emotionStore.activeStock.stockInfo.name);
}); });
} }
// //
if (onComplete && typeof onComplete === 'function') { if (onComplete && typeof onComplete === 'function') {
onComplete(); onComplete();
@ -1136,7 +1133,7 @@ async function handleSendMessage(input, onComplete) {
} catch (error) { } catch (error) {
// //
isLoading.value = false; isLoading.value = false;
// false // false
if (emotionStore.stockList.length > 0 && emotionStore.activeStock) { if (emotionStore.stockList.length > 0 && emotionStore.activeStock) {
isPageLoaded.value = true; isPageLoaded.value = true;
@ -1149,13 +1146,13 @@ async function handleSendMessage(input, onComplete) {
} else { } else {
isPageLoaded.value = false; isPageLoaded.value = false;
} }
const aiMessage = reactive({ sender: 'ai', text: '请求工作流接口失败,请检查网络连接' }); const aiMessage = reactive({ sender: 'ai', text: '请求工作流接口失败,请检查网络连接' });
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 (isPageLoaded.value && emotionStore.activeStock && emotionStore.activeStock.apiData) { if (isPageLoaded.value && emotionStore.activeStock && emotionStore.activeStock.apiData) {
nextTick(() => { nextTick(() => {
@ -1163,7 +1160,7 @@ async function handleSendMessage(input, onComplete) {
console.log('请求失败,恢复显示之前股票的图表:', emotionStore.activeStock.stockInfo.name); console.log('请求失败,恢复显示之前股票的图表:', emotionStore.activeStock.stockInfo.name);
}); });
} }
// //
if (onComplete && typeof onComplete === 'function') { if (onComplete && typeof onComplete === 'function') {
onComplete(); onComplete();
@ -1208,13 +1205,13 @@ async function fetchData(code, market, stockName, queryText) {
if (stockDataResponse.code === 200 && stockDataResponse.data) { if (stockDataResponse.code === 200 && stockDataResponse.data) {
// //
const validation = validateRequiredFields(stockDataResponse.data); const validation = validateRequiredFields(stockDataResponse.data);
// StockTabs // StockTabs
if (!validation.isValid) { if (!validation.isValid) {
console.log('API返回数据不完整,缺失字段:', validation.missingFields); console.log('API返回数据不完整,缺失字段:', validation.missingFields);
// //
isLoading.value = false; isLoading.value = false;
// false // false
if (emotionStore.stockList.length > 0 && emotionStore.activeStock) { if (emotionStore.stockList.length > 0 && emotionStore.activeStock) {
isPageLoaded.value = true; isPageLoaded.value = true;
@ -1227,15 +1224,15 @@ async function fetchData(code, market, stockName, queryText) {
} else { } else {
isPageLoaded.value = false; isPageLoaded.value = false;
} }
const aiMessage = reactive({
sender: 'ai',
text: `数据丢失了,请稍后重试。`
const aiMessage = reactive({
sender: 'ai',
text: `数据丢失了,请稍后重试。`
}); });
messages.value.push(aiMessage); messages.value.push(aiMessage);
return false; // return false; //
} }
// store // store
const stockData = { const stockData = {
queryText: queryText, queryText: queryText,
@ -1254,7 +1251,7 @@ async function fetchData(code, market, stockName, queryText) {
} else { } else {
// //
isLoading.value = false; isLoading.value = false;
// false // false
if (emotionStore.stockList.length > 0 && emotionStore.activeStock) { if (emotionStore.stockList.length > 0 && emotionStore.activeStock) {
isPageLoaded.value = true; isPageLoaded.value = true;
@ -1267,7 +1264,7 @@ async function fetchData(code, market, stockName, queryText) {
} else { } else {
isPageLoaded.value = false; isPageLoaded.value = false;
} }
const aiMessage = reactive({ sender: 'ai', text: '图表数据请求失败,请检查网络连接' }); const aiMessage = reactive({ sender: 'ai', text: '图表数据请求失败,请检查网络连接' });
messages.value.push(aiMessage); messages.value.push(aiMessage);
return false; // return false; //
@ -1275,7 +1272,7 @@ async function fetchData(code, market, stockName, queryText) {
} catch (error) { } catch (error) {
// //
isLoading.value = false; isLoading.value = false;
// false // false
if (emotionStore.stockList.length > 0 && emotionStore.activeStock) { if (emotionStore.stockList.length > 0 && emotionStore.activeStock) {
isPageLoaded.value = true; isPageLoaded.value = true;
@ -1288,7 +1285,7 @@ async function fetchData(code, market, stockName, queryText) {
} else { } else {
isPageLoaded.value = false; isPageLoaded.value = false;
} }
const aiMessage = reactive({ sender: 'ai', text: '图表数据请求失败,请检查网络连接' }); const aiMessage = reactive({ sender: 'ai', text: '图表数据请求失败,请检查网络连接' });
messages.value.push(aiMessage); messages.value.push(aiMessage);
return false; // return false; //
@ -1299,15 +1296,15 @@ async function fetchData(code, market, stockName, queryText) {
function validateRequiredFields(data) { function validateRequiredFields(data) {
const requiredFields = ['GSWDJ', 'KLine20', 'QXJMQ', 'QXTDLD', 'WDRL']; const requiredFields = ['GSWDJ', 'KLine20', 'QXJMQ', 'QXTDLD', 'WDRL'];
const missingFields = []; const missingFields = [];
for (const field of requiredFields) { for (const field of requiredFields) {
if (!data[field] ||
(Array.isArray(data[field]) && data[field].length === 0) ||
(typeof data[field] === 'object' && !hasValidData(data[field]))) {
if (!data[field] ||
(Array.isArray(data[field]) && data[field].length === 0) ||
(typeof data[field] === 'object' && !hasValidData(data[field]))) {
missingFields.push(field); missingFields.push(field);
} }
} }
return { return {
isValid: missingFields.length === 0, isValid: missingFields.length === 0,
missingFields: missingFields missingFields: missingFields
@ -1319,15 +1316,15 @@ function hasValidData(obj) {
if (!obj || typeof obj !== 'object') { if (!obj || typeof obj !== 'object') {
return false; return false;
} }
// //
const allowedEmptyArrays = ['lowxh', 'qixh', 'topxh']; const allowedEmptyArrays = ['lowxh', 'qixh', 'topxh'];
// //
for (const key in obj) { for (const key in obj) {
if (obj.hasOwnProperty(key)) { if (obj.hasOwnProperty(key)) {
const value = obj[key]; const value = obj[key];
// //
if (typeof value === 'string') { if (typeof value === 'string') {
// //
@ -1358,36 +1355,36 @@ function hasValidData(obj) {
} }
} }
} }
return false; return false;
} }
// //
function renderCharts(data) { function renderCharts(data) {
console.log('开始渲染图表,数据:', data); console.log('开始渲染图表,数据:', data);
// //
const clonedData = JSON.parse(JSON.stringify(data)); const clonedData = JSON.parse(JSON.stringify(data));
// //
const validation = validateRequiredFields(clonedData); const validation = validateRequiredFields(clonedData);
// //
if (!validation.isValid) { if (!validation.isValid) {
console.log('关键数据缺失:', validation.missingFields); console.log('关键数据缺失:', validation.missingFields);
const aiMessage = reactive({
sender: 'ai',
text: `数据不完整,缺少以下关键数据:${validation.missingFields.join('、')}。请稍后重试或联系客服。`
const aiMessage = reactive({
sender: 'ai',
text: `数据不完整,缺少以下关键数据:${validation.missingFields.join('、')}。请稍后重试或联系客服。`
}); });
messages.value.push(aiMessage); messages.value.push(aiMessage);
// //
isPageLoaded.value = false; isPageLoaded.value = false;
isLoading.value = false; isLoading.value = false;
return; // return; //
} }
// //
chartVisibility.value = { chartVisibility.value = {
marketTemperature: !!(clonedData.GSWDJ && clonedData.GSWDJ.length > 0), marketTemperature: !!(clonedData.GSWDJ && clonedData.GSWDJ.length > 0),
@ -1395,7 +1392,7 @@ function renderCharts(data) {
emotionalBottomRadar: !!(clonedData.QXTDLD && clonedData.QXTDLD.length > 0), emotionalBottomRadar: !!(clonedData.QXTDLD && clonedData.QXTDLD.length > 0),
emoEnergyConverter: !!(clonedData.QXNLZHQ && (Array.isArray(clonedData.QXNLZHQ) ? clonedData.QXNLZHQ.length > 0 : hasValidData(clonedData.QXNLZHQ))) emoEnergyConverter: !!(clonedData.QXNLZHQ && (Array.isArray(clonedData.QXNLZHQ) ? clonedData.QXNLZHQ.length > 0 : hasValidData(clonedData.QXNLZHQ)))
}; };
console.log('图表显示状态:', chartVisibility.value); console.log('图表显示状态:', chartVisibility.value);
console.log('数据检查:', { console.log('数据检查:', {
GSWDJ: !!(clonedData.GSWDJ && clonedData.GSWDJ.length > 0), GSWDJ: !!(clonedData.GSWDJ && clonedData.GSWDJ.length > 0),
@ -1404,7 +1401,7 @@ function renderCharts(data) {
QXNLZHQ: !!(clonedData.QXNLZHQ && (Array.isArray(clonedData.QXNLZHQ) ? clonedData.QXNLZHQ.length > 0 : hasValidData(clonedData.QXNLZHQ))) QXNLZHQ: !!(clonedData.QXNLZHQ && (Array.isArray(clonedData.QXNLZHQ) ? clonedData.QXNLZHQ.length > 0 : hasValidData(clonedData.QXNLZHQ)))
}); });
console.log('QXNLZHQ数据详情:', clonedData.QXNLZHQ); console.log('QXNLZHQ数据详情:', clonedData.QXNLZHQ);
nextTick(() => { nextTick(() => {
// DOM // DOM
setTimeout(() => { setTimeout(() => {
@ -1415,7 +1412,7 @@ function renderCharts(data) {
emotionalBottomRadarRef: !!emotionalBottomRadarRef.value, emotionalBottomRadarRef: !!emotionalBottomRadarRef.value,
emoEnergyConverterRef: !!emoEnergyConverterRef.value emoEnergyConverterRef: !!emoEnergyConverterRef.value
}); });
// DOM // DOM
console.log('DOM元素检查:', { console.log('DOM元素检查:', {
marketTemperatureDOM: !!document.querySelector('.class03'), marketTemperatureDOM: !!document.querySelector('.class03'),
@ -1423,11 +1420,11 @@ function renderCharts(data) {
emotionalBottomRadarDOM: !!document.querySelector('.class05'), emotionalBottomRadarDOM: !!document.querySelector('.class05'),
emoEnergyConverterDOM: !!document.querySelector('.class06') emoEnergyConverterDOM: !!document.querySelector('.class06')
}); });
// //
const emoEnergyElement = document.querySelector('emo-energy-converter'); const emoEnergyElement = document.querySelector('emo-energy-converter');
console.log('emoEnergyConverter元素:', emoEnergyElement); console.log('emoEnergyConverter元素:', emoEnergyElement);
// ref // ref
setTimeout(() => { setTimeout(() => {
console.log('延迟检查emoEnergyConverterRef:', !!emoEnergyConverterRef.value); console.log('延迟检查emoEnergyConverterRef:', !!emoEnergyConverterRef.value);
@ -1435,7 +1432,7 @@ function renderCharts(data) {
console.log('emoEnergyConverter方法:', typeof emoEnergyConverterRef.value.initQXNLZHEcharts); console.log('emoEnergyConverter方法:', typeof emoEnergyConverterRef.value.initQXNLZHEcharts);
} }
}, 1000); }, 1000);
// //
if (marketTemperatureRef.value && chartVisibility.value.marketTemperature) { if (marketTemperatureRef.value && chartVisibility.value.marketTemperature) {
console.log('开始渲染股市温度计图表'); console.log('开始渲染股市温度计图表');
@ -1453,7 +1450,7 @@ function renderCharts(data) {
} else { } else {
console.log('股市温度计图表未渲染,ref存在:', !!marketTemperatureRef.value, '数据存在:', chartVisibility.value.marketTemperature); console.log('股市温度计图表未渲染,ref存在:', !!marketTemperatureRef.value, '数据存在:', chartVisibility.value.marketTemperature);
} }
// //
if (emotionDecodRef.value && chartVisibility.value.emotionDecod) { if (emotionDecodRef.value && chartVisibility.value.emotionDecod) {
console.log('开始渲染情绪解码器图表'); console.log('开始渲染情绪解码器图表');
@ -1471,7 +1468,7 @@ function renderCharts(data) {
} else { } else {
console.log('情绪解码器图表未渲染,ref存在:', !!emotionDecodRef.value, '数据存在:', chartVisibility.value.emotionDecod); console.log('情绪解码器图表未渲染,ref存在:', !!emotionDecodRef.value, '数据存在:', chartVisibility.value.emotionDecod);
} }
// //
if (emotionalBottomRadarRef.value && chartVisibility.value.emotionalBottomRadar) { if (emotionalBottomRadarRef.value && chartVisibility.value.emotionalBottomRadar) {
console.log('开始渲染情绪探底雷达图表'); console.log('开始渲染情绪探底雷达图表');
@ -1492,7 +1489,7 @@ function renderCharts(data) {
} else { } else {
console.log('情绪探底雷达图表未渲染,ref存在:', !!emotionalBottomRadarRef.value, '数据存在:', chartVisibility.value.emotionalBottomRadar); console.log('情绪探底雷达图表未渲染,ref存在:', !!emotionalBottomRadarRef.value, '数据存在:', chartVisibility.value.emotionalBottomRadar);
} }
// //
if (emoEnergyConverterRef.value && chartVisibility.value.emoEnergyConverter) { if (emoEnergyConverterRef.value && chartVisibility.value.emoEnergyConverter) {
console.log('开始渲染情绪能量转化器图表'); console.log('开始渲染情绪能量转化器图表');
@ -1510,7 +1507,7 @@ function renderCharts(data) {
} else { } else {
console.log('情绪能量转化器图表未渲染,ref存在:', !!emoEnergyConverterRef.value, '数据存在:', chartVisibility.value.emoEnergyConverter); console.log('情绪能量转化器图表未渲染,ref存在:', !!emoEnergyConverterRef.value, '数据存在:', chartVisibility.value.emoEnergyConverter);
} }
console.log('图表渲染完成'); console.log('图表渲染完成');
} catch (error) { } catch (error) {
console.error('图表渲染错误:', error); console.error('图表渲染错误:', error);
@ -1521,21 +1518,21 @@ function renderCharts(data) {
}); });
} }
const scrollToBottom = async () => {
//
if (isUserScrolling.value) {
console.log('用户正在手动滚动,跳过自动滚动');
return;
}
// const scrollToBottom = async () => {
// //
// if (isUserScrolling.value) {
// console.log('');
// return;
// }
const container = userInputDisplayRef.value;
if (!container) return;
await nextTick();
console.log(container.scrollHeight, "container.scrollHeight");
console.log(container.scrollTop, "container.scrollTop");
console.log(container.offsetHeight, "container.offsetHeight");
container.scrollTop = container.scrollHeight - container.offsetHeight;
};
// const container = userInputDisplayRef.value;
// if (!container) return;
// await nextTick();
// console.log(container.scrollHeight, "container.scrollHeight");
// console.log(container.scrollTop, "container.scrollTop");
// console.log(container.offsetHeight, "container.offsetHeight");
// container.scrollTop = container.scrollHeight - container.offsetHeight;
// };
// //
const handleUserScroll = () => { const handleUserScroll = () => {
@ -1704,7 +1701,7 @@ function triggerAutoScroll() {
const scrollToTop = () => { const scrollToTop = () => {
const topAnchor = document.getElementById('top-anchor'); const topAnchor = document.getElementById('top-anchor');
if (topAnchor) { if (topAnchor) {
topAnchor.scrollIntoView({
topAnchor.scrollIntoView({
behavior: 'smooth', behavior: 'smooth',
block: 'start', block: 'start',
inline: 'nearest' inline: 'nearest'
@ -1712,7 +1709,7 @@ const scrollToTop = () => {
} else { } else {
window.scrollTo({ top: 0, behavior: 'smooth' }); window.scrollTo({ top: 0, behavior: 'smooth' });
} }
// //
setTimeout(() => { setTimeout(() => {
const currentScrollTop = window.pageYOffset || document.documentElement.scrollTop; const currentScrollTop = window.pageYOffset || document.documentElement.scrollTop;
@ -1816,7 +1813,7 @@ onMounted(async () => {
// //
window.addEventListener('scroll', handlePageScroll, { passive: true }); window.addEventListener('scroll', handlePageScroll, { passive: true });
// document // document
document.addEventListener('scroll', handlePageScroll, { passive: true }); document.addEventListener('scroll', handlePageScroll, { passive: true });
@ -1876,13 +1873,13 @@ onMounted(async () => {
// observer // observer
onUnmounted(() => { onUnmounted(() => {
clearTypewriterTimers(); clearTypewriterTimers();
// //
if (currentOnCompleteCallback.value && typeof currentOnCompleteCallback.value === 'function') { if (currentOnCompleteCallback.value && typeof currentOnCompleteCallback.value === 'function') {
currentOnCompleteCallback.value(); currentOnCompleteCallback.value();
currentOnCompleteCallback.value = null; currentOnCompleteCallback.value = null;
} }
stopAudio(); stopAudio();
// //
@ -3362,7 +3359,7 @@ defineExpose({
width: 40px !important; width: 40px !important;
height: 40px !important; height: 40px !important;
} }
.back-to-top svg { .back-to-top svg {
width: 20px; width: 20px;
height: 20px; height: 20px;

40
src/views/components/emoEnergyConverter.vue

@ -524,17 +524,34 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
z: 2 z: 2
}, },
{ {
name: '止盈线描边',
type: 'line',
data: takeProfitData,
symbol: 'none',
lineStyle: {
normal: {
color: '#ffffff', //
width: 6,
type: 'solid'
}
},
z: 1,
silent: true,
showInLegend: false
},
{
name: '止盈线', name: '止盈线',
type: 'line', type: 'line',
data: takeProfitData, data: takeProfitData,
symbol: 'none', symbol: 'none',
lineStyle: { lineStyle: {
normal: { normal: {
color: '#FF0000', //
color: '#FF0000', //
width: 2, width: 2,
type: 'solid' type: 'solid'
} }
}, },
z: 2,
markPoint: { markPoint: {
symbol: 'circle', symbol: 'circle',
symbolSize: 1, symbolSize: 1,
@ -564,6 +581,22 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
} }
}, },
{ {
name: '止损线描边',
type: 'line',
data: stopLossData,
symbol: 'none',
lineStyle: {
normal: {
color: '#ffffff', //
width: 6,
type: 'solid'
}
},
z: 1,
silent: true,
showInLegend: false
},
{
name: '止损线', name: '止损线',
type: 'line', type: 'line',
data: stopLossData, data: stopLossData,
@ -575,6 +608,7 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
type: 'solid' type: 'solid'
} }
}, },
z: 2,
markPoint: { markPoint: {
symbol: 'circle', symbol: 'circle',
symbolSize: 1, symbolSize: 1,
@ -636,7 +670,7 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
textBorderWidth: 2, textBorderWidth: 2,
} }
}, },
offset: [0, -30]
offset: [-25, -40]
} }
} }
} }
@ -676,7 +710,7 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
textBorderWidth: 2, textBorderWidth: 2,
} }
}, },
offset: [0, 30]
offset: [-25, 40]
} }
} }
} }

46
src/views/components/emotionDecod.vue

@ -154,6 +154,13 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
gridIndex: 2, gridIndex: 2,
data: dealData.categoryData, data: dealData.categoryData,
axisLine: { lineStyle: { color: "white" } }, axisLine: { lineStyle: { color: "white" } },
axisPointer: {
show: false,
label: {
show: false,
},
type: "line",
},
}, },
], ],
yAxis: [ yAxis: [
@ -224,6 +231,13 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
}, },
axisTick: { show: false }, // 线 axisTick: { show: false }, // 线
axisLabel: { show: false }, // axisLabel: { show: false }, //
axisPointer: {
show: false,
label: {
show: false,
},
type: "line",
},
}, },
], ],
// //
@ -289,11 +303,11 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
tooltip: { tooltip: {
trigger: "item", trigger: "item",
axisPointer: { axisPointer: {
type: 'cross', //
crossStyle: {
color: '#999'
}
},
type: 'cross', //
crossStyle: {
color: '#999'
}
},
// tooltip // tooltip
formatter: function (params) { formatter: function (params) {
return `${params.value[2]}`; // 3 return `${params.value[2]}`; // 3
@ -355,7 +369,7 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
// echarts // echarts
KlineCanvsChart = echarts.init(KlineCanvs.value); KlineCanvsChart = echarts.init(KlineCanvs.value);
KlineCanvsChart.setOption(KlineOption); KlineCanvsChart.setOption(KlineOption);
// resize // resize
const debounce = (func, wait) => { const debounce = (func, wait) => {
let timeout; let timeout;
@ -368,7 +382,7 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
timeout = setTimeout(later, wait); timeout = setTimeout(later, wait);
}; };
}; };
// //
const resizeHandler = debounce(() => { const resizeHandler = debounce(() => {
if (KlineCanvsChart && !KlineCanvsChart.isDisposed()) { if (KlineCanvsChart && !KlineCanvsChart.isDisposed()) {
@ -380,18 +394,18 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
} }
} }
}, 100); // 100ms }, 100); // 100ms
// //
if (window.emotionDecodResizeHandler) { if (window.emotionDecodResizeHandler) {
window.removeEventListener('resize', window.emotionDecodResizeHandler); window.removeEventListener('resize', window.emotionDecodResizeHandler);
} }
// //
window.addEventListener('resize', resizeHandler); window.addEventListener('resize', resizeHandler);
// resize便 // resize便
window.emotionDecodResizeHandler = resizeHandler; window.emotionDecodResizeHandler = resizeHandler;
// //
if (KlineCanvs.value && window.ResizeObserver) { if (KlineCanvs.value && window.ResizeObserver) {
const containerObserver = new ResizeObserver(debounce(() => { const containerObserver = new ResizeObserver(debounce(() => {
@ -404,7 +418,7 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
} }
} }
}, 100)); }, 100));
containerObserver.observe(KlineCanvs.value); containerObserver.observe(KlineCanvs.value);
window.emotionDecodContainerObserver = containerObserver; window.emotionDecodContainerObserver = containerObserver;
} }
@ -428,19 +442,19 @@ onBeforeUnmount(() => {
KlineCanvsChart.dispose(); KlineCanvsChart.dispose();
KlineCanvsChart = null; KlineCanvsChart = null;
} }
// resize // resize
if (window.emotionDecodResizeHandler) { if (window.emotionDecodResizeHandler) {
window.removeEventListener('resize', window.emotionDecodResizeHandler); window.removeEventListener('resize', window.emotionDecodResizeHandler);
window.emotionDecodResizeHandler = null; window.emotionDecodResizeHandler = null;
} }
// //
if (window.emotionDecodHeightHandler) { if (window.emotionDecodHeightHandler) {
window.removeEventListener('resize', window.emotionDecodHeightHandler); window.removeEventListener('resize', window.emotionDecodHeightHandler);
window.emotionDecodHeightHandler = null; window.emotionDecodHeightHandler = null;
} }
// //
if (window.emotionDecodContainerObserver) { if (window.emotionDecodContainerObserver) {
window.emotionDecodContainerObserver.disconnect(); window.emotionDecodContainerObserver.disconnect();
@ -452,7 +466,7 @@ onBeforeUnmount(() => {
.qxjmqbox { .qxjmqbox {
height: auto; height: auto;
width: 100%; width: 100%;
margin:0 auto;
margin: 0 auto;
} }
#qxjmqEcharts { #qxjmqEcharts {

Loading…
Cancel
Save