|
@@ -12,6 +12,7 @@
|
|
|
</el-badge>
|
|
</el-badge>
|
|
|
<app-icon icon="Tickets" @click="openComponent('report')" />
|
|
<app-icon icon="Tickets" @click="openComponent('report')" />
|
|
|
<app-icon icon="Setting" @click="openComponent('setting')" />
|
|
<app-icon icon="Setting" @click="openComponent('setting')" />
|
|
|
|
|
+ <span @click="changeLuanguage">{{ i18n.global.locale === 'zh-CN' ? t('mine.setting.chinese') : t('mine.setting.english') }}</span>
|
|
|
<!-- <app-icon icon="g-icon-minimize" @click="exitFullSreen" v-if="fullScreen" />
|
|
<!-- <app-icon icon="g-icon-minimize" @click="exitFullSreen" v-if="fullScreen" />
|
|
|
<app-icon icon="g-icon-maximize" @click="setFullSreen" v-else /> -->
|
|
<app-icon icon="g-icon-maximize" @click="setFullSreen" v-else /> -->
|
|
|
</div>
|
|
</div>
|
|
@@ -39,10 +40,12 @@
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { ref, onMounted, computed, defineAsyncComponent } from 'vue'
|
|
import { ref, onMounted, computed, defineAsyncComponent } from 'vue'
|
|
|
import { SwitchButton, Unlock, Avatar } from '@element-plus/icons-vue'
|
|
import { SwitchButton, Unlock, Avatar } from '@element-plus/icons-vue'
|
|
|
|
|
+import { ElMessageBox } from 'element-plus'
|
|
|
import { getFileUrl, diffDays } from '@/filters'
|
|
import { getFileUrl, diffDays } from '@/filters'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
import { useComponent } from '@/hooks/component'
|
|
|
import { useLoginStore, useUserStore, useGlobalStore, useNoticeStore, i18n } from '@/stores'
|
|
import { useLoginStore, useUserStore, useGlobalStore, useNoticeStore, i18n } from '@/stores'
|
|
|
import { localData } from '@/stores/storage'
|
|
import { localData } from '@/stores/storage'
|
|
|
|
|
+// import enUS from 'vant/es/locale/lang/en-US'
|
|
|
import eventBus from '@/services/bus'
|
|
import eventBus from '@/services/bus'
|
|
|
import AppIcon from '@pc/components/base/icon/index.vue'
|
|
import AppIcon from '@pc/components/base/icon/index.vue'
|
|
|
|
|
|
|
@@ -61,8 +64,23 @@ const globalStore = useGlobalStore()
|
|
|
const userStore = useUserStore()
|
|
const userStore = useUserStore()
|
|
|
const noticeStore = useNoticeStore()
|
|
const noticeStore = useNoticeStore()
|
|
|
const fullScreen = ref(false)
|
|
const fullScreen = ref(false)
|
|
|
|
|
+
|
|
|
const { t } = i18n.global
|
|
const { t } = i18n.global
|
|
|
|
|
|
|
|
|
|
+const changeLuanguage = () => {
|
|
|
|
|
+ ElMessageBox.confirm('切换语言更改需要重新登录才生效', t('common.tips'), { confirmButtonText: t('common.ikonw') }).then(() => {
|
|
|
|
|
+ if (i18n.global.locale === 'zh-CN') {
|
|
|
|
|
+ i18n.global.locale = 'en-US'
|
|
|
|
|
+ } else {
|
|
|
|
|
+ i18n.global.locale = 'zh-CN'
|
|
|
|
|
+ }
|
|
|
|
|
+ /// 设置语言
|
|
|
|
|
+ localData.setValue('appLanguage', i18n.global.locale)
|
|
|
|
|
+ /// 重新登出
|
|
|
|
|
+ eventBus.$emit('LogoutNotify')
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 用户头像
|
|
// 用户头像
|
|
|
const userAvatar = computed(() => {
|
|
const userAvatar = computed(() => {
|
|
|
const file = userStore.userInfo?.headurl
|
|
const file = userStore.userInfo?.headurl
|