community增加事件详情
This commit is contained in:
@@ -1443,16 +1443,23 @@ const CombinedCalendar = () => {
|
|||||||
fetch(`/data/zt/daily/${dateStr}.json`)
|
fetch(`/data/zt/daily/${dateStr}.json`)
|
||||||
.then(res => res.ok ? res.json() : null)
|
.then(res => res.ok ? res.json() : null)
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (data && data.sector_data) {
|
if (data) {
|
||||||
let maxSector = '';
|
// 优先使用词云图最高频词,fallback 到板块数据
|
||||||
let maxCount = 0;
|
let topWord = '';
|
||||||
Object.entries(data.sector_data).forEach(([sector, info]) => {
|
if (data.word_freq_data && data.word_freq_data.length > 0) {
|
||||||
if (info.count > maxCount) {
|
// word_freq_data 已按频率排序,第一个就是最高频
|
||||||
maxCount = info.count;
|
topWord = data.word_freq_data[0].name;
|
||||||
maxSector = sector;
|
} else if (data.sector_data) {
|
||||||
}
|
// fallback: 使用板块数据中最高的
|
||||||
});
|
let maxCount = 0;
|
||||||
details[dateStr] = { top_sector: maxSector, fullData: data };
|
Object.entries(data.sector_data).forEach(([sector, info]) => {
|
||||||
|
if (info.count > maxCount) {
|
||||||
|
maxCount = info.count;
|
||||||
|
topWord = sector;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
details[dateStr] = { top_sector: topWord, fullData: data };
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => null)
|
.catch(() => null)
|
||||||
|
|||||||
Reference in New Issue
Block a user