diff --git a/public/icons/weatherIcon.png b/public/icons/weatherIcon.png new file mode 100644 index 0000000..e155bc7 Binary files /dev/null and b/public/icons/weatherIcon.png differ diff --git a/src/layout/GlobalMenu.tsx b/src/layout/GlobalMenu.tsx index c131f23..f052179 100644 --- a/src/layout/GlobalMenu.tsx +++ b/src/layout/GlobalMenu.tsx @@ -155,6 +155,23 @@ export default defineComponent(() => { > 大 + { + + menu.dismiss() + const idx = layout.currentPage.list.findIndex((el) => el.id === block.id) + if (idx < 0) return + layout.state.dir[id].list.forEach(val => { + layout.addBlock(val, layout.state.currentPage) + + }) + layout.currentPage.list.splice(idx, 1) + delete layout.state.dir[id] + menu.dismiss() + }} + > + 释放 + { diff --git a/src/layout/background/BackgroundPage.tsx b/src/layout/background/BackgroundPage.tsx index 73c9d70..6b3b8dd 100644 --- a/src/layout/background/BackgroundPage.tsx +++ b/src/layout/background/BackgroundPage.tsx @@ -7,9 +7,12 @@ import { DownloadOutlined, EyeInvisibleOutlined, SwapOutlined } from '@ant-desig import SettingItem from '@/settings/SettingItem' import useSettingsStore from '@/settings/useSettingsStore' import { v4 as uuid } from 'uuid' +import useRouterStore from '@/useRouterStore' export default defineComponent(() => { const layout = useLayoutStore() + const router = useRouterStore() + const selected = ref(0) watch( () => layout.state.current, @@ -55,7 +58,11 @@ export default defineComponent(() => { )}
-
+ ) + } +}) \ No newline at end of file diff --git a/src/settings/SettingsOverlay.tsx b/src/settings/SettingsOverlay.tsx index 9598b4e..bb6efca 100644 --- a/src/settings/SettingsOverlay.tsx +++ b/src/settings/SettingsOverlay.tsx @@ -1,6 +1,7 @@ import AvatarCircle from '@/user/AvatarCircle' import useRouterStore from '@/useRouterStore' import asyncLoader from '@/utils/asyncLoader' +import { OhVueIcon } from 'oh-vue-icons' import { computed, defineComponent, Transition } from 'vue' const Content = asyncLoader(() => import('./SettingsOverlayContent')) @@ -51,31 +52,45 @@ export default defineComponent(() => { {show.value && (
-
-
{ - router.path = 'settings-user' - }} - > -
- -
-
- - - - - - - - - -
- + { + router.path.startsWith('settings-') ? + <> +
+
{ + router.path = 'settings-user' + }} + > +
+ +
+
+ + + + + + + + + +
+ + + : + router.path.startsWith('s2') ? + <> +
+
+ + : '' + + } +
)}
diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts new file mode 100644 index 0000000..d84755a --- /dev/null +++ b/src/vite-env.d.ts @@ -0,0 +1,8 @@ +declare module '*.vue' { + import type { DefineComponent } from 'vue' + import Vue from 'vue' + + const component: DefineComponent<{}, {}, any> | Vue + + export default component + } \ No newline at end of file diff --git a/src/widgets/index.ts b/src/widgets/index.ts index 3d348aa..7957d90 100644 --- a/src/widgets/index.ts +++ b/src/widgets/index.ts @@ -1,6 +1,6 @@ import type { Component } from 'vue' import calendar from './calendar' - +import weather from './weather' export interface Widget { name: string // 小组件类型唯一标识 label: string // 小组件名称 @@ -15,4 +15,4 @@ export interface Widget { }[] // 不同尺寸小组件块 } -export default [calendar] as Widget[] +export default [calendar, weather] as Widget[] diff --git a/src/widgets/weather/Large.tsx b/src/widgets/weather/Large.tsx new file mode 100644 index 0000000..9c16be7 --- /dev/null +++ b/src/widgets/weather/Large.tsx @@ -0,0 +1,5 @@ +import { defineComponent } from 'vue' + +export default defineComponent(() => { + return () =>
+}) diff --git a/src/widgets/weather/Middle.tsx b/src/widgets/weather/Middle.tsx new file mode 100644 index 0000000..9c16be7 --- /dev/null +++ b/src/widgets/weather/Middle.tsx @@ -0,0 +1,5 @@ +import { defineComponent } from 'vue' + +export default defineComponent(() => { + return () =>
+}) diff --git a/src/widgets/weather/Modal.tsx b/src/widgets/weather/Modal.tsx new file mode 100644 index 0000000..9c16be7 --- /dev/null +++ b/src/widgets/weather/Modal.tsx @@ -0,0 +1,5 @@ +import { defineComponent } from 'vue' + +export default defineComponent(() => { + return () =>
+}) diff --git a/src/widgets/weather/Small.tsx b/src/widgets/weather/Small.tsx new file mode 100644 index 0000000..9c16be7 --- /dev/null +++ b/src/widgets/weather/Small.tsx @@ -0,0 +1,5 @@ +import { defineComponent } from 'vue' + +export default defineComponent(() => { + return () =>
+}) diff --git a/src/widgets/weather/index.ts b/src/widgets/weather/index.ts new file mode 100644 index 0000000..a6e16a3 --- /dev/null +++ b/src/widgets/weather/index.ts @@ -0,0 +1,29 @@ +import type { Widget } from '..' + +export default { + name: 'calendar', + label: '天气', + description: '天气资讯', + icon: '/icons/weatherIcon.png', + modal: () => import('./Modal'), + list: [ + { + w: 2, + h: 1, + label: '小', + component: () => import('./Small') + }, + { + w: 2, + h: 2, + label: '中', + component: () => import('./Middle') + }, + { + w: 4, + h: 2, + label: '大', + component: () => import('./Large') + } + ] +} as Widget diff --git a/tsconfig.json b/tsconfig.json index 66b5e57..8577b47 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,5 +7,8 @@ { "path": "./tsconfig.app.json" } + ], + "exclude": [ + "src/utils/UploadAndCut.tsx", ] }