diff --git a/public/bg/addBorder.png b/public/bg/addBorder.png new file mode 100644 index 0000000..20d98e1 Binary files /dev/null and b/public/bg/addBorder.png differ diff --git a/src/layout/background/BackgroundPage.tsx b/src/layout/background/BackgroundPage.tsx index 997a2d8..2a47b51 100644 --- a/src/layout/background/BackgroundPage.tsx +++ b/src/layout/background/BackgroundPage.tsx @@ -1,4 +1,4 @@ -import { Button, Select, Slider } from 'ant-design-vue' +import { Button, Slider } from 'ant-design-vue' import { defineComponent, ref, Transition, watch } from 'vue' import useLayoutStore from '../useLayoutStore' import { DownloadOutlined, EyeInvisibleOutlined, SwapOutlined } from '@ant-design/icons-vue' @@ -23,7 +23,7 @@ export default defineComponent(() => { const settings = useSettingsStore() return () => (
-
所属模式
@@ -38,7 +38,7 @@ export default defineComponent(() => { ]} v-model:value={selected.value} /> -
+ */}
{layout.background.video && layout.background.type !== 'own' ? ( diff --git a/src/layout/grid/Reset.tsx b/src/layout/grid/Reset.tsx index ce91683..f2bd9ff 100644 --- a/src/layout/grid/Reset.tsx +++ b/src/layout/grid/Reset.tsx @@ -1,23 +1,65 @@ import SettingItem from '@/settings/SettingItem' import useSettingsStore from '@/settings/useSettingsStore' -import { Button, Switch } from 'ant-design-vue' +import { Button, Modal, Switch } from 'ant-design-vue' import clsx from 'clsx' -import { defineComponent } from 'vue' +import { computed, defineComponent, ref } from 'vue' +import useLayoutStore from '../useLayoutStore' export default defineComponent({ setup() { const settings = useSettingsStore() + const open = ref(false) + const layout = useLayoutStore() + const isGame = computed(() => { + return layout.state.current === 0 + }) return () => (
重置
+ label: () =>
重置
}} > - +

将会把您的历史调整清空,恢复成最初的样式

-
+ { + open.value && +
+ +
+ 恢复提醒 +
+ 此操作会将您的历史调整的数据清空,为防止您的误操作,请再次确认是否要进行重置 +
+ + + +
+
+
+ } + +
) } }) diff --git a/src/layout/useLayoutStore.ts b/src/layout/useLayoutStore.ts index a05c391..766b523 100644 --- a/src/layout/useLayoutStore.ts +++ b/src/layout/useLayoutStore.ts @@ -26,7 +26,7 @@ const defaultLayout: Layout = { export default defineStore('layout', () => { const settings = useSettingsStore() const user = useUserStore() - const state = reactive(defaultLayout) + const state = reactive({ ...defaultLayout }) const ready = ref(false) db.getItem('layout').then((res) => { @@ -112,7 +112,17 @@ export default defineStore('layout', () => { } return block.label || '' } + const resetAll = () => { + request('GET', '/api/app/desktop').then((res: any) => { + if (!res) return + state.dir = res.dir + state.content = res.content + }).catch(() => { + Object.assign(state, defaultLayout) + + }) + } const changeBackground = (url: string) => { state.content[state.current].background = url } @@ -161,6 +171,7 @@ export default defineStore('layout', () => { openDir, checkDir, getLabel, - changeBackground + changeBackground, + resetAll } }) diff --git a/src/settings/SettingsOverlay.tsx b/src/settings/SettingsOverlay.tsx index 596616e..253b68e 100644 --- a/src/settings/SettingsOverlay.tsx +++ b/src/settings/SettingsOverlay.tsx @@ -4,7 +4,6 @@ import useUserStore from '@/user/useUserStore' import useRouterStore from '@/useRouterStore' import asyncLoader from '@/utils/asyncLoader' import clsx from 'clsx' -import { OhVueIcon } from 'oh-vue-icons' import { computed, defineComponent, Transition } from 'vue' import SettingLineImg from '~/icons/settingLine.png' const Content = asyncLoader(() => import('./SettingsOverlayContent')) @@ -58,7 +57,7 @@ export default defineComponent(() => { return layout.state.current === 0 }) return () => ( -
+
{/* 背景遮罩 */} {show.value && (
{ {show.value && (
@@ -107,7 +113,7 @@ export default defineComponent(() => { onClick={() => { if (profile.id) { router.go('settings-user') - }else { + } else { router.go('global-login') } // router.go('settings-user') @@ -135,7 +141,10 @@ export default defineComponent(() => {
- +
+ + +
)} diff --git a/src/settings/SettingsOverlayContent.tsx b/src/settings/SettingsOverlayContent.tsx index 2958cb3..4e9792d 100644 --- a/src/settings/SettingsOverlayContent.tsx +++ b/src/settings/SettingsOverlayContent.tsx @@ -15,7 +15,7 @@ export default defineComponent(() => { const router = useRouterStore() return () => ( -
+
{router.path === 'settings-user' ? (