feat: 泡泡玛特增加年度、半年数据区分
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user