提交 76523b57 authored 作者: junjie's avatar junjie

refactor: 视图样式配置项调整

上级 3f028ce0
......@@ -196,9 +196,9 @@
:options="chartGroupTreeAvailable"
:normalizer="normalizer"
:placeholder="$t('chart.select_group')"
:noChildrenText="$t('commons.treeselect.no_children_text')"
:noOptionsText="$t('commons.treeselect.no_options_text')"
:noResultsText="$t('commons.treeselect.no_results_text')"
:no-children-text="$t('commons.treeselect.no_children_text')"
:no-options-text="$t('commons.treeselect.no_options_text')"
:no-results-text="$t('commons.treeselect.no_results_text')"
/>
</el-form-item>
</el-col>
......@@ -773,6 +773,7 @@ export default {
view.customFilter = JSON.stringify([])
view.drillFields = JSON.stringify([])
view.extBubble = JSON.stringify([])
this.setChartDefaultOptions(view)
const _this = this
post('/chart/view/save', view).then(response => {
this.closeCreateChart()
......@@ -788,6 +789,33 @@ export default {
})
},
setChartDefaultOptions(view) {
const type = view.type
const attr = JSON.parse(view.customAttr)
if (type.includes('pie')) {
if (view.render === 'echarts') {
attr.label.position = 'inside'
} else {
attr.label.position = 'inner'
}
} else if (type.includes('line')) {
attr.label.position = 'top'
} else if (type.includes('treemap')) {
if (view.render === 'echarts') {
attr.label.position = 'inside'
} else {
attr.label.position = 'middle'
}
} else {
if (view.render === 'echarts') {
attr.label.position = 'inside'
} else {
attr.label.position = 'middle'
}
}
view.customAttr = JSON.stringify(attr)
},
getTable(table) {
this.table = JSON.parse(JSON.stringify(table))
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论