forked from github/dataease
refactor: 视图样式配置项调整
This commit is contained in:
parent
3f028ce0b0
commit
76523b5787
@ -196,9 +196,9 @@
|
|||||||
:options="chartGroupTreeAvailable"
|
:options="chartGroupTreeAvailable"
|
||||||
:normalizer="normalizer"
|
:normalizer="normalizer"
|
||||||
:placeholder="$t('chart.select_group')"
|
:placeholder="$t('chart.select_group')"
|
||||||
:noChildrenText="$t('commons.treeselect.no_children_text')"
|
:no-children-text="$t('commons.treeselect.no_children_text')"
|
||||||
:noOptionsText="$t('commons.treeselect.no_options_text')"
|
:no-options-text="$t('commons.treeselect.no_options_text')"
|
||||||
:noResultsText="$t('commons.treeselect.no_results_text')"
|
:no-results-text="$t('commons.treeselect.no_results_text')"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -773,6 +773,7 @@ export default {
|
|||||||
view.customFilter = JSON.stringify([])
|
view.customFilter = JSON.stringify([])
|
||||||
view.drillFields = JSON.stringify([])
|
view.drillFields = JSON.stringify([])
|
||||||
view.extBubble = JSON.stringify([])
|
view.extBubble = JSON.stringify([])
|
||||||
|
this.setChartDefaultOptions(view)
|
||||||
const _this = this
|
const _this = this
|
||||||
post('/chart/view/save', view).then(response => {
|
post('/chart/view/save', view).then(response => {
|
||||||
this.closeCreateChart()
|
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) {
|
getTable(table) {
|
||||||
this.table = JSON.parse(JSON.stringify(table))
|
this.table = JSON.parse(JSON.stringify(table))
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user