refactor: 视图重置增加提示

This commit is contained in:
wangjiahao 2022-06-16 11:58:23 +08:00
parent a6744f7b9f
commit fd8197fc77
4 changed files with 20 additions and 5 deletions

View File

@ -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',

View File

@ -662,6 +662,8 @@ export default {
kettle_setting: 'Kettle 設置'
},
chart: {
view_reset: '视图重置',
view_reset_tips: '放弃对视图的修改?',
export_img: '导出图片',
title_repeat: '當前標題已存在',
save_snapshot: '保存縮略圖',

View File

@ -663,6 +663,8 @@ export default {
kettle_setting: 'Kettle 设置'
},
chart: {
view_reset: '视图重置',
view_reset_tips: '放弃对视图的修改?',
export_img: '导出图片',
title_repeat: '当前标题已存在',
save_snapshot: '保存缩略图',

View File

@ -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) {