fix: avoid mutating chart state during export (#18401)

This commit is contained in:
Carson
2026-05-15 15:43:39 +08:00
committed by GitHub
parent 1eb48fd31d
commit 40c8b73067

View File

@@ -1,4 +1,4 @@
import { isNumber } from 'lodash-es'
import { cloneDeep, isNumber } from 'lodash-es'
import { DEFAULT_TITLE_STYLE } from '../editor/util/chart'
import { equalsAny, includesAny } from '../editor/util/StringUtils'
import { FeatureCollection } from '@antv/l7plot/dist/esm/plots/choropleth/types'
@@ -571,11 +571,15 @@ function getChartExcelTitle(preFix, viewTitle) {
export const exportExcelDownload = (chart, preFix, callBack?) => {
const excelName = getChartExcelTitle(preFix, chart.title)
const viewInfo = toRaw(chart)
let request: any = {
proxy: null,
dvId: chart.sceneId,
viewId: chart.id,
viewInfo: chart,
viewInfo: {
...viewInfo,
customAttr: cloneDeep(viewInfo.customAttr)
},
viewName: excelName,
busiFlag: chart.busiFlag,
downloadType: chart.downloadType