提交 d50fbd21 authored 作者: junjie's avatar junjie

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

上级 6440804d
...@@ -52,8 +52,9 @@ export default { ...@@ -52,8 +52,9 @@ export default {
// console.log(chart_option); // console.log(chart_option);
// 处理shape attr // 处理shape attr
if (chart.customAttr) { if (chart.customAttr) {
if (chart.customAttr.color) { const customAttr = JSON.parse(chart.customAttr)
chart_option.color = chart.customAttr.color.colors if (customAttr.color) {
chart_option.color = customAttr.color.colors
} }
} }
this.myEcharts(chart_option) this.myEcharts(chart_option)
......
...@@ -94,7 +94,12 @@ export default { ...@@ -94,7 +94,12 @@ export default {
'chart': { 'chart': {
handler: function() { handler: function() {
const chart = JSON.parse(JSON.stringify(this.chart)) 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
}
}
} }
} }
}, },
......
...@@ -264,7 +264,7 @@ export default { ...@@ -264,7 +264,7 @@ export default {
getData(id) { getData(id) {
if (id) { if (id) {
post('/chart/view/getData/' + id, null).then(response => { 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.xaxis = this.view.xaxis ? JSON.parse(this.view.xaxis) : []
this.view.yaxis = this.view.yaxis ? JSON.parse(this.view.yaxis) : [] this.view.yaxis = this.view.yaxis ? JSON.parse(this.view.yaxis) : []
this.view.customAttr = this.view.customAttr ? JSON.parse(this.view.customAttr) : {} this.view.customAttr = this.view.customAttr ? JSON.parse(this.view.customAttr) : {}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论