Merge pull request #2434 from dataease/pr@dev@refactor_reset-comfirm

refactor: 视图重置增加提示
This commit is contained in:
王嘉豪 2022-06-16 12:00:28 +08:00 committed by GitHub
commit b2db00d30c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

@ -1098,6 +1098,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";
import ChartFieldEdit from '@/views/chart/view/ChartFieldEdit'
import CalcChartFieldEdit from '@/views/chart/view/CalcChartFieldEdit'
@ -2504,11 +2505,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) {