@@ -913,7 +916,7 @@
{{ $t('chart.analyse_cfg') }}
@@ -930,7 +933,7 @@
/>
@@ -1116,6 +1119,7 @@
+
{{ $t('chart.confirm') }}
+
+
+
+
+
+
@@ -1213,9 +1234,11 @@ import Threshold from '@/views/chart/components/senior/Threshold'
import TotalCfg from '@/views/chart/components/shape-attr/TotalCfg'
import LabelNormalText from '@/views/chart/components/normal/LabelNormalText'
import { pluginTypes } from '@/api/chart/chart'
+import ValueFormatterEdit from '@/views/chart/components/value-formatter/ValueFormatterEdit'
export default {
name: 'ChartEdit',
components: {
+ ValueFormatterEdit,
LabelNormalText,
TotalCfg,
Threshold,
@@ -1366,7 +1389,9 @@ export default {
quotaItemCompare: {},
showEditQuotaCompare: false,
preChartId: '',
- pluginRenderOptions: []
+ pluginRenderOptions: [],
+ showValueFormatter: false,
+ valueFormatterItem: {}
}
},
@@ -2273,11 +2298,11 @@ export default {
},
addXaxisExt(e) {
if (this.view.type !== 'table-info') {
- this.dragCheckType(this.view.xaxis, 'd')
+ this.dragCheckType(this.view.xaxisExt, 'd')
}
- this.dragMoveDuplicate(this.view.xaxis, e)
- if ((this.view.type === 'map' || this.view.type === 'word-cloud') && this.view.xaxis.length > 1) {
- this.view.xaxis = [this.view.xaxis[0]]
+ this.dragMoveDuplicate(this.view.xaxisExt, e)
+ if ((this.view.type === 'map' || this.view.type === 'word-cloud') && this.view.xaxisExt.length > 1) {
+ this.view.xaxisExt = [this.view.xaxisExt[0]]
}
this.calcData(true)
},
@@ -2544,6 +2569,33 @@ export default {
this.view.customAttr.label.position = 'middle'
}
}
+ },
+
+ valueFormatter(item) {
+ this.valueFormatterItem = JSON.parse(JSON.stringify(item))
+ this.showValueFormatter = true
+ },
+ closeValueFormatter() {
+ this.showValueFormatter = false
+ },
+ saveValueFormatter() {
+ const ele = this.valueFormatterItem.formatterCfg.decimalCount
+ if (ele === undefined || ele.toString().indexOf('.') > -1 || parseInt(ele).toString() === 'NaN' || parseInt(ele) < 0 || parseInt(ele) > 10) {
+ this.$message({
+ message: this.$t('chart.formatter_decimal_count_error'),
+ type: 'error',
+ showClose: true
+ })
+ return
+ }
+ // 更新指标
+ if (this.valueFormatterItem.formatterType === 'quota') {
+ this.view.yaxis[this.valueFormatterItem.index].formatterCfg = this.valueFormatterItem.formatterCfg
+ } else if (this.valueFormatterItem.formatterType === 'quotaExt') {
+ this.view.yaxisExt[this.valueFormatterItem.index].formatterCfg = this.valueFormatterItem.formatterCfg
+ }
+ this.calcData(true)
+ this.closeValueFormatter()
}
}
}