diff --git a/src/directive/sidebarDraggable.ts b/src/directive/sidebarDraggable.ts index 04a6a7e3..20479df8 100644 --- a/src/directive/sidebarDraggable.ts +++ b/src/directive/sidebarDraggable.ts @@ -9,7 +9,7 @@ export const draggable = { const newWidth = startWidth + (event.clientX - startX); // 确保宽度在合理范围内 - if (newWidth >= 100 && newWidth <= 600) { + if (newWidth >= 240 && newWidth <= 600) { el.style.width = `${newWidth}px`; // 更新传递的 ref 变量 diff --git a/src/hooks/useTheme.ts b/src/hooks/useTheme.ts index 0a306d2f..b6677b0e 100644 --- a/src/hooks/useTheme.ts +++ b/src/hooks/useTheme.ts @@ -42,7 +42,7 @@ export const useTheme = () => { const changePrimary = (val: string | null) => { if (!val) { val = DEFAULT_PRIMARY; - message.success(`${t('Theme reset')} ${DEFAULT_PRIMARY}`); + message.success(`${t('Theme Reset')} ${DEFAULT_PRIMARY}`); } // 计算主题颜色变化 diff --git a/src/languages/modules/en.ts b/src/languages/modules/en.ts index bb8af88b..75144073 100644 --- a/src/languages/modules/en.ts +++ b/src/languages/modules/en.ts @@ -12,13 +12,15 @@ export default { GUI: 'GUI', CLI: 'CLI', 'Web Terminal': 'Web Terminal', - 'Theme reset': 'The theme color has been reset to', + 'Theme Reset': 'The theme color has been reset to', 'Custom Setting': 'Custom Setting', 'Dark Mode': '黑暗模式', 'Theme Settings': 'Theme Settings', 'Language Settings': 'Language Settings', - 'Page configuration': 'Page configuration', - 'Please select': 'Please select', + 'Page Configuration': 'Page Configuration', + 'Please Select': 'Please Select', 'Language Selection': 'Language Selection', + 'Asset Async': 'Asynchronous loading', + 'Asset Async Explain': 'Whether assets are loaded asynchronously', 'Primary Color': 'Primary Color' }; diff --git a/src/languages/modules/zh.ts b/src/languages/modules/zh.ts index a8630801..71da476e 100644 --- a/src/languages/modules/zh.ts +++ b/src/languages/modules/zh.ts @@ -12,13 +12,15 @@ export default { GUI: '图形化配置', CLI: '命令行配置', 'Web Terminal': 'Web 终端', - 'Theme reset': '主题颜色已重置为', + 'Theme Reset': '主题颜色已重置为', 'Custom Setting': '自定义设置', 'Dark Mode': '黑暗模式', 'Theme Settings': '主题设置', 'Language Settings': '语言设置', - 'Page configuration': '页面配置', - 'Please select': '请选择', + 'Page Configuration': '页面配置', + 'Please Select': '请选择', + 'Asset Async': '异步加载', + 'Asset Async Explain': '是否异步加载资产', 'Language Selection': '语言选择', 'Primary Color': '主题颜色' }; diff --git a/src/layouts/components/FileManagement/index.vue b/src/layouts/components/FileManagement/index.vue index 210c7933..4668aa3c 100644 --- a/src/layouts/components/FileManagement/index.vue +++ b/src/layouts/components/FileManagement/index.vue @@ -147,8 +147,6 @@ const loadTree = async (isAsync: Boolean) => { const data = Object.values(treeMap).filter(node => !node.pId); testData.value = data; - console.log(res); - console.log(data); } catch (e) { console.log(e); } diff --git a/src/layouts/components/SettingDrawer/index.vue b/src/layouts/components/SettingDrawer/index.vue index a389912c..1eea0918 100644 --- a/src/layouts/components/SettingDrawer/index.vue +++ b/src/layouts/components/SettingDrawer/index.vue @@ -1,17 +1,11 @@ + + + + {{ t('Asset Async Explain') }} + + + + + + - {{ t('Page configuration') }} + {{ t('Page Configuration') }} @@ -37,12 +47,12 @@ {{ t('Language Selection') }} @@ -55,24 +65,37 @@ import { storeToRefs } from 'pinia'; import { SelectOption } from 'naive-ui'; import { useTheme } from '@/hooks/useTheme.ts'; import { onBeforeUnmount, reactive, ref } from 'vue'; +import { useTreeStore } from '@/stores/modules/tree.ts'; import { useGlobalStore } from '@/stores/modules/global.ts'; import mittBus from '@/utils/mittBus.ts'; -import { MoonOutline, SunnyOutline } from '@vicons/ionicons5'; +import { + MoonOutline, + SunnyOutline, + ArrowBackCircleOutline, + ArrowForwardCircleOutline +} from '@vicons/ionicons5'; +const treeStore = useTreeStore(); const globalStore = useGlobalStore(); const { t } = useI18n(); const { switchDark } = useTheme(); const { isDark } = storeToRefs(globalStore); +const { isAsync } = storeToRefs(treeStore); -const active = isDark; +const darkModeActive = isDark; +const assetAsyncActive = isAsync; const showSettingDrawer = ref(false); -const handleChange = (value: Boolean) => { +const handleDarkModeChange = (value: Boolean) => { globalStore.setGlobalState('isDark', value); switchDark(); }; +const handleAssetAsyncChange = (value: Boolean) => { + treeStore.changeState(value); + mittBus.emit('tree-load'); +}; const handlePageConfigurationChange = (value: string, option: SelectOption) => { console.log(value); @@ -126,18 +149,22 @@ onBeforeUnmount(() => {