diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 3a9106e4ec..03385ad3e6 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -660,6 +660,8 @@ export default { kettle_setting: 'Kettle Setting' }, chart: { + view_reset: 'View Reset', + view_reset_tips: 'Discard Changes To View?', export_img: 'Export Img', title_repeat: 'The Title Already Exist', save_snapshot: 'Save Snapshot', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 45b0364045..c2af66b461 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -662,6 +662,8 @@ export default { kettle_setting: 'Kettle 設置' }, chart: { + view_reset: '视图重置', + view_reset_tips: '放弃对视图的修改?', export_img: '导出图片', title_repeat: '當前標題已存在', save_snapshot: '保存縮略圖', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 01ddc5c753..66a0864a84 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -663,6 +663,8 @@ export default { kettle_setting: 'Kettle 设置' }, chart: { + view_reset: '视图重置', + view_reset_tips: '放弃对视图的修改?', export_img: '导出图片', title_repeat: '当前标题已存在', save_snapshot: '保存缩略图', diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index bf0418bafa..640351200c 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -1030,6 +1030,7 @@ import { pluginTypes } from '@/api/chart/chart' import ValueFormatterEdit from '@/views/chart/components/value-formatter/ValueFormatterEdit' import ChartStyle from '@/views/chart/view/ChartStyle' import CustomSortEdit from '@/views/chart/components/compare/CustomSortEdit' +import {delGroup} from "@/api/panel/panel"; export default { name: 'ChartEdit', components: { @@ -2398,11 +2399,19 @@ export default { reset() { const _this = this - resetViewCacheCallBack(_this.param.id, _this.panelInfo.id, function(rsp) { - _this.changeEditStatus(false) - _this.getChart(_this.param.id, 'panel') - // _this.getData(_this.param.id) - bus.$emit('view-in-cache', { type: 'propChange', viewId: _this.param.id }) + + this.$confirm(this.$t('chart.view_reset'), this.$t('chart.view_reset_tips'), { + confirmButtonText: this.$t('commons.confirm'), + cancelButtonText: this.$t('commons.cancel'), + type: 'warning' + }).then(() => { + resetViewCacheCallBack(_this.param.id, _this.panelInfo.id, function(rsp) { + _this.changeEditStatus(false) + _this.getChart(_this.param.id, 'panel') + bus.$emit('view-in-cache', { type: 'propChange', viewId: _this.param.id }) + }) + }).catch(() => { + // Do Nothing }) }, changeEditStatus(status) {