diff --git a/src/layout/layout.types.ts b/src/layout/layout.types.ts
index c14f24b..abfae6b 100644
--- a/src/layout/layout.types.ts
+++ b/src/layout/layout.types.ts
@@ -42,5 +42,4 @@ export interface Layout {
Block | null
]
simple: boolean
- loading: boolean
}
diff --git a/src/layout/sider/index.tsx b/src/layout/sider/index.tsx
index bcf3c8b..22bfed6 100644
--- a/src/layout/sider/index.tsx
+++ b/src/layout/sider/index.tsx
@@ -5,6 +5,7 @@ import { OhVueIcon, addIcons } from 'oh-vue-icons'
import { PxHeadset, PxAddBox, PxCheck } from 'oh-vue-icons/icons'
import useRouterStore from '@/useRouterStore'
import useLayoutStore from '../useLayoutStore'
+import useUserStore from '@/user/useUserStore'
initIcons()
addIcons(PxHeadset, PxAddBox, PxCheck)
@@ -57,6 +58,7 @@ export default defineComponent(() => {
const selected = ref(icons[0])
const router = useRouterStore()
const layout = useLayoutStore()
+ const user = useUserStore()
const label = ref('')
watch(
selected,
@@ -66,106 +68,114 @@ export default defineComponent(() => {
{ immediate: true }
)
return () => (
-
-
-
-
-
- {/* 添加页面 */}
-
- {showEdit.value && (
- {
- showEdit.value = false
- }}
- >
-
-
- {icons.map((el) => (
-
{
- selected.value = { ...el }
- }}
- >
-
-
- ))}
-
-
{
- layout.state.content[layout.state.current].push({
- list: [],
- label: label.value,
- name: selected.value.name
- })
- }}
- >
-
- 添加页面
-
-
- )}
-
-
+ )}
+
)
})
diff --git a/src/layout/useLayoutStore.ts b/src/layout/useLayoutStore.ts
index b4583a5..40c2a28 100644
--- a/src/layout/useLayoutStore.ts
+++ b/src/layout/useLayoutStore.ts
@@ -1,6 +1,6 @@
import { defineStore } from 'pinia'
import type { Layout } from './layout.types'
-import { reactive, ref, toRaw, watch } from 'vue'
+import { computed, reactive, ref, toRaw, watch } from 'vue'
import db from '@/db'
const defaultLayout: Layout = {
@@ -9,8 +9,7 @@ const defaultLayout: Layout = {
currentPage: 0,
dir: {},
dock: [null, null, null, null, null, null, null, null, null, null],
- simple: false,
- loading: true
+ simple: false
}
export default defineStore('layout', () => {
@@ -36,8 +35,15 @@ export default defineStore('layout', () => {
state.currentPage = 0
}
)
+ const currentPageList = computed(() =>
+ state.simple ? [] : state.content[state.current]?.[state.currentPage]?.list || []
+ )
+ // 是让时间和搜索改变位置,使画面更紧凑 —— @/layout/grid
+ const isCompact = ref(false)
return {
state,
- ready
+ ready,
+ currentPageList,
+ isCompact
}
})
diff --git a/src/settings/useSettingsStore.ts b/src/settings/useSettingsStore.ts
index 68f5363..539c20d 100644
--- a/src/settings/useSettingsStore.ts
+++ b/src/settings/useSettingsStore.ts
@@ -18,7 +18,7 @@ export default defineStore(
blockSize: 6,
blockPadding: 1,
mainWidth: 70,
- blockRadius: 1,
+ blockRadius: 0.2,
// 搜索
searchWidth: 30,
searchRadius: 24
diff --git a/src/user/LoginModal.tsx b/src/user/LoginModal.tsx
index b28a991..dab9e66 100644
--- a/src/user/LoginModal.tsx
+++ b/src/user/LoginModal.tsx
@@ -1,15 +1,17 @@
import { defineComponent, reactive, Transition } from 'vue'
import useRouterStore from '@/useRouterStore'
import request from '@/utils/request'
+import useUserStore from './useUserStore'
export default defineComponent(() => {
const router = useRouterStore()
+ const user = useUserStore()
const form = reactive({
email: '',
password: ''
})
return () => (
-
+
{router.path === 'global-login' && (
{