fix(图表): 存量明细表不合并单元格
This commit is contained in:
parent
4413602e67
commit
af3c22280b
@ -29,6 +29,7 @@ import { deepCopy } from '@/utils/utils'
|
|||||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||||
import { trackBarStyleCheck } from '@/utils/canvasUtils'
|
import { trackBarStyleCheck } from '@/utils/canvasUtils'
|
||||||
import { type SpreadSheet } from '@antv/s2'
|
import { type SpreadSheet } from '@antv/s2'
|
||||||
|
import { parseJson } from '../../js/util'
|
||||||
|
|
||||||
const dvMainStore = dvMainStoreWithOut()
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
const {
|
const {
|
||||||
@ -165,10 +166,19 @@ const renderChartFromDialog = (viewInfo: Chart, chartDataInfo) => {
|
|||||||
chartData.value = chartDataInfo
|
chartData.value = chartDataInfo
|
||||||
renderChart(viewInfo, false)
|
renderChart(viewInfo, false)
|
||||||
}
|
}
|
||||||
|
// 处理存量图表的默认值
|
||||||
|
const handleDefaultVal = (chart: Chart) => {
|
||||||
|
const customAttr = parseJson(chart.customAttr)
|
||||||
|
// 明细表默认合并单元格,存量的不合并
|
||||||
|
if (customAttr.tableCell.mergeCells === undefined) {
|
||||||
|
customAttr.tableCell.mergeCells = false
|
||||||
|
}
|
||||||
|
}
|
||||||
const renderChart = (viewInfo: Chart, resetPageInfo: boolean) => {
|
const renderChart = (viewInfo: Chart, resetPageInfo: boolean) => {
|
||||||
if (!viewInfo) {
|
if (!viewInfo) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
handleDefaultVal(viewInfo)
|
||||||
// view 为引用对象 需要存库 view.data 直接赋值会导致保存不必要的数据
|
// view 为引用对象 需要存库 view.data 直接赋值会导致保存不必要的数据
|
||||||
actualChart = deepCopy({
|
actualChart = deepCopy({
|
||||||
...defaultsDeep(viewInfo, cloneDeep(BASE_VIEW_CONFIG)),
|
...defaultsDeep(viewInfo, cloneDeep(BASE_VIEW_CONFIG)),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user