diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 24ee19851e..885a6758a1 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -125,7 +125,11 @@ - {{ $t('commons.copy') }}... + {{ $t('commons.copy') }} + + {{ $t('commons.edit') }} + {{ $t('commons.delete') }} + @@ -167,7 +171,11 @@ - {{ $t('commons.copy') }}... + {{ $t('commons.copy') }} + + {{ $t('commons.edit') }} + {{ $t('commons.delete') }} + @@ -345,7 +353,7 @@ $t('chart.drag_block_table_data_column') }} {{ $t('chart.drag_block_type_axis') }} {{ $t('chart.drag_block_value_axis') }} @@ -1418,7 +1426,6 @@ export default { bus.$on('plugins-calc-style', this.calcStyle) bus.$on('plugin-chart-click', this.chartClick) bus.$on('set-dynamic-area-code', this.setDynamicAreaCode) - }, initTableData(id, optType) { if (id != null) { @@ -1910,6 +1917,7 @@ export default { onSizeChange(val) { this.view.customAttr.size = val this.calcStyle() + this.calcData() }, onTextChange(val) { @@ -2667,6 +2675,12 @@ export default { this.currEditField.extField = 1 this.showChartCalcField() break + case 'edit': + this.showChartCalcField() + break + case 'delete': + this.deleteChartCalcField(param.item) + break } }, handleChartFieldEdit(item, type) { @@ -2683,6 +2697,23 @@ export default { this.editChartCalcField = false this.currEditField = {} this.initTableField(this.table.id) + }, + deleteChartCalcField(item) { + this.$confirm(this.$t('dataset.confirm_delete'), this.$t('chart.tips'), { + confirmButtonText: this.$t('dataset.confirm'), + cancelButtonText: this.$t('dataset.cancel'), + type: 'warning' + }).then(() => { + post('/chart/field/delete/' + item.id + '/' + this.panelInfo.id, null).then(response => { + this.$message({ + type: 'success', + message: this.$t('chart.delete_success'), + showClose: true + }) + this.initTableField(this.table.id) + }) + }).catch(() => { + }) } } } diff --git a/frontend/src/views/chart/view/ChartFieldEdit.vue b/frontend/src/views/chart/view/ChartFieldEdit.vue index 5b01884214..5724687d2a 100644 --- a/frontend/src/views/chart/view/ChartFieldEdit.vue +++ b/frontend/src/views/chart/view/ChartFieldEdit.vue @@ -165,7 +165,7 @@