feat: 泡泡玛特增加年度、半年数据区分

This commit is contained in:
2026-08-30 14:49:27 +08:00
parent d010b107aa
commit d51890a450
69 changed files with 1109 additions and 258 deletions
+5 -3
View File
@@ -79,13 +79,15 @@ export function renderCards(container, charts, activeViews, { onExport, onSelect
if (viewNames.length > 1) {
const switcher = element('div', 'view-switcher');
const labels = { annual: '年度', halfyear: '半年', quarter: '季度' };
const labels = { all: '全部', annual: '年度', halfyear: '半年', quarter: '季度' };
viewNames.forEach((view) => {
switcher.append(button(labels[view] || view, {
const viewButton = button(labels[view] || view, {
active: view === activeView,
onClick: () => onSelectView(chart, view),
className: 'view-button',
}));
});
viewButton.dataset.view = view;
switcher.append(viewButton);
});
bar.append(switcher);
}