Merge pull request #12582 from dataease/pr@dev-v2@chart-show-svg-fix

fix(图表): 修复更新图表数据时,所有图表都显示svg的问题
This commit is contained in:
jianneng-fit2cloud 2024-10-09 13:01:45 +08:00 committed by GitHub
commit 148110feb9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

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

View File

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