Merge pull request #12373 from ulleo/dev-v2

fix(图表): 修复双轴图批量修改基础样式和纵轴不生效问题
This commit is contained in:
ulleo 2024-09-23 13:43:45 +08:00 committed by GitHub
commit b04bb43253
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 48 additions and 1 deletions

View File

@ -731,7 +731,50 @@ export const dvMainStore = defineStore('dataVisualization', {
// 修改对应图表的参数 // 修改对应图表的参数
this.curBatchOptComponents.forEach(viewId => { this.curBatchOptComponents.forEach(viewId => {
const viewInfo = this.canvasViewInfo[viewId] const viewInfo = this.canvasViewInfo[viewId]
if (propertyInfo.subProp) { //针对双轴图chart-mix
if (
viewInfo.type.includes('chart-mix') &&
propertyInfo.property === 'basicStyle' &&
propertyInfo.subProp
) {
const subValue = get(propertyInfo.value, propertyInfo.subProp)
const target = viewInfo[propertyInfo.custom][propertyInfo.property]
set(target, propertyInfo.subProp, subValue)
switch (propertyInfo.subProp) {
case 'alpha':
const subAlpha = get(propertyInfo.value, 'subAlpha')
set(target, 'subAlpha', subAlpha)
break
case 'colorScheme':
const subColorScheme = get(propertyInfo.value, 'subColorScheme')
set(target, 'subColorScheme', subColorScheme)
break
case 'seriesColor':
const subSeriesColor = get(propertyInfo.value, 'subSeriesColor')
set(target, 'subSeriesColor', subSeriesColor)
break
case 'colors':
const subColors = get(propertyInfo.value, 'subColors')
set(target, 'subColors', subColors)
break
case 'lineWidth':
const leftLineWidth = get(propertyInfo.value, 'leftLineWidth')
set(target, 'leftLineWidth', leftLineWidth)
break
case 'lineSymbol':
const leftLineSymbol = get(propertyInfo.value, 'leftLineSymbol')
set(target, 'leftLineSymbol', leftLineSymbol)
break
case 'lineSymbolSize':
const leftLineSymbolSize = get(propertyInfo.value, 'leftLineSymbolSize')
set(target, 'leftLineSymbolSize', leftLineSymbolSize)
break
case 'lineSmooth':
const leftLineSmooth = get(propertyInfo.value, 'leftLineSmooth')
set(target, 'leftLineSmooth', leftLineSmooth)
break
}
} else if (propertyInfo.subProp) {
const subValue = get(propertyInfo.value, propertyInfo.subProp) const subValue = get(propertyInfo.value, propertyInfo.subProp)
const target = viewInfo[propertyInfo.custom][propertyInfo.property] const target = viewInfo[propertyInfo.custom][propertyInfo.property]
set(target, propertyInfo.subProp, subValue) set(target, propertyInfo.subProp, subValue)

View File

@ -17,6 +17,7 @@
@onTooltipChange="onTooltipChange" @onTooltipChange="onTooltipChange"
@onChangeXAxisForm="onChangeXAxisForm" @onChangeXAxisForm="onChangeXAxisForm"
@onChangeYAxisForm="onChangeYAxisForm" @onChangeYAxisForm="onChangeYAxisForm"
@onChangeYAxisExtForm="onChangeYAxisExtForm"
@onTextChange="onTextChange" @onTextChange="onTextChange"
@onLegendChange="onLegendChange" @onLegendChange="onLegendChange"
@onBackgroundChange="onBackgroundChange" @onBackgroundChange="onBackgroundChange"
@ -87,6 +88,9 @@ const onChangeXAxisForm = (val, prop) => {
const onChangeYAxisForm = (val, prop) => { const onChangeYAxisForm = (val, prop) => {
batchOptChange('customStyle', 'yAxis', val, prop) batchOptChange('customStyle', 'yAxis', val, prop)
} }
const onChangeYAxisExtForm = (val, prop) => {
batchOptChange('customStyle', 'yAxisExt', val, prop)
}
const onIndicatorChange = (val, prop) => { const onIndicatorChange = (val, prop) => {
batchOptChange('customAttr', 'indicator', val.indicatorValue, prop) batchOptChange('customAttr', 'indicator', val.indicatorValue, prop)