|
|
@ -1,16 +1,19 @@
|
|
|
|
<script lang="ts" setup>
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { computed, ref } from 'vue'
|
|
|
|
import { computed, ref } from 'vue'
|
|
|
|
import { NButton, NInput, NPopconfirm, useMessage } from 'naive-ui'
|
|
|
|
import { NButton, NInput, NPopconfirm, NSelect, useMessage } from 'naive-ui'
|
|
|
|
import type { Language, Theme } from '@/store/modules/app/helper'
|
|
|
|
import type { Language, Theme } from '@/store/modules/app/helper'
|
|
|
|
import { SvgIcon } from '@/components/common'
|
|
|
|
import { SvgIcon } from '@/components/common'
|
|
|
|
import { useAppStore, useUserStore } from '@/store'
|
|
|
|
import { useAppStore, useUserStore } from '@/store'
|
|
|
|
import type { UserInfo } from '@/store/modules/user/helper'
|
|
|
|
import type { UserInfo } from '@/store/modules/user/helper'
|
|
|
|
import { getCurrentDate } from '@/utils/functions'
|
|
|
|
import { getCurrentDate } from '@/utils/functions'
|
|
|
|
|
|
|
|
import { useBasicLayout } from '@/hooks/useBasicLayout'
|
|
|
|
import { t } from '@/locales'
|
|
|
|
import { t } from '@/locales'
|
|
|
|
|
|
|
|
|
|
|
|
const appStore = useAppStore()
|
|
|
|
const appStore = useAppStore()
|
|
|
|
const userStore = useUserStore()
|
|
|
|
const userStore = useUserStore()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { isMobile } = useBasicLayout()
|
|
|
|
|
|
|
|
|
|
|
|
const ms = useMessage()
|
|
|
|
const ms = useMessage()
|
|
|
|
|
|
|
|
|
|
|
|
const theme = computed(() => appStore.theme)
|
|
|
|
const theme = computed(() => appStore.theme)
|
|
|
@ -148,7 +151,10 @@ function handleImportButtonClick(): void {
|
|
|
|
</NButton>
|
|
|
|
</NButton>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="flex items-center space-x-4">
|
|
|
|
<div
|
|
|
|
|
|
|
|
class="flex items-center space-x-4"
|
|
|
|
|
|
|
|
:class="isMobile && 'items-start'"
|
|
|
|
|
|
|
|
>
|
|
|
|
<span class="flex-shrink-0 w-[100px]">{{ $t('setting.chatHistory') }}</span>
|
|
|
|
<span class="flex-shrink-0 w-[100px]">{{ $t('setting.chatHistory') }}</span>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-wrap items-center gap-4">
|
|
|
|
<div class="flex flex-wrap items-center gap-4">
|
|
|
@ -199,15 +205,12 @@ function handleImportButtonClick(): void {
|
|
|
|
<div class="flex items-center space-x-4">
|
|
|
|
<div class="flex items-center space-x-4">
|
|
|
|
<span class="flex-shrink-0 w-[100px]">{{ $t('setting.language') }}</span>
|
|
|
|
<span class="flex-shrink-0 w-[100px]">{{ $t('setting.language') }}</span>
|
|
|
|
<div class="flex flex-wrap items-center gap-4">
|
|
|
|
<div class="flex flex-wrap items-center gap-4">
|
|
|
|
<template v-for="item of languageOptions" :key="item.key">
|
|
|
|
<NSelect
|
|
|
|
<NButton
|
|
|
|
style="width: 140px"
|
|
|
|
size="small"
|
|
|
|
:value="language"
|
|
|
|
:type="item.key === language ? 'primary' : undefined"
|
|
|
|
:options="languageOptions"
|
|
|
|
@click="appStore.setLanguage(item.key)"
|
|
|
|
@update-value="value => appStore.setLanguage(value)"
|
|
|
|
>
|
|
|
|
/>
|
|
|
|
{{ item.label }}
|
|
|
|
|
|
|
|
</NButton>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="flex items-center space-x-4">
|
|
|
|
<div class="flex items-center space-x-4">
|
|
|
|