提交 05ab2d57 authored 作者: junjie's avatar junjie

refactor: 视图样式优化

上级 5da8de33
...@@ -148,6 +148,16 @@ export default { ...@@ -148,6 +148,16 @@ export default {
watch: { watch: {
'chart': { 'chart': {
handler: function() { handler: function() {
this.initData()
}
}
},
mounted() {
this.init()
this.initData()
},
methods: {
initData() {
const chart = JSON.parse(JSON.stringify(this.chart)) const chart = JSON.parse(JSON.stringify(this.chart))
if (chart.customStyle) { if (chart.customStyle) {
let customStyle = null let customStyle = null
...@@ -160,13 +170,7 @@ export default { ...@@ -160,13 +170,7 @@ export default {
this.legendForm = customStyle.legend this.legendForm = customStyle.legend
} }
} }
}
}
},
mounted() {
this.init()
}, },
methods: {
init() { init() {
const arr = [] const arr = []
for (let i = 10; i <= 60; i = i + 2) { for (let i = 10; i <= 60; i = i + 2) {
......
...@@ -122,6 +122,16 @@ export default { ...@@ -122,6 +122,16 @@ export default {
watch: { watch: {
'chart': { 'chart': {
handler: function() { handler: function() {
this.initData()
}
}
},
mounted() {
this.init()
this.initData()
},
methods: {
initData() {
const chart = JSON.parse(JSON.stringify(this.chart)) const chart = JSON.parse(JSON.stringify(this.chart))
if (chart.customStyle) { if (chart.customStyle) {
let customStyle = null let customStyle = null
...@@ -136,13 +146,7 @@ export default { ...@@ -136,13 +146,7 @@ export default {
this.splitForm = JSON.parse(JSON.stringify(DEFAULT_SPLIT)) this.splitForm = JSON.parse(JSON.stringify(DEFAULT_SPLIT))
} }
} }
}
}
},
mounted() {
this.init()
}, },
methods: {
init() { init() {
const arr = [] const arr = []
for (let i = 6; i <= 40; i = i + 2) { for (let i = 6; i <= 40; i = i + 2) {
......
...@@ -136,6 +136,16 @@ export default { ...@@ -136,6 +136,16 @@ export default {
watch: { watch: {
'chart': { 'chart': {
handler: function() { handler: function() {
this.initData()
}
}
},
mounted() {
this.init()
this.initData()
},
methods: {
initData() {
const chart = JSON.parse(JSON.stringify(this.chart)) const chart = JSON.parse(JSON.stringify(this.chart))
if (chart.customStyle) { if (chart.customStyle) {
let customStyle = null let customStyle = null
...@@ -149,13 +159,7 @@ export default { ...@@ -149,13 +159,7 @@ export default {
} }
this.titleForm.title = this.chart.title this.titleForm.title = this.chart.title
} }
}
}
},
mounted() {
this.init()
}, },
methods: {
init() { init() {
const arr = [] const arr = []
for (let i = 10; i <= 60; i = i + 2) { for (let i = 10; i <= 60; i = i + 2) {
......
...@@ -178,6 +178,16 @@ export default { ...@@ -178,6 +178,16 @@ export default {
watch: { watch: {
'chart': { 'chart': {
handler: function() { handler: function() {
this.initData()
}
}
},
mounted() {
this.init()
this.initData()
},
methods: {
initData() {
const chart = JSON.parse(JSON.stringify(this.chart)) const chart = JSON.parse(JSON.stringify(this.chart))
if (chart.customStyle) { if (chart.customStyle) {
let customStyle = null let customStyle = null
...@@ -196,13 +206,7 @@ export default { ...@@ -196,13 +206,7 @@ export default {
} }
} }
} }
}
}
},
mounted() {
this.init()
}, },
methods: {
init() { init() {
const arr = [] const arr = []
for (let i = 6; i <= 40; i = i + 2) { for (let i = 6; i <= 40; i = i + 2) {
......
...@@ -178,6 +178,16 @@ export default { ...@@ -178,6 +178,16 @@ export default {
watch: { watch: {
'chart': { 'chart': {
handler: function() { handler: function() {
this.initData()
}
}
},
mounted() {
this.init()
this.initData()
},
methods: {
initData() {
const chart = JSON.parse(JSON.stringify(this.chart)) const chart = JSON.parse(JSON.stringify(this.chart))
if (chart.customStyle) { if (chart.customStyle) {
let customStyle = null let customStyle = null
...@@ -196,13 +206,7 @@ export default { ...@@ -196,13 +206,7 @@ export default {
} }
} }
} }
}
}
},
mounted() {
this.init()
}, },
methods: {
init() { init() {
const arr = [] const arr = []
for (let i = 6; i <= 40; i = i + 2) { for (let i = 6; i <= 40; i = i + 2) {
......
...@@ -177,6 +177,16 @@ export default { ...@@ -177,6 +177,16 @@ export default {
watch: { watch: {
'chart': { 'chart': {
handler: function() { handler: function() {
this.initData()
}
}
},
mounted() {
this.init()
this.initData()
},
methods: {
initData() {
const chart = JSON.parse(JSON.stringify(this.chart)) const chart = JSON.parse(JSON.stringify(this.chart))
if (chart.customAttr) { if (chart.customAttr) {
let customAttr = null let customAttr = null
...@@ -192,13 +202,7 @@ export default { ...@@ -192,13 +202,7 @@ export default {
} }
} }
} }
}
}
},
mounted() {
this.init()
}, },
methods: {
init() { init() {
const arr = [] const arr = []
for (let i = 10; i <= 20; i = i + 2) { for (let i = 10; i <= 20; i = i + 2) {
......
...@@ -317,6 +317,16 @@ export default { ...@@ -317,6 +317,16 @@ export default {
watch: { watch: {
'chart': { 'chart': {
handler: function() { handler: function() {
this.initData()
}
}
},
mounted() {
this.init()
this.initData()
},
methods: {
initData() {
const chart = JSON.parse(JSON.stringify(this.chart)) const chart = JSON.parse(JSON.stringify(this.chart))
if (chart.customAttr) { if (chart.customAttr) {
let customAttr = null let customAttr = null
...@@ -329,13 +339,7 @@ export default { ...@@ -329,13 +339,7 @@ export default {
this.sizeForm = customAttr.size this.sizeForm = customAttr.size
} }
} }
}
}
},
mounted() {
this.init()
}, },
methods: {
init() { init() {
const arr = [] const arr = []
for (let i = 10; i <= 60; i = i + 2) { for (let i = 10; i <= 60; i = i + 2) {
......
...@@ -144,6 +144,16 @@ export default { ...@@ -144,6 +144,16 @@ export default {
watch: { watch: {
'chart': { 'chart': {
handler: function() { handler: function() {
this.initData()
}
}
},
mounted() {
this.init()
this.initData()
},
methods: {
initData() {
const chart = JSON.parse(JSON.stringify(this.chart)) const chart = JSON.parse(JSON.stringify(this.chart))
if (chart.customAttr) { if (chart.customAttr) {
let customAttr = null let customAttr = null
...@@ -156,13 +166,7 @@ export default { ...@@ -156,13 +166,7 @@ export default {
this.tooltipForm = customAttr.tooltip this.tooltipForm = customAttr.tooltip
} }
} }
}
}
},
mounted() {
this.init()
}, },
methods: {
init() { init() {
const arr = [] const arr = []
for (let i = 10; i <= 20; i = i + 2) { for (let i = 10; i <= 20; i = i + 2) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论