feat: 替换excel时,提示信息

This commit is contained in:
taojinlong 2022-05-24 23:05:25 +08:00
parent 199e491401
commit c29875ffa9
4 changed files with 17 additions and 5 deletions

View File

@ -1248,7 +1248,8 @@ export default {
pending: 'Pause',
exec: 'Execute Once',
confirm_exec: 'Manual trigger execution',
change_success: 'State switch successful'
change_success: 'State switch successful',
excel_replace_msg: 'Calculation fields, custom datasets, associated datasets, dashboards, etc. may be affected. Confirm the replacement'
},
field_group_type: 'Type',
location: 'Location',

View File

@ -1248,7 +1248,8 @@ export default {
pending: '暫停',
exec: '執行一次',
confirm_exec: '手動觸發執行?',
change_success: '狀態切換成功'
change_success: '狀態切換成功',
excel_replace_msg: '可能會影響計算欄位、自定義數据集、關聯數据集、儀錶板等,確認替換?'
},
field_group_type: '分類',
location: '地理位置',

View File

@ -1249,7 +1249,8 @@ export default {
pending: '暂停',
exec: '执行一次',
confirm_exec: '手动触发执行?',
change_success: '状态切换成功'
change_success: '状态切换成功',
excel_replace_msg: '可能会影响计算字段、自定义数据集、关联数据集、仪表板等,确认替换?'
},
field_group_type: '分类',
location: '地理位置',

View File

@ -153,7 +153,7 @@
import { post } from '@/api/dataset/dataset'
import { getToken } from '@/utils/auth'
import i18n from '@/lang'
import {$alert} from "@/utils/message";
import {$alert, $confirm} from "@/utils/message";
import store from "@/store";
const token = getToken()
@ -366,8 +366,17 @@ export default {
editType: this.param.editType ? this.param.editType : 0
}
}
if (this.param.editType === 0 && this.param.tableId) {
$confirm(i18n.t('dataset.repeat_datasource_msg'), () => {
this.saveExcelData(sheetFileMd5, table)
})
}else {
this.saveExcelData(sheetFileMd5, table)
}
},
saveExcelData(sheetFileMd5, table) {
if (new Set(sheetFileMd5).size !== sheetFileMd5.length && !this.param.tableId) {
this.$confirm(this.$t('dataset.merge_msg'), this.$t('dataset.merge_title'), {
this.$confirm(this.$t('dataset.excel_replace_msg'), this.$t('dataset.merge_title'), {
distinguishCancelAndClose: true,
confirmButtonText: this.$t('dataset.merge'),
cancelButtonText: this.$t('dataset.no_merge'),