|
|
@@ -53,6 +53,14 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</fieldset>
|
|
|
+ <fieldset class="g-fieldset">
|
|
|
+ <legend class="g-fieldset__legend">其他设置</legend>
|
|
|
+ <el-form ref="formRef" class="el-form--horizontal" label-width="80px">
|
|
|
+ <el-form-item label="语言切换">
|
|
|
+ <span @click="changeLuanguage">{{ i18n.global.locale === 'zh-CN' ? t('mine.setting.chinese') : t('mine.setting.english') }}</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </fieldset>
|
|
|
<template #footer>
|
|
|
<el-button type="info" @click="resetSettings">{{ t('operation.restore') }}</el-button>
|
|
|
<el-button type="primary" @click="updateSettings">{{ t('operation.savesetting') }}</el-button>
|
|
|
@@ -65,7 +73,9 @@ import { ref } from 'vue'
|
|
|
import { ElMessageBox, FormInstance } from 'element-plus'
|
|
|
import { getBuyOrSellList } from '@/constants/order'
|
|
|
import { useSettingStore, i18n } from '@/stores'
|
|
|
+import { localData } from '@/stores/storage'
|
|
|
import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
|
+import eventBus from '@/services/bus'
|
|
|
|
|
|
const settingStore = useSettingStore()
|
|
|
const formRef = ref<FormInstance>()
|
|
|
@@ -77,6 +87,20 @@ const onCancel = () => {
|
|
|
show.value = false
|
|
|
}
|
|
|
|
|
|
+const changeLuanguage = () => {
|
|
|
+ ElMessageBox.confirm(t('user.login.tips6'), 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 updateSettings = () => {
|
|
|
settingStore.updateSettings(formData.value)
|
|
|
onCancel()
|