feat(视图): 视图编辑调整

This commit is contained in:
junjie 2021-03-18 10:08:12 +08:00
parent 6440804d93
commit d50fbd21ca
3 changed files with 10 additions and 4 deletions

View File

@ -52,8 +52,9 @@ export default {
// console.log(chart_option);
// shape attr
if (chart.customAttr) {
if (chart.customAttr.color) {
chart_option.color = chart.customAttr.color.colors
const customAttr = JSON.parse(chart.customAttr)
if (customAttr.color) {
chart_option.color = customAttr.color.colors
}
}
this.myEcharts(chart_option)

View File

@ -94,7 +94,12 @@ export default {
'chart': {
handler: function() {
const chart = JSON.parse(JSON.stringify(this.chart))
this.colorForm.colorCase = chart.customAttr.color.value
if (chart.customAttr) {
const customAttr = JSON.parse(chart.customAttr)
if (customAttr.color) {
this.colorForm.colorCase = customAttr.color.value
}
}
}
}
},

View File

@ -264,7 +264,7 @@ export default {
getData(id) {
if (id) {
post('/chart/view/getData/' + id, null).then(response => {
this.view = response.data
this.view = JSON.parse(JSON.stringify(response.data))
this.view.xaxis = this.view.xaxis ? JSON.parse(this.view.xaxis) : []
this.view.yaxis = this.view.yaxis ? JSON.parse(this.view.yaxis) : []
this.view.customAttr = this.view.customAttr ? JSON.parse(this.view.customAttr) : {}