fix(图表): 修复更新图表数据时,所有图表都显示svg的问题

This commit is contained in:
jianneng-fit2cloud 2024-10-09 13:01:02 +08:00
parent 6a059fa5b1
commit 8ceb156014
2 changed files with 7 additions and 3 deletions

View File

@ -836,7 +836,7 @@ const calcData = (view, resetDrill = false, updateQuery = '') => {
const updateChartData = view => { const updateChartData = view => {
curComponent.value['state'] = 'ready' curComponent.value['state'] = 'ready'
useEmitt().emitter.emit('checkFieldIsAllowEmpty', allFields.value) useEmitt().emitter.emit('checkShowEmpty', { allFields: allFields.value, view: view })
calcData(view, true, 'updateQuery') calcData(view, true, 'updateQuery')
} }

View File

@ -641,8 +641,12 @@ onMounted(() => {
return return
} }
useEmitt({ useEmitt({
name: 'checkFieldIsAllowEmpty', name: 'checkShowEmpty',
callback: allField => checkFieldIsAllowEmpty(allField) callback: param => {
if (param.view?.id === view.value.id) {
checkFieldIsAllowEmpty(param.allFields)
}
}
}) })
useEmitt({ name: 'chart-type-change', callback: changeChartType }) useEmitt({ name: 'chart-type-change', callback: changeChartType })
useEmitt({ name: 'dataset-change', callback: changeDataset }) useEmitt({ name: 'dataset-change', callback: changeDataset })