Browse Source

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

songjie/feature-20250628160649-上线前优化
dongqian 1 day ago
parent
commit
b07d15f112
  1. 77
      src/views/AiEmotion.vue
  2. 4
      src/views/components/emoEnergyConverter.vue

77
src/views/AiEmotion.vue

@ -1160,6 +1160,54 @@ async function fetchData(code, market, stockName, queryText) {
} }
} }
//
function hasValidData(obj) {
if (!obj || typeof obj !== 'object') {
return false;
}
//
const allowedEmptyArrays = ['lowxh', 'qixh', 'topxh'];
//
for (const key in obj) {
if (obj.hasOwnProperty(key)) {
const value = obj[key];
//
if (typeof value === 'string') {
//
if (value.trim() !== '') {
return true;
}
}
//
else if (Array.isArray(value)) {
//
if (value.length > 0) {
return true;
}
}
// 0
else if (typeof value === 'number' && value !== 0) {
return true;
}
// true
else if (typeof value === 'boolean' && value === true) {
return true;
}
//
else if (typeof value === 'object' && value !== null) {
if (hasValidData(value)) {
return true;
}
}
}
}
return false;
}
// //
function renderCharts(data) { function renderCharts(data) {
console.log('开始渲染图表,数据:', data); console.log('开始渲染图表,数据:', data);
@ -1172,10 +1220,17 @@ function renderCharts(data) {
marketTemperature: !!(clonedData.GSWDJ && clonedData.GSWDJ.length > 0), marketTemperature: !!(clonedData.GSWDJ && clonedData.GSWDJ.length > 0),
emotionDecod: !!(clonedData.QXJMQ && clonedData.QXJMQ.length > 0), emotionDecod: !!(clonedData.QXJMQ && clonedData.QXJMQ.length > 0),
emotionalBottomRadar: !!(clonedData.QXTDLD && clonedData.QXTDLD.length > 0), emotionalBottomRadar: !!(clonedData.QXTDLD && clonedData.QXTDLD.length > 0),
emoEnergyConverter: !!(clonedData.QXNLZHQ && clonedData.QXNLZHQ.length > 0)
emoEnergyConverter: !!(clonedData.QXNLZHQ && (Array.isArray(clonedData.QXNLZHQ) ? clonedData.QXNLZHQ.length > 0 : hasValidData(clonedData.QXNLZHQ)))
}; };
console.log('图表显示状态:', chartVisibility.value); console.log('图表显示状态:', chartVisibility.value);
console.log('数据检查:', {
GSWDJ: !!(clonedData.GSWDJ && clonedData.GSWDJ.length > 0),
QXJMQ: !!(clonedData.QXJMQ && clonedData.QXJMQ.length > 0),
QXTDLD: !!(clonedData.QXTDLD && clonedData.QXTDLD.length > 0),
QXNLZHQ: !!(clonedData.QXNLZHQ && (Array.isArray(clonedData.QXNLZHQ) ? clonedData.QXNLZHQ.length > 0 : hasValidData(clonedData.QXNLZHQ)))
});
console.log('QXNLZHQ数据详情:', clonedData.QXNLZHQ);
nextTick(() => { nextTick(() => {
// DOM // DOM
@ -1188,6 +1243,26 @@ function renderCharts(data) {
emoEnergyConverterRef: !!emoEnergyConverterRef.value emoEnergyConverterRef: !!emoEnergyConverterRef.value
}); });
// DOM
console.log('DOM元素检查:', {
marketTemperatureDOM: !!document.querySelector('.class03'),
emotionDecodDOM: !!document.querySelector('.class04'),
emotionalBottomRadarDOM: !!document.querySelector('.class05'),
emoEnergyConverterDOM: !!document.querySelector('.class06')
});
//
const emoEnergyElement = document.querySelector('emo-energy-converter');
console.log('emoEnergyConverter元素:', emoEnergyElement);
// ref
setTimeout(() => {
console.log('延迟检查emoEnergyConverterRef:', !!emoEnergyConverterRef.value);
if (emoEnergyConverterRef.value) {
console.log('emoEnergyConverter方法:', typeof emoEnergyConverterRef.value.initQXNLZHEcharts);
}
}, 1000);
// //
if (marketTemperatureRef.value && chartVisibility.value.marketTemperature) { if (marketTemperatureRef.value && chartVisibility.value.marketTemperature) {
console.log('开始渲染股市温度计图表'); console.log('开始渲染股市温度计图表');

4
src/views/components/emoEnergyConverter.vue

@ -632,11 +632,11 @@ const lastLow = lastKLine.value[3]; // 最低价
} }
], ],
grid: { grid: {
left: "7%",
left: "10%",
right: "10", right: "10",
top: '10', top: '10',
bottom: "60", bottom: "60",
containLabel: true,
containLabel: false,
width: '85%', width: '85%',
height: 'auto', height: 'auto',
overflow: 'hidden' overflow: 'hidden'

Loading…
Cancel
Save