diff --git a/src/layouts/sakai-vue/composables/layout.ts b/src/layouts/sakai-vue/composables/layout.ts index 7ac5e85..fbdd010 100644 --- a/src/layouts/sakai-vue/composables/layout.ts +++ b/src/layouts/sakai-vue/composables/layout.ts @@ -1,4 +1,4 @@ -import { computed, reactive } from 'vue'; +import { computed, reactive, watch } from 'vue'; const layoutConfig = reactive({ darkTheme: false, @@ -8,17 +8,31 @@ const layoutConfig = reactive({ surface: null, }); +// 从 localStorage 读取初始状态,如果没有则使用默认值 false +const getStoredMenuState = (): boolean => { + const stored = localStorage.getItem('staticMenuDesktopInactive'); + return stored ? JSON.parse(stored) : false; +}; + const layoutState = reactive({ activeMenuItem: null, configSidebarVisible: false, menuHoverActive: false, overlayMenuActive: false, profileSidebarVisible: false, - staticMenuDesktopInactive: false, + staticMenuDesktopInactive: getStoredMenuState(), staticMenuMobileActive: false, }); export function useLayout() { + // 监听 staticMenuDesktopInactive 的变化并保存到 localStorage + watch( + () => layoutState.staticMenuDesktopInactive, + (newValue) => { + localStorage.setItem('staticMenuDesktopInactive', JSON.stringify(newValue)); + }, + ); + const setActiveMenuItem = (item: Record) => { layoutState.activeMenuItem = item.value || item; }; diff --git a/src/pages/Satellite/Cesium/components/SatelliteSelector.vue b/src/pages/Satellite/Cesium/components/SatelliteSelector.vue new file mode 100644 index 0000000..2b51b2e --- /dev/null +++ b/src/pages/Satellite/Cesium/components/SatelliteSelector.vue @@ -0,0 +1,186 @@ + + + + + diff --git a/src/pages/Satellite/Cesium/index.page.vue b/src/pages/Satellite/Cesium/index.page.vue index c22feea..4465a4e 100644 --- a/src/pages/Satellite/Cesium/index.page.vue +++ b/src/pages/Satellite/Cesium/index.page.vue @@ -1,61 +1,12 @@ @@ -188,21 +41,4 @@ const onCheckAllChange = (e: { target: { checked: boolean } }) => { #cesiumContainer { @apply absolute top-0 left-0 right-0 bottom-0; } - -.satellite-list { - scrollbar-width: thin; -} - -.satellite-list::-webkit-scrollbar { - width: 4px; -} - -.satellite-list::-webkit-scrollbar-thumb { - background-color: rgba(0, 0, 0, 0.2); - border-radius: 4px; -} - -.satellite-selector { - max-height: 80vh; -} diff --git a/vite.config.plugins.ts b/vite.config.plugins.ts index 3cf442b..6d29aee 100644 --- a/vite.config.plugins.ts +++ b/vite.config.plugins.ts @@ -39,10 +39,11 @@ export function Plugins() { const plugins: PluginOption[] = []; plugins.push( + // https://vue-macros.dev/zh-CN/guide/bundler-integration.html VueMacros({ plugins: { vue: Vue({ include: [/\.vue$/, /\.md$/] }), - vueJsx: VueJsx(), // 如有需要 + vueJsx: VueJsx(), // https://uvr.esm.is/guide/configuration.html // https://github.com/posva/unplugin-vue-router vueRouter: VueRouter({ @@ -53,7 +54,7 @@ export function Plugins() { routesFolder: 'src/pages', }), }, - }), // https://vue-macros.dev/zh-CN/guide/bundler-integration.html + }), // https://github.com/JohnCampionJr/vite-plugin-vue-layouts?tab=readme-ov-file#configuration // Layouts({ defaultLayout: 'sakai-vue/AppLayout', pagesDirs: [] }),