2024-09-09 17:53:07 +08:00
|
|
|
<script setup lang="ts">
|
|
|
|
import useSettingsStore from './settings/useSettingsStore'
|
|
|
|
import Header from './layout/header'
|
|
|
|
import Background from './layout/background'
|
|
|
|
import GLobalModal from './GlobalModal'
|
|
|
|
import SettingsButton from './settings/SettingsButton'
|
|
|
|
import SettingsOverlay from './settings/SettingsOverlay'
|
2024-09-11 13:46:40 +08:00
|
|
|
import Sider from './layout/sider'
|
2024-09-25 14:25:44 +08:00
|
|
|
import Dock from './layout/dock'
|
2024-09-25 18:23:54 +08:00
|
|
|
import DirModal from './layout/grid/DirModal'
|
|
|
|
import GlobalMenu from './layout/GlobalMenu'
|
2024-09-11 13:46:40 +08:00
|
|
|
import LoginModal from './user/LoginModal'
|
2024-09-09 17:53:07 +08:00
|
|
|
import { computed } from 'vue'
|
2024-09-11 16:03:17 +08:00
|
|
|
import asyncLoader from './utils/asyncLoader'
|
|
|
|
import useLayoutStore from './layout/useLayoutStore'
|
2024-10-31 18:21:32 +08:00
|
|
|
import WelcomePage from './layout/grid/WelcomePage'
|
2024-11-03 23:54:21 +08:00
|
|
|
import TomatoPage from './layout/grid/TomatoPage'
|
|
|
|
import useRouterStore from './useRouterStore'
|
2024-11-13 19:51:52 +08:00
|
|
|
import BackupRecovery from './user/BackupRecovery'
|
2024-11-15 20:32:15 +08:00
|
|
|
import { ConfigProvider } from 'ant-design-vue'
|
|
|
|
import zhCN from 'ant-design-vue/es/locale/zh_CN'
|
2024-09-11 16:03:17 +08:00
|
|
|
const Grid = asyncLoader(() => import('./layout/grid'))
|
2024-09-13 18:27:39 +08:00
|
|
|
const Fox = asyncLoader(() => import('./fox'))
|
2024-09-09 17:53:07 +08:00
|
|
|
const settings = useSettingsStore()
|
|
|
|
const blockSize = computed(() => settings.state.blockSize + 'rem')
|
|
|
|
const blockPadding = computed(() => settings.state.blockPadding + 'rem')
|
|
|
|
const mainWidth = computed(() => settings.state.mainWidth + '%')
|
2024-09-11 16:03:17 +08:00
|
|
|
const blockRadius = computed(() => settings.state.blockRadius)
|
2024-11-03 23:54:21 +08:00
|
|
|
const router = useRouterStore()
|
2024-09-11 16:03:17 +08:00
|
|
|
const layout = useLayoutStore()
|
2024-09-09 17:53:07 +08:00
|
|
|
</script>
|
|
|
|
<template>
|
2024-11-15 20:32:15 +08:00
|
|
|
<ConfigProvider :locale="zhCN">
|
|
|
|
<div class="fixed left-0 top-0 w-full h-screen style-root" @contextmenu.prevent>
|
|
|
|
<Header />
|
|
|
|
<Background
|
|
|
|
@dblclick="
|
|
|
|
() => {
|
|
|
|
layout.state.simple = !layout.state.simple
|
|
|
|
}
|
|
|
|
"
|
|
|
|
/>
|
|
|
|
<GLobalModal />
|
|
|
|
<SettingsOverlay />
|
|
|
|
<SettingsButton />
|
2024-11-08 20:22:37 +08:00
|
|
|
|
2024-11-15 20:32:15 +08:00
|
|
|
<Sider
|
|
|
|
v-if="
|
|
|
|
!layout.state.simple ||
|
|
|
|
(layout.state.simple && settings.state.simpleModeShowString.includes('showSider'))
|
|
|
|
"
|
|
|
|
/>
|
|
|
|
<LoginModal v-if="router.path === 'global-login'" />
|
|
|
|
<Transition>
|
|
|
|
<Grid v-if="layout.ready && !layout.state.simple" />
|
|
|
|
</Transition>
|
|
|
|
<Dock
|
|
|
|
v-if="
|
|
|
|
!layout.state.simple ||
|
|
|
|
(layout.state.simple && settings.state.simpleModeShowString.includes('showDock'))
|
|
|
|
"
|
|
|
|
/>
|
|
|
|
<div
|
|
|
|
class="fixed z-40 right-[14%] top-8"
|
|
|
|
v-if="
|
|
|
|
!layout.state.simple ||
|
|
|
|
(layout.state.simple && settings.state.simpleModeShowString.includes('showPet'))
|
|
|
|
"
|
|
|
|
>
|
|
|
|
<Fox />
|
|
|
|
</div>
|
|
|
|
<DirModal />
|
|
|
|
<GlobalMenu />
|
|
|
|
<WelcomePage></WelcomePage>
|
|
|
|
<TomatoPage></TomatoPage>
|
2024-11-13 19:51:52 +08:00
|
|
|
|
2024-11-15 20:32:15 +08:00
|
|
|
<BackupRecovery v-if="router.path === 'global-backup'"></BackupRecovery>
|
|
|
|
</div>
|
|
|
|
</ConfigProvider>
|
2024-09-09 17:53:07 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<style lang="less">
|
|
|
|
.style-root {
|
|
|
|
--block-size: 5.2rem;
|
|
|
|
--block-padding: 1rem;
|
|
|
|
--main-width: 95%;
|
|
|
|
--block-radius: 0.2;
|
|
|
|
|
|
|
|
// 以下是响应式设计, 绑定 settings 中的尺寸
|
|
|
|
@media screen and (min-width: 68px) {
|
|
|
|
/* 768px 之上,尺寸可以独自设计 */
|
|
|
|
--block-size: v-bind(blockSize);
|
|
|
|
--block-padding: v-bind(blockPadding);
|
|
|
|
--main-width: v-bind(mainWidth);
|
|
|
|
--block-radius: v-bind(blockRadius);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|