Compare commits

..

No commits in common. "dev" and "master" have entirely different histories.
dev ... master

13 changed files with 112 additions and 178 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

View File

@ -31,7 +31,7 @@ const router = useRouterStore()
const layout = useLayoutStore() const layout = useLayoutStore()
</script> </script>
<template> <template>
<ConfigProvider :locale="zhCN"> <!-- <ConfigProvider :locale="zhCN"> -->
<div class="fixed left-0 top-0 w-full h-screen style-root" @contextmenu.prevent> <div class="fixed left-0 top-0 w-full h-screen style-root" @contextmenu.prevent>
<Header /> <Header />
<Background <Background
@ -78,7 +78,7 @@ const layout = useLayoutStore()
<BackupRecovery v-if="router.path === 'global-backup'"></BackupRecovery> <BackupRecovery v-if="router.path === 'global-backup'"></BackupRecovery>
</div> </div>
<ModalPgae /> <ModalPgae />
</ConfigProvider> <!-- </ConfigProvider> -->
</template> </template>
<style lang="less"> <style lang="less">

View File

@ -14,12 +14,9 @@ export const ossCdnBase = import.meta.env.PROD
: 'https://oss.goosetab.com' : 'https://oss.goosetab.com'
// 后端地址 // 后端地址
// export const apiBase = import.meta.env.PROD
// ? 'https://goosetab.com/api'
// : 'http://192.168.110.28:8300'
export const apiBase = import.meta.env.PROD export const apiBase = import.meta.env.PROD
? 'https://goosetab.com/api' ? 'https://goosetab.com/api'
: 'https://goosetab.com/api' : 'http://192.168.110.28:8300'
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NzJkYjg5OGUxMjY5NDc1ODYwMmYwMTgifQ.8fpdr_HPgxyU0yr-8f6nGdbHYjsFRlBa2lvjc0Zhe-A // eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NzJkYjg5OGUxMjY5NDc1ODYwMmYwMTgifQ.8fpdr_HPgxyU0yr-8f6nGdbHYjsFRlBa2lvjc0Zhe-A
// 图片后缀名 // 图片后缀名
export const imgArr = [ export const imgArr = [

View File

@ -9,8 +9,6 @@ import useRouterStore from '@/useRouterStore'
import useSearchStore from '@/layout/header/search/useSearchStore' import useSearchStore from '@/layout/header/search/useSearchStore'
import useLayoutStore from '@/layout/useLayoutStore' import useLayoutStore from '@/layout/useLayoutStore'
import { sendParent } from '@/utils/parent' import { sendParent } from '@/utils/parent'
import FoxImg from '~/fox.jpg'
import clsx from 'clsx'
const stageStrList = [ const stageStrList = [
'dazhaohu', 'dazhaohu',
@ -124,17 +122,7 @@ export default defineComponent(() => {
} }
) )
return () => ( return () => (
<>
<img
src={FoxImg}
onClick={() => {
run('aixin')
sendParent(['openSide'])
}}
class={clsx('cursor-pointer fixed w-[40px] right-0 bottom-10 ', layout.isCompact ? 'block' : 'hidden')}
></img>
<canvas <canvas
class={clsx(layout.isCompact ? 'hidden' : 'block')}
ref={(el) => (container = el as any)} ref={(el) => (container = el as any)}
onMouseenter={() => { onMouseenter={() => {
run('dianji') run('dianji')
@ -144,6 +132,5 @@ export default defineComponent(() => {
sendParent(['openSide']) sendParent(['openSide'])
}} }}
/> />
</>
) )
}) })

View File

@ -97,6 +97,7 @@ export const LinkItem = defineComponent({
w: 1, w: 1,
h: 1 h: 1
}) })
globalToast.success('添加成功')
} else { } else {
layout.addBlock( layout.addBlock(
{ {
@ -117,7 +118,6 @@ export const LinkItem = defineComponent({
layout.state.currentPage = addTo?.value layout.state.currentPage = addTo?.value
} }
} }
globalToast.success('添加成功')
}} }}
> >

View File

@ -5,7 +5,6 @@ import clsx from 'clsx'
import { AddToToken } from './AdderPage' import { AddToToken } from './AdderPage'
import { v4 as uuid } from 'uuid' import { v4 as uuid } from 'uuid'
import useAdderPageStore from './useAdderPageStore' import useAdderPageStore from './useAdderPageStore'
import { globalToast } from '@/main'
export const WidgetItem = defineComponent({ export const WidgetItem = defineComponent({
props: { props: {
@ -106,8 +105,6 @@ export const WidgetItem = defineComponent({
}, },
addTo?.value addTo?.value
) )
globalToast.success('添加成功')
}} }}
> >

View File

@ -9,28 +9,22 @@ import { sendParent } from '@/utils/parent'
export default defineComponent({ export default defineComponent({
setup() { setup() {
const settings = useSettingsStore() const settings = useSettingsStore()
const layout = useLayoutStore()
watch( watch(
() => ({ () => ({
autoSearch: settings.state.autoUseAi === 'auto', autoSearch: settings.state.autoUseAi === 'show',
showTabButton: settings.state.showPetOnTab, showTabButton: settings.state.showPetOnTab,
ifSearch: settings.state.autoUseAi !== '' isSearch: settings.state.autoUseAi === ''
}), }),
(val) => { (val) => {
sendParent([ sendParent([
'configAI', 'configAI',
{ {
autoSearch: val.autoSearch, autoSearch: val.autoSearch,
showTabButton: val.showTabButton, showTabButton: val.showTabButton,
ifSearch: val.ifSearch isSearch: val.isSearch
} }
]) ])
console.log({
autoSearch: val.autoSearch,
showTabButton: val.showTabButton,
ifSearch: val.ifSearch
});
}, },
{ {
immediate: true immediate: true
@ -63,21 +57,6 @@ export default defineComponent({
> >
</span> </span>
<SettingItem
v-slots={{
label: () => <div></div>
}}
desc="浏览其它网页时的侧边栏功能"
noRoundedT
>
<Switch
checked={settings.state.showPetOnTab}
onUpdate:checked={(e) => {
if (e) settings.state.showPetOnTab = true
else settings.state.showPetOnTab = false
}}
/>
</SettingItem>
<SettingItem <SettingItem
v-slots={{ v-slots={{
label: () => <div></div> label: () => <div></div>
@ -93,7 +72,21 @@ export default defineComponent({
}} }}
/> />
</SettingItem> </SettingItem>
<SettingItem
v-slots={{
label: () => <div></div>
}}
desc="fatfox标签页内的小助手"
noRoundedT
>
<Switch
checked={settings.state.showPetOnTab}
onUpdate:checked={(e) => {
if (e) settings.state.showPetOnTab = true
else settings.state.showPetOnTab = false
}}
/>
</SettingItem>
<span <span
class={clsx( class={clsx(
'text-[14px] font-bold my-2', 'text-[14px] font-bold my-2',
@ -117,7 +110,7 @@ export default defineComponent({
/> />
</SettingItem> </SettingItem>
{/* <div <div
class={clsx('flex w-full py-2 px-3 rounded-lg flex-col', { class={clsx('flex w-full py-2 px-3 rounded-lg flex-col', {
'bg-black/5': useLayoutStore().state.current !== 0, 'bg-black/5': useLayoutStore().state.current !== 0,
'bg-white/10': useLayoutStore().state.current === 0 'bg-white/10': useLayoutStore().state.current === 0
@ -132,11 +125,14 @@ export default defineComponent({
desc="每次搜索直接询问fatfox" desc="每次搜索直接询问fatfox"
> >
<Radio <Radio
checked={settings.state.autoUseAi === 'auto'} checked={settings.state.autoUseAi === 'show'}
onClick={() => { onClick={() => {
settings.state.autoUseAi = 'auto' settings.state.autoUseAi = 'show'
}}
onUpdate:checked={(e) => {
if (e) settings.state.showSider = 'auto'
else settings.state.showSider = 'show'
}} }}
/> />
</SettingItem> </SettingItem>
<SettingItem <SettingItem
@ -147,13 +143,13 @@ export default defineComponent({
desc="每次搜索,提示您进行手动查询" desc="每次搜索,提示您进行手动查询"
> >
<Radio <Radio
checked={settings.state.autoUseAi === 'show'} checked={settings.state.autoUseAi === 'auto'}
onClick={() => { onClick={() => {
settings.state.autoUseAi = 'show' settings.state.autoUseAi = 'auto'
}} }}
/> />
</SettingItem> </SettingItem>
</div> */} </div>
</div> </div>
) )
} }

View File

@ -10,7 +10,6 @@ import useSettingsStore from '@/settings/useSettingsStore'
import { useMenuStore } from '../GlobalMenu' import { useMenuStore } from '../GlobalMenu'
import { block } from '@milkdown/kit/plugin/block' import { block } from '@milkdown/kit/plugin/block'
import clsx from 'clsx' import clsx from 'clsx'
import dayjs from 'dayjs'
export default defineComponent({ export default defineComponent({
props: { props: {
@ -29,8 +28,6 @@ export default defineComponent({
const menu = useMenuStore() const menu = useMenuStore()
let it: any = 0 let it: any = 0
const hover = ref(false) const hover = ref(false)
const canPut = ref(false)
let enterTime: any = null;
return () => ( return () => (
<div <div
class={clsx( class={clsx(
@ -45,40 +42,19 @@ export default defineComponent({
transition: 'border .3s, transform .2s' transition: 'border .3s, transform .2s'
// border: hover.value ? '2px solid rgba(255,255,255,.5)' : '2px solid rgba(255,255,255,0)' // border: hover.value ? '2px solid rgba(255,255,255,.5)' : '2px solid rgba(255,255,255,0)'
}} }}
onDblclick={e => { onDblclick={e=> {
e.stopPropagation() e.stopPropagation()
}} }}
data-transportable={props.block.link && !props.block.link.startsWith('id:') ? '1' : ''} data-transportable={props.block.link && !props.block.link.startsWith('id:') ? '1' : ''}
onDragenter={() => {
enterTime = Date.now()
}}
onDragover={(e) => { onDragover={(e) => {
e.preventDefault() e.preventDefault()
clearTimeout(it) clearTimeout(it)
hover.value = true hover.value = true
if (enterTime && (Date.now() - enterTime >= 300)) {
// 在这里执行你想要的操作,比如改变目标元素的样式或者触发其他函数
canPut.value = true
}else {
canPut.value = false
}
it = setTimeout(() => { it = setTimeout(() => {
hover.value = false hover.value = false
canPut.value = false
}, 300) }, 300)
}} }}
onDrop={() => { onDrop={() => {
canPut.value = false
if (enterTime && (Date.now() - enterTime < 300)) {
// 在这里执行你想要的操作,比如改变目标元素的样式或者触发其他函数
return
}
enterTime = null;
// 处理移入 // 处理移入
if (!dragging.id) return if (!dragging.id) return
if (dragging.type === 'dock') { if (dragging.type === 'dock') {
@ -150,11 +126,9 @@ export default defineComponent({
layout.checkDir(dragging.type) layout.checkDir(dragging.type)
resetDragging() resetDragging()
} }
} }}
}
> >
{ {menu.isEditPage && (
menu.isEditPage && (
<div <div
v-outside-click={() => { v-outside-click={() => {
menu.isEditPage = false menu.isEditPage = false
@ -179,13 +153,10 @@ export default defineComponent({
backgroundSize: 'cover' backgroundSize: 'cover'
}} }}
></div> ></div>
)
}
< div
class={clsx("w-full h-full overflow-hidden relative cursor-pointer shadow-lg hover-move ",
canPut.value ? "border-[#ddd]/80 border-[4px]" : "border-transparent"
)} )}
<div
class="w-full h-full overflow-hidden relative cursor-pointer shadow-lg hover-move "
style={{ style={{
borderRadius: `calc(var(--block-radius) * var(--block-size))`, borderRadius: `calc(var(--block-radius) * var(--block-size))`,
transition: 'transform 0.2s' transition: 'transform 0.2s'
@ -195,8 +166,7 @@ export default defineComponent({
e.preventDefault() e.preventDefault()
}} }}
> >
{ {props.block.link ? (
props.block.link ? (
props.block.link.startsWith('id:') ? ( props.block.link.startsWith('id:') ? (
// 文件夹 // 文件夹
<DirBlock block={props.block} big={props.block.w !== 1 || props.block.h !== 1} /> <DirBlock block={props.block} big={props.block.w !== 1 || props.block.h !== 1} />
@ -207,20 +177,17 @@ export default defineComponent({
) : ( ) : (
// 小组件 // 小组件
<WidgetBlock block={props.block} /> <WidgetBlock block={props.block} />
) )}
} </div>
</div > {settings.state.showBlockLabel && (
{
settings.state.showBlockLabel && (
<div <div
class="absolute left-1/2 -translate-x-1/2 -bottom-3 text-sm text-white text-center w-[172px] overflow-hidden text-ellipsis whitespace-nowrap break-all font-bold" class="absolute left-1/2 -translate-x-1/2 -bottom-3 text-sm text-white text-center w-[172px] overflow-hidden text-ellipsis whitespace-nowrap break-all font-bold"
style="text-shadow: 0 0 4px rgba(0,0,0,.6)" style="text-shadow: 0 0 4px rgba(0,0,0,.6)"
> >
{layout.getLabel(props.block)} {layout.getLabel(props.block)}
</div> </div>
) )}
} </div>
</div >
) )
} }
}) })

View File

@ -85,24 +85,9 @@ export default defineStore('user', () => {
}, },
{ immediate: true } { immediate: true }
) )
const comineData = () => {
if (!remoteAddList.value) return
remoteAddList.value.map((item) => {
if (item.link)
layout.state.content[layout.state.current].pages[layout.state.currentPage].list.push(item)
})
}
const coverageData = () => {
if (!remoteData.value) return
Object.assign(layout.state.content, remoteData.value.content)
Object.assign(layout.state.dock, remoteData.value.dock)
Object.assign(layout.state.dir, remoteData.value.dir)
}
watch(() => profile.username, async (val) => {
console.log(val);
watch(token, async (val) => {
if (!val) return if (!val) return
console.log('开始比较');
const data = await request<Layout>('GET', '/api/backup') const data = await request<Layout>('GET', '/api/backup')
if (!data) { if (!data) {
@ -128,16 +113,27 @@ export default defineStore('user', () => {
// TODO: 交给张阳 // TODO: 交给张阳
// remoteAddList.value = addList // remoteAddList.value = addList
remoteData.value = data remoteData.value = data
coverageData()
useRouterStore().go('global-backup')
} }
}, {
immediate: true
}) })
const logout = () => { const logout = () => {
token.value = '' token.value = ''
Object.assign(profile, { ...defaultUserInfo }) Object.assign(profile, { ...defaultUserInfo })
} }
const comineData = () => {
if (!remoteAddList.value) return
remoteAddList.value.map((item) => {
if (item.link)
layout.state.content[layout.state.current].pages[layout.state.currentPage].list.push(item)
})
}
const coverageData = () => {
if (!remoteData.value) return
Object.assign(layout.state.content, remoteData.value.content)
Object.assign(layout.state.dock, remoteData.value.dock)
Object.assign(layout.state.dir, remoteData.value.dir)
}
const updateProfile = () => { const updateProfile = () => {
request('PUT', '/api/profile', { request('PUT', '/api/profile', {
returnType: 'text', returnType: 'text',

View File

@ -9,10 +9,9 @@ export function sendParent(
{ {
autoSearch: boolean autoSearch: boolean
showTabButton: boolean showTabButton: boolean
ifSearch: boolean isSearch: boolean
} }
] ]
| ['information', string]
) { ) {
parent.window.postMessage( parent.window.postMessage(
{ {

View File

@ -26,7 +26,7 @@ export default defineComponent(() => {
'w-full bg-white/20 text-center rounded text-[14px] overflow-hidden text-ellipsis whitespace-nowrap' 'w-full bg-white/20 text-center rounded text-[14px] overflow-hidden text-ellipsis whitespace-nowrap'
} }
> >
{store.state.list.length !== 0 ? store.state.list.filter((val) => !val.isCompleted).pop()?.title : '无目标'} {store.state.list ? store.state.list.filter((val) => !val.isCompleted).pop()?.title : '无目标'}
</div> </div>
<span class={'text-[42px] mb-1'}> <span class={'text-[42px] mb-1'}>
{store.state.beginTime < 0 ? '15:00' : formatSeconds(store.remainingTime)} {store.state.beginTime < 0 ? '15:00' : formatSeconds(store.remainingTime)}

View File

@ -1,5 +1,3 @@
import { sendParent } from "@/utils/parent";
import { generateRandomString } from "@/utils/tool";
import useTimeStore from "@/utils/useTimeStore"; import useTimeStore from "@/utils/useTimeStore";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { defineStore } from "pinia"; import { defineStore } from "pinia";
@ -99,13 +97,10 @@ export default defineStore("work", () => {
stopTomatoTime() stopTomatoTime()
} }
// sendParent(['information', '恭喜你完成了一个番茄钟' + generateRandomString(4)])
if (remainingTime.value === 0) { if (remainingTime.value === 0) {
state.timeList.push( state.timeList.push(
dayjs().valueOf() dayjs().valueOf()
) )
sendParent(['information', '恭喜你完成了一个番茄钟'])
} }
}) })
const openShowModel = ref<undefined | null | TomatoTarget>() const openShowModel = ref<undefined | null | TomatoTarget>()