修改翻译文件为json格式(为了方便引用插件)优化过期登录弹窗多个的问题

This commit is contained in:
Sun
2024-01-08 21:10:10 +08:00
parent 2efb31571e
commit 89b6b63310
9 changed files with 590 additions and 483 deletions
+23 -2
View File
@@ -4,7 +4,7 @@ import { NButton, NCard, NDivider, NForm, NFormItem, NInput, NSelect, useDialog,
import { ref } from 'vue'
import { useAppStore, useAuthStore, usePanelState, useUserStore } from '@/store'
import { languageOptions } from '@/utils/defaultData'
import type { Language } from '@/store/modules/app/helper'
import type { Language, Theme } from '@/store/modules/app/helper'
import { logout } from '@/api'
import { RoundCardModal, SvgIcon } from '@/components/common/'
import { updateInfo, updatePassword } from '@/api/system/user'
@@ -19,10 +19,15 @@ const ms = useMessage()
const dialog = useDialog()
const languageValue = ref(appStore.language)
const themeValue = ref(appStore.theme)
const nickName = ref(authStore.userInfo?.name || '')
const isEditNickNameStatus = ref(false)
const formRef = ref<FormInst | null>(null)
const themeOptions: { label: string; key: string; value: Theme }[] = [
{ label: t('apps.userInfo.themeStyle.dark'), key: 'dark', value: 'dark' },
{ label: t('apps.userInfo.themeStyle.light'), key: 'light', value: 'light' },
{ label: t('apps.userInfo.themeStyle.auto'), key: 'Auto', value: 'auto' },
]
const updatePasswordModalState = ref({
show: false,
loading: false,
@@ -132,6 +137,12 @@ function handleChangeLanuage(value: Language) {
appStore.setLanguage(value)
location.reload()
}
function handleChangeTheme(value: Theme) {
themeValue.value = value
appStore.setTheme(value)
// location.reload()
}
</script>
<template>
@@ -175,6 +186,16 @@ function handleChangeLanuage(value: Language) {
<NSelect v-model:value="languageValue" :options="languageOptions" @update-value="handleChangeLanuage" />
</div>
</div>
<div class="mt-[10px]">
<div class="text-slate-500 font-bold">
{{ $t('apps.userInfo.theme') }}
</div>
<div class="max-w-[200px]">
<NSelect v-model:value="themeValue" :options="themeOptions" @update-value="handleChangeTheme" />
</div>
</div>
<NDivider style="margin: 10px 0;" dashed />
<div>
<NButton size="small" text type="info" @click="updatePasswordModalState.show = !updatePasswordModalState.show">