Merge pull request #6348 from dataease/pr@dev-v2@refactor_new-chart-tips

refactor: 首次添加图表的图标显示时机优化
This commit is contained in:
王嘉豪 2023-10-25 10:34:37 +08:00 committed by GitHub
commit 306942017f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -211,6 +211,7 @@ for (let i = 0, len = list.length; i < len; i++) {
const item = list[i]
item.style = { ...commonStyle, ...item.style }
item['commonBackground'] = deepCopy(COMMON_COMPONENT_BACKGROUND_BASE)
item['state'] = 'prepare'
list[i] = { ...commonAttr, ...item }
}

View File

@ -521,6 +521,11 @@ const calcData = (view, resetDrill = false, updateQuery = '') => {
}
}
const updateChartData = view => {
curComponent.value['state'] = 'ready'
calcData(view, true, 'updateQuery')
}
const renderChart = view => {
useEmitt().emitter.emit('renderChart-' + view.id, view)
snapshotStore.recordSnapshotCache('renderChart', view.id)
@ -1607,7 +1612,7 @@ const onRefreshChange = val => {
<el-button
type="primary"
class="result-style-button"
@click="calcData(view, true, 'updateQuery')"
@click="updateChartData(view)"
>
<span style="font-size: 12px">
{{ t('chart.update_chart_data') }}

View File

@ -497,7 +497,7 @@ const loadingFlag = computed(() => {
const chartAreaShow = computed(() => {
return (
view.value.tableId ||
(view.value.tableId && element.value['state'] === 'ready') ||
view.value.type === 'rich-text' ||
(view.value.type === 'map' && view.value.customAttr.map.id)
)