国际化修改

This commit is contained in:
caoyang
2022-01-17 10:09:01 +08:00
parent 24ee90f38f
commit d95c9bb7b4
25 changed files with 602 additions and 332 deletions
+8 -3
View 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)