From 36881f1fd31554b73d07e67a631c61ab61c5df03 Mon Sep 17 00:00:00 2001 From: expdsn <18111002318@163.com> Date: Sun, 29 Sep 2024 15:17:52 +0800 Subject: [PATCH] svae --- public/icons/weatherIcon.png | Bin 0 -> 3539 bytes src/layout/GlobalMenu.tsx | 17 ++++++ src/layout/background/BackgroundPage.tsx | 9 ++- src/layout/background/BackgroundSwtich.tsx | 11 ++++ src/settings/SettingsOverlay.tsx | 65 +++++++++++++-------- src/useRouterStore.ts | 4 +- src/vite-env.d.ts | 8 +++ src/widgets/index.ts | 4 +- src/widgets/weather/Large.tsx | 5 ++ src/widgets/weather/Middle.tsx | 5 ++ src/widgets/weather/Modal.tsx | 5 ++ src/widgets/weather/Small.tsx | 5 ++ src/widgets/weather/index.ts | 29 +++++++++ tsconfig.json | 3 + 14 files changed, 141 insertions(+), 29 deletions(-) create mode 100644 public/icons/weatherIcon.png create mode 100644 src/layout/background/BackgroundSwtich.tsx create mode 100644 src/vite-env.d.ts create mode 100644 src/widgets/weather/Large.tsx create mode 100644 src/widgets/weather/Middle.tsx create mode 100644 src/widgets/weather/Modal.tsx create mode 100644 src/widgets/weather/Small.tsx create mode 100644 src/widgets/weather/index.ts diff --git a/public/icons/weatherIcon.png b/public/icons/weatherIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..e155bc73cdb45fa7cdf815e6798fd98b61fa8ed4 GIT binary patch literal 3539 zcmV;^4J`7BP)Px?jY&j7RCr$1n+cFq#Tmzcy*qmXf&>tSs2gQjh?+z#qp2(yqexVYzycnridwNM z6^}B9CLT%Q5l|Eq6ylMpM53mm2pSI}UReloMTIDZ!~+uoqO7neu)DK6)2V*f^y}CC zW(F}8sTy{7-ueB%|M&lY-Tj`R=szhY-%YcSoQdQlU>K4ErKAR_9US~F!|yEH)c(=e zrEb^G=lyCs&cBT=Bs(R%B_u0=rx#9T83_G|M6@C;{&VNb7MbH_V0d`pk^(d@ss0WD z(u2_UQ|DDT<2ru~ILrBC;Dp-+8wFgyaH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PiB6#YVdyBt5|6k*rOW+bqvd;hj N002ovPDHLkV1nJV)$#xU literal 0 HcmV?d00001 diff --git a/src/layout/GlobalMenu.tsx b/src/layout/GlobalMenu.tsx index 33a2c35..e30139c 100644 --- a/src/layout/GlobalMenu.tsx +++ b/src/layout/GlobalMenu.tsx @@ -142,6 +142,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/useRouterStore.ts b/src/useRouterStore.ts index d33bfa9..c9dc305 100644 --- a/src/useRouterStore.ts +++ b/src/useRouterStore.ts @@ -14,7 +14,9 @@ export type SettingStr = | 'dock' | 'reset' | 'fallback' -export type RouteStr = '' | `widget-${WidgetStr}` | `global-${GlobalStr}` | `settings-${SettingStr}` +export type SettingSecond = + | 'background' +export type RouteStr = '' | `widget-${WidgetStr}` | `global-${GlobalStr}` | `settings-${SettingStr}` | `s2-${SettingSecond}` export default defineStore('router', () => { const path = ref('') 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 5dd7fb1..2236740 100644 --- a/src/widgets/index.ts +++ b/src/widgets/index.ts @@ -1,5 +1,5 @@ import calendar from './calendar' - +import weather from './weather' export interface Widget { name: string // 小组件类型唯一标识 label: string // 小组件名称 @@ -14,4 +14,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", ] }