fix(仪表板): 修复因延迟执行导致的指标卡批量操作字体和名称加粗失效问题 #11543

This commit is contained in:
wangjiahao 2024-10-09 13:28:04 +08:00
parent 1e7eefa274
commit 6961b7932a
3 changed files with 15 additions and 4 deletions

View File

@ -878,7 +878,7 @@ export default {
if (!sourceCustomAttr[param.property]) {
this.$set(sourceCustomAttr, param.property, {})
}
sourceCustomAttr[param.property][param.value.modifyName] = param.value[param.value.modifyName]
Vue.set(sourceCustomAttr[param.property], param.value.modifyName, param.value[param.value.modifyName])
this.sourceCustomAttrStr = JSON.stringify(sourceCustomAttr)
this.chart.customAttr = this.sourceCustomAttrStr
this.$store.commit('updateComponentViewsData', {
@ -892,7 +892,7 @@ export default {
if (param.property === 'margin') {
sourceCustomStyle[param.property] = param.value
}
sourceCustomStyle[param.property][param.value.modifyName] = param.value[param.value.modifyName]
Vue.set(sourceCustomStyle[param.property], param.value.modifyName, param.value[param.value.modifyName])
this.sourceCustomStyleStr = JSON.stringify(sourceCustomStyle)
this.chart.customStyle = this.sourceCustomStyleStr
this.$store.commit('updateComponentViewsData', {

View File

@ -847,7 +847,7 @@ const data = {
}
},
setChangeProperties(state, propertyInfo) {
state.changeProperties[propertyInfo.custom][propertyInfo.property] = propertyInfo.value
Vue.set(state.changeProperties[propertyInfo.custom], propertyInfo.property, propertyInfo.value)
},
initCanvasBase(state) {
this.commit('resetLastValidFilters')

View File

@ -1166,6 +1166,7 @@
import { CHART_FONT_FAMILY, CHART_FONT_LETTER_SPACE, DEFAULT_SIZE } from '../../chart/chart'
import { includesAny } from '@/utils/StringUtils'
import _ from 'lodash'
import {mapState} from "vuex";
export default {
name: 'SizeSelector',
props: {
@ -1224,6 +1225,11 @@ export default {
}
}
},
computed: {
...mapState([
'batchOptStatus'
])
},
mounted() {
this.init()
this.initData()
@ -1303,13 +1309,18 @@ export default {
this.fontSize = arr
},
changeBarSizeCase(modifyName) {
this.currentModifyName = modifyName;
if (!this.doChange) {
this.doChange = _.debounce(() => this.debounceChange(modifyName), 200)
}
this.doChange()
},
debounceChange(modifyName) {
this.sizeForm['modifyName'] = modifyName
if(this.batchOptStatus){
this.sizeForm['modifyName'] = this.currentModifyName
}else{
this.sizeForm['modifyName']=modifyName
}
if (this.sizeForm.gaugeMax <= this.sizeForm.gaugeMin) {
this.$message.error(this.$t('chart.max_more_than_mix'))
return