fix(仪表板): 仪表板编辑设置视图自定义颜色时,关闭视图设置面板重新打开自定义颜色值显示还是最初的值

This commit is contained in:
wangjiahao 2022-07-04 11:33:40 +08:00
parent 044c07d09e
commit 86efdf6e7c
3 changed files with 12 additions and 44 deletions

View File

@ -858,6 +858,9 @@ export default {
this.sourceCustomStyleStr = this.chart.customStyle
if (this.componentViewsData[this.chart.id]) {
this.componentViewsData[this.chart.id]['title'] = this.chart.title
if (param.refreshProp) {
this.componentViewsData[this.chart.id][param.refreshProp] = this.chart[param.refreshProp]
}
}
this.mergeScale()
}

View File

@ -311,6 +311,8 @@ export default {
this.$emit('onColorChange', this.colorForm)
this.colorForm['modifyName'] = 'colors'
this.$emit('onColorChange', this.colorForm)
this.colorForm['modifyName'] = 'seriesColors'
this.$emit('onColorChange', this.colorForm)
},
resetCustomColor() {
this.changeColorOption()

View File

@ -1663,47 +1663,6 @@ export default {
delete view.data
return view
},
// calcData(getData, trigger, needRefreshGroup = false, switchType = false) {
// this.hasEdit = true
// const view = this.buildParam(getData, trigger, needRefreshGroup, switchType)
// if (!view) return
// post('/chart/view/calcData/' + this.panelInfo.id, {
// view: view,
// requestList: {
// filter: [],
// drill: this.drillClickDimensionList
// }
// }).then(response => {
// const view = JSON.parse(JSON.stringify(response.data))
// this.view.xaxis = view.xaxis ? JSON.parse(view.xaxis) : []
// this.view.xaxisExt = view.xaxisExt ? JSON.parse(view.xaxisExt) : []
// this.view.yaxis = view.yaxis ? JSON.parse(view.yaxis) : []
// this.view.yaxisExt = view.yaxisExt ? JSON.parse(view.yaxisExt) : []
// this.view.extStack = view.extStack ? JSON.parse(view.extStack) : []
// this.view.drillFields = view.drillFields ? JSON.parse(view.drillFields) : []
// this.view.extBubble = view.extBubble ? JSON.parse(view.extBubble) : []
// this.view.customAttr = view.customAttr ? JSON.parse(view.customAttr) : {}
// this.view.customStyle = view.customStyle ? JSON.parse(view.customStyle) : {}
// this.view.customFilter = view.customFilter ? JSON.parse(view.customFilter) : {}
// this.view.senior = view.senior ? JSON.parse(view.senior) : {}
// echart
// this.chart = response.data
// this.data = response.data.data
// this.httpRequest.status = true
// if (this.chart.privileges) {
// this.param.privileges = this.chart.privileges
// }
// if (!response.data.drill) {
// this.drillClickDimensionList.splice(this.drillClickDimensionList.length - 1, 1)
//
// this.resetDrill()
// }
// this.drill = response.data.drill
// this.drillFilters = JSON.parse(JSON.stringify(response.data.drillFilters ? response.data.drillFilters : []))
//
// this.closeChangeChart()
// })
// },
calcData(getData, trigger, needRefreshGroup = false, switchType = false) {
this.changeEditStatus(true)
const view = this.buildParam(true, 'chart', false, switchType)
@ -1713,7 +1672,7 @@ export default {
bus.$emit('view-in-cache', { type: 'propChange', viewId: this.param.id })
})
},
calcStyle() {
calcStyle(modifyName) {
this.changeEditStatus(true)
// echart...
const view = JSON.parse(JSON.stringify(this.view))
@ -1739,7 +1698,11 @@ export default {
if (!viewSave) return
viewEditSave(this.panelInfo.id, viewSave)
bus.$emit('view-in-cache', { type: 'styleChange', viewId: this.param.id, viewInfo: view })
if (modifyName === 'color') {
bus.$emit('view-in-cache', { type: 'styleChange', viewId: this.param.id, viewInfo: view, refreshProp: 'customAttr' })
} else {
bus.$emit('view-in-cache', { type: 'styleChange', viewId: this.param.id, viewInfo: view })
}
},
closeEdit() {
@ -1900,7 +1863,7 @@ export default {
onColorChange(val) {
this.view.customAttr.color = val
this.calcStyle()
this.calcStyle('color')
},
onSizeChange(val) {