Merge remote-tracking branch 'origin/weather'

This commit is contained in:
plightfield 2024-09-29 15:21:10 +08:00
commit 5c3bd6b7b3
13 changed files with 138 additions and 28 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -155,6 +155,23 @@ export default defineComponent(() => {
> >
</Item> </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 <Item
alert alert
onClick={() => { onClick={() => {

View File

@ -7,9 +7,12 @@ import { DownloadOutlined, EyeInvisibleOutlined, SwapOutlined } from '@ant-desig
import SettingItem from '@/settings/SettingItem' import SettingItem from '@/settings/SettingItem'
import useSettingsStore from '@/settings/useSettingsStore' import useSettingsStore from '@/settings/useSettingsStore'
import { v4 as uuid } from 'uuid' import { v4 as uuid } from 'uuid'
import useRouterStore from '@/useRouterStore'
export default defineComponent(() => { export default defineComponent(() => {
const layout = useLayoutStore() const layout = useLayoutStore()
const router = useRouterStore()
const selected = ref(0) const selected = ref(0)
watch( watch(
() => layout.state.current, () => layout.state.current,
@ -55,7 +58,11 @@ export default defineComponent(() => {
)} )}
</div> </div>
<div class="flex justify-between items-center py-4"> <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>
<Button <Button

View File

@ -0,0 +1,11 @@
import { defineComponent } from "vue";
export default defineComponent({
setup() {
return (
<div>
</div>
)
}
})

View File

@ -1,6 +1,7 @@
import AvatarCircle from '@/user/AvatarCircle' import AvatarCircle from '@/user/AvatarCircle'
import useRouterStore from '@/useRouterStore' import useRouterStore from '@/useRouterStore'
import asyncLoader from '@/utils/asyncLoader' import asyncLoader from '@/utils/asyncLoader'
import { OhVueIcon } from 'oh-vue-icons'
import { computed, defineComponent, Transition } from 'vue' import { computed, defineComponent, Transition } from 'vue'
const Content = asyncLoader(() => import('./SettingsOverlayContent')) const Content = asyncLoader(() => import('./SettingsOverlayContent'))
@ -51,6 +52,9 @@ export default defineComponent(() => {
<Transition name="settings"> <Transition name="settings">
{show.value && ( {show.value && (
<div class="absolute left-6 bottom-20 w-[600px] h-[480px] rounded-lg overflow-hidden shadow-2xl flex"> <div class="absolute left-6 bottom-20 w-[600px] h-[480px] rounded-lg overflow-hidden shadow-2xl flex">
{
router.path.startsWith('settings-') ?
<>
<div class="w-[200px] p-4 h-full bg-white/60 backdrop-blur flex flex-col"> <div class="w-[200px] p-4 h-full bg-white/60 backdrop-blur flex flex-col">
<div <div
class={ class={
@ -76,6 +80,17 @@ export default defineComponent(() => {
<SettingsTab label="问题反馈" path="settings-fallback" /> <SettingsTab label="问题反馈" path="settings-fallback" />
</div> </div>
<Content /> <Content />
</>
:
router.path.startsWith('s2') ?
<>
<div class="w-full h-full flex justify-center items-center bg-red-300">
</div>
</>
: ''
}
</div> </div>
)} )}
</Transition> </Transition>

8
src/vite-env.d.ts vendored Normal file
View File

@ -0,0 +1,8 @@
declare module '*.vue' {
import type { DefineComponent } from 'vue'
import Vue from 'vue'
const component: DefineComponent<{}, {}, any> | Vue
export default component
}

View File

@ -1,6 +1,6 @@
import type { Component } from 'vue' import type { Component } from 'vue'
import calendar from './calendar' import calendar from './calendar'
import weather from './weather'
export interface Widget { export interface Widget {
name: string // 小组件类型唯一标识 name: string // 小组件类型唯一标识
label: string // 小组件名称 label: string // 小组件名称
@ -15,4 +15,4 @@ export interface Widget {
}[] // 不同尺寸小组件块 }[] // 不同尺寸小组件块
} }
export default [calendar] as Widget[] export default [calendar, weather] as Widget[]

View File

@ -0,0 +1,5 @@
import { defineComponent } from 'vue'
export default defineComponent(() => {
return () => <div class="w-full h-full bg-red-50"></div>
})

View File

@ -0,0 +1,5 @@
import { defineComponent } from 'vue'
export default defineComponent(() => {
return () => <div class="w-full h-full bg-red-50"></div>
})

View File

@ -0,0 +1,5 @@
import { defineComponent } from 'vue'
export default defineComponent(() => {
return () => <div class="w-full h-full bg-red-50"></div>
})

View File

@ -0,0 +1,5 @@
import { defineComponent } from 'vue'
export default defineComponent(() => {
return () => <div class="w-full h-full bg-red-50"></div>
})

View File

@ -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

View File

@ -7,5 +7,8 @@
{ {
"path": "./tsconfig.app.json" "path": "./tsconfig.app.json"
} }
],
"exclude": [
"src/utils/UploadAndCut.tsx",
] ]
} }