Merge remote-tracking branch 'origin/weather'
This commit is contained in:
commit
5c3bd6b7b3
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
|
@ -155,6 +155,23 @@ export default defineComponent(() => {
|
|||
>
|
||||
大
|
||||
</Item>
|
||||
<Item
|
||||
onClick={() => {
|
||||
|
||||
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()
|
||||
}}
|
||||
>
|
||||
释放
|
||||
</Item>
|
||||
<Item
|
||||
alert
|
||||
onClick={() => {
|
||||
|
|
|
@ -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(() => {
|
|||
)}
|
||||
</div>
|
||||
<div class="flex justify-between items-center py-4">
|
||||
<Button type="primary" icon={<SwapOutlined />}>
|
||||
<Button type="primary" icon={<SwapOutlined />}
|
||||
onClick={()=> {
|
||||
router.path = ''
|
||||
router.path = 's2-background'
|
||||
}}>
|
||||
更换壁纸
|
||||
</Button>
|
||||
<Button
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
import { defineComponent } from "vue";
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
return (
|
||||
<div>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
})
|
|
@ -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(() => {
|
|||
<Transition name="settings">
|
||||
{show.value && (
|
||||
<div class="absolute left-6 bottom-20 w-[600px] h-[480px] rounded-lg overflow-hidden shadow-2xl flex">
|
||||
<div class="w-[200px] p-4 h-full bg-white/60 backdrop-blur flex flex-col">
|
||||
<div
|
||||
class={
|
||||
'w-full h-0 flex-grow mb-4 rounded-lg hover:bg-white/70 transition-all cursor-pointer flex justify-center items-center ' +
|
||||
(router.path === 'settings-user' ? 'bg-white/70 shadow-lg' : '')
|
||||
}
|
||||
onClick={() => {
|
||||
router.path = 'settings-user'
|
||||
}}
|
||||
>
|
||||
<div class="w-12 h-12 relative">
|
||||
<AvatarCircle />
|
||||
</div>
|
||||
</div>
|
||||
<SettingsTab label="壁纸" path="settings-background" />
|
||||
<SettingsTab label="图标" path="settings-block" />
|
||||
<SettingsTab label="搜索" path="settings-search" />
|
||||
<SettingsTab label="时间" path="settings-time" />
|
||||
<SettingsTab label="侧边栏" path="settings-sider" />
|
||||
<SettingsTab label="AI助手" path="settings-ai" />
|
||||
<SettingsTab label="快捷栏" path="settings-dock" />
|
||||
<SettingsTab label="重置" path="settings-reset" />
|
||||
<SettingsTab label="问题反馈" path="settings-fallback" />
|
||||
</div>
|
||||
<Content />
|
||||
{
|
||||
router.path.startsWith('settings-') ?
|
||||
<>
|
||||
<div class="w-[200px] p-4 h-full bg-white/60 backdrop-blur flex flex-col">
|
||||
<div
|
||||
class={
|
||||
'w-full h-0 flex-grow mb-4 rounded-lg hover:bg-white/70 transition-all cursor-pointer flex justify-center items-center ' +
|
||||
(router.path === 'settings-user' ? 'bg-white/70 shadow-lg' : '')
|
||||
}
|
||||
onClick={() => {
|
||||
router.path = 'settings-user'
|
||||
}}
|
||||
>
|
||||
<div class="w-12 h-12 relative">
|
||||
<AvatarCircle />
|
||||
</div>
|
||||
</div>
|
||||
<SettingsTab label="壁纸" path="settings-background" />
|
||||
<SettingsTab label="图标" path="settings-block" />
|
||||
<SettingsTab label="搜索" path="settings-search" />
|
||||
<SettingsTab label="时间" path="settings-time" />
|
||||
<SettingsTab label="侧边栏" path="settings-sider" />
|
||||
<SettingsTab label="AI助手" path="settings-ai" />
|
||||
<SettingsTab label="快捷栏" path="settings-dock" />
|
||||
<SettingsTab label="重置" path="settings-reset" />
|
||||
<SettingsTab label="问题反馈" path="settings-fallback" />
|
||||
</div>
|
||||
<Content />
|
||||
</>
|
||||
:
|
||||
router.path.startsWith('s2') ?
|
||||
<>
|
||||
<div class="w-full h-full flex justify-center items-center bg-red-300">
|
||||
</div>
|
||||
</>
|
||||
: ''
|
||||
|
||||
}
|
||||
|
||||
</div>
|
||||
)}
|
||||
</Transition>
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
declare module '*.vue' {
|
||||
import type { DefineComponent } from 'vue'
|
||||
import Vue from 'vue'
|
||||
|
||||
const component: DefineComponent<{}, {}, any> | Vue
|
||||
|
||||
export default component
|
||||
}
|
|
@ -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[]
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
import { defineComponent } from 'vue'
|
||||
|
||||
export default defineComponent(() => {
|
||||
return () => <div class="w-full h-full bg-red-50"></div>
|
||||
})
|
|
@ -0,0 +1,5 @@
|
|||
import { defineComponent } from 'vue'
|
||||
|
||||
export default defineComponent(() => {
|
||||
return () => <div class="w-full h-full bg-red-50"></div>
|
||||
})
|
|
@ -0,0 +1,5 @@
|
|||
import { defineComponent } from 'vue'
|
||||
|
||||
export default defineComponent(() => {
|
||||
return () => <div class="w-full h-full bg-red-50"></div>
|
||||
})
|
|
@ -0,0 +1,5 @@
|
|||
import { defineComponent } from 'vue'
|
||||
|
||||
export default defineComponent(() => {
|
||||
return () => <div class="w-full h-full bg-red-50"></div>
|
||||
})
|
|
@ -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
|
|
@ -7,5 +7,8 @@
|
|||
{
|
||||
"path": "./tsconfig.app.json"
|
||||
}
|
||||
],
|
||||
"exclude": [
|
||||
"src/utils/UploadAndCut.tsx",
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue