国际化修改
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
text:{
|
||||
type:String,
|
||||
required:false,
|
||||
default:"上传"
|
||||
default:'上传'
|
||||
},
|
||||
/*这个属性用于控制文件上传的业务路径*/
|
||||
bizPath:{
|
||||
@@ -135,7 +135,7 @@
|
||||
beforeUpload: function(file){
|
||||
var fileType = file.type;
|
||||
if(fileType.indexOf('image')<0){
|
||||
this.$message.warning('请上传图片');
|
||||
this.$message.warning(this.$t('uploadPictures'));
|
||||
return false;
|
||||
}
|
||||
},
|
||||
@@ -159,7 +159,7 @@
|
||||
}
|
||||
//this.$message.success(`${info.file.name} 上传成功!`);
|
||||
}else if (info.file.status === 'error') {
|
||||
this.$message.error(`${info.file.name} 上传失败.`);
|
||||
this.$message.error(`${info.file.name} `+this.$t('UploadFailed'));
|
||||
}else if(info.file.status === 'removed'){
|
||||
this.handleDelete(info.file)
|
||||
}
|
||||
|
||||
@@ -107,6 +107,7 @@
|
||||
import { UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"
|
||||
import moment from 'moment'
|
||||
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
|
||||
import enUS from 'ant-design-vue/es/locale/en_US';
|
||||
import 'moment/locale/zh-cn'
|
||||
moment.locale('zh-cn')
|
||||
const EN = 'en-us'
|
||||
@@ -153,6 +154,7 @@
|
||||
this.updateCurrentDepart()
|
||||
}
|
||||
}
|
||||
this.localeval=localStorage.getItem('language')
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
@@ -197,6 +199,7 @@
|
||||
return that.Logout({}).then(() => {
|
||||
// update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面
|
||||
that.$router.push({ path: '/user/login' });
|
||||
localStorage.removeItem('language')
|
||||
// update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面
|
||||
//window.location.reload()
|
||||
}).catch(err => {
|
||||
@@ -267,18 +270,20 @@
|
||||
/*update_end author:liushaoqian date:20200507 for: 刷新缓存*/
|
||||
moment,
|
||||
changeLocale (localeval) {
|
||||
console.log('loacal',localeval)
|
||||
this.$root.Bus.$emit('switchLanguage',localeval)
|
||||
this.localeval = localeval
|
||||
if (localeval === EN) {
|
||||
moment.locale(EN)
|
||||
this.$i18n.locale = EN
|
||||
this.locale = null
|
||||
localStorage.setItem('language', EN)
|
||||
this.locale = enUS
|
||||
// localStorage.setItem('language', EN)
|
||||
// location.reload();
|
||||
} else {
|
||||
moment.locale(ZH)
|
||||
this.$i18n.locale = ZH
|
||||
this.locale = zhCN
|
||||
localStorage.setItem('language', ZH)
|
||||
// localStorage.setItem('language', ZH)
|
||||
// location.reload();
|
||||
}
|
||||
console.log('this.locale',this.locale)
|
||||
|
||||
Reference in New Issue
Block a user