rev: admin 修复国际化

This commit is contained in:
2024-05-31 08:52:10 +08:00
parent 7659065a68
commit adafb2cec5
12 changed files with 130 additions and 60 deletions

View File

@@ -7,6 +7,7 @@ import {
downloadFile
} from '@/utils/index'
import checkPermission from '@/utils/permission'
import i18n from '@/i18n'
export default {
data() {
@@ -115,28 +116,28 @@ export default {
*/
submitSuccessNotify() {
this.$notify({
title: '提交成功',
title: i18n.t('common.submit'),
type: 'success',
duration: 2500
})
},
addSuccessNotify() {
this.$notify({
title: '新增成功',
title: i18n.t('common.add'),
type: 'success',
duration: 2500
})
},
editSuccessNotify() {
this.$notify({
title: '编辑成功',
title: i18n.t('common.edit'),
type: 'success',
duration: 2500
})
},
delSuccessNotify() {
this.$notify({
title: '删除成功',
title: i18n.t('common.del'),
type: 'success',
duration: 2500
})
@@ -179,9 +180,9 @@ export default {
* 多选删除提示
*/
beforeDelAllMethod() {
this.$confirm('你确定删除选中的数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(i18n.t('common.Tip19'), i18n.t('common.Tips'), {
confirmButtonText: i18n.t('common.Confirm'),
cancelButtonText: i18n.t('common.Cancel'),
type: 'warning'
}).then(() => {
this.delAllMethod()
@@ -202,7 +203,7 @@ export default {
this.dleChangePage(ids.length)
this.init()
this.$notify({
title: '删除成功',
title: i18n.t('common.del'),
type: 'success',
duration: 2500
})
@@ -318,7 +319,7 @@ export default {
* 获取弹窗的标题
*/
getFormTitle() {
return this.isAdd ? `新增${this.title}` : `编辑${this.title}`
return this.isAdd ? i18n.t('common.Create') + `${this.title}` : i18n.t('common.Editors') + `${this.title}`
},
/**
* 通用导出
@@ -327,7 +328,7 @@ export default {
this.beforeInit()
this.downloadLoading = true
download(this.url + '/download', this.params).then(result => {
this.downloadFile(result, this.title + '数据', 'xlsx')
this.downloadFile(result, this.title + i18n.t('common.datas'), 'xlsx')
this.downloadLoading = false
}).catch(() => {
this.downloadLoading = false