Compare commits

..

No commits in common. "f369a5104385ec8499f525d8d819d3926459f229" and "a1d97e0c105bec1f7f36b6fe78b9a62a2822d49b" have entirely different histories.

13 changed files with 64 additions and 98 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

View File

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

View File

@ -9,8 +9,6 @@ import useRouterStore from '@/useRouterStore'
import useSearchStore from '@/layout/header/search/useSearchStore'
import useLayoutStore from '@/layout/useLayoutStore'
import { sendParent } from '@/utils/parent'
import FoxImg from '~/fox.jpg'
import clsx from 'clsx'
const stageStrList = [
'dazhaohu',
@ -124,26 +122,15 @@ export default defineComponent(() => {
}
)
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
class={clsx(layout.isCompact ? 'hidden' : 'block')}
ref={(el) => (container = el as any)}
onMouseenter={() => {
run('dianji')
}}
onClick={() => {
run('aixin')
sendParent(['openSide'])
}}
/>
</>
<canvas
ref={(el) => (container = el as any)}
onMouseenter={() => {
run('dianji')
}}
onClick={() => {
run('aixin')
sendParent(['openSide'])
}}
/>
)
})

View File

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

View File

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

View File

@ -10,7 +10,6 @@ import useUserStore from '@/user/useUserStore'
import useRouterStore from '@/useRouterStore'
import useBackgroundStore from './useBackgroundStore'
import CustomWallpaper from './CustomWallpaper'
import { videoArr } from '@/config'
addIcons(BiChevronLeft, BiChevronDown)
@ -171,12 +170,7 @@ export default defineComponent(() => {
class="h-[156px] relative cursor-pointer group w-full flex-grow-0 rounded-xl overflow-hidden"
>
<img
src={
item.url +
(videoArr.includes(item.url.split('.').pop() || '')
? '?x-oss-process=video/snapshot,t_0,f_jpg,w_400,h_225,m_fast'
: '?x-oss-process=image/resize,w_300')
}
src={item.url + '?x-oss-process=image/resize,w_300'}
class=" duration-150 absolute w-full h-full object-cover flex-grow-0 rounded-xl group-hover:scale-[1.2]"
/>
<div

View File

@ -40,13 +40,20 @@ export default function useResource(tag: Ref<string>, type: string) {
if (videoArr.includes(suffix)) {
// 内部视频
// 先显示截图,再去数据库看是否有存货
resource.video = ''
resource.image = val + '?x-oss-process=video/snapshot,t_0,f_jpg,m_fast'
resource.brief = val + '?x-oss-process=video/snapshot,t_0,f_jpg,w_400,h_225,m_fast'
db.getItem<{ tag: string; file: Blob }[]>('videoList').then((res) => {
const handle = (res: any[] | undefined) => {
res = res || []
if (!res) return
const item = res.find((item) => item.tag === val)
if (item) {
resource.video = URL.createObjectURL(item.file)
resource.type = 'local'
} else {
// 不存在,需要存入
fetch(val)
.then((res) => res.blob())
.then((blob) => {
@ -54,23 +61,12 @@ export default function useResource(tag: Ref<string>, type: string) {
res.pop()
}
res.unshift({ tag: val, file: blob })
db.setItem('videoList', res)
resource.video = URL.createObjectURL(blob)
resource.type = 'own'
})
}
if (!res) {
handle(undefined)
return
}
const item = res.find((item) => item.tag === val)
if (item) {
resource.video = URL.createObjectURL(item.file)
resource.type = 'local'
} else {
handle(res)
}
})
} else {
// 图片
resource.image = val
@ -104,6 +100,7 @@ export default function useResource(tag: Ref<string>, type: string) {
const url = URL.createObjectURL(item.file)
resource.image = item.type === 'image' ? url : ''
resource.video = item.type === 'video' ? url : ''
resource.brief = url

View File

@ -9,28 +9,22 @@ import { sendParent } from '@/utils/parent'
export default defineComponent({
setup() {
const settings = useSettingsStore()
const layout = useLayoutStore()
watch(
() => ({
autoSearch: settings.state.autoUseAi === 'auto',
autoSearch: settings.state.autoUseAi === 'show',
showTabButton: settings.state.showPetOnTab,
ifSearch: settings.state.autoUseAi !== ''
isSearch: settings.state.autoUseAi === ''
}),
(val) => {
sendParent([
'configAI',
{
autoSearch: val.autoSearch,
showTabButton: val.showTabButton,
ifSearch: val.ifSearch
isSearch: val.isSearch
}
])
console.log({
autoSearch: val.autoSearch,
showTabButton: val.showTabButton,
ifSearch: val.ifSearch
});
},
{
immediate: true
@ -63,21 +57,6 @@ export default defineComponent({
>
</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
v-slots={{
label: () => <div></div>
@ -93,7 +72,21 @@ export default defineComponent({
}}
/>
</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
class={clsx(
'text-[14px] font-bold my-2',
@ -117,7 +110,7 @@ export default defineComponent({
/>
</SettingItem>
{/* <div
<div
class={clsx('flex w-full py-2 px-3 rounded-lg flex-col', {
'bg-black/5': useLayoutStore().state.current !== 0,
'bg-white/10': useLayoutStore().state.current === 0
@ -132,11 +125,14 @@ export default defineComponent({
desc="每次搜索直接询问fatfox"
>
<Radio
checked={settings.state.autoUseAi === 'auto'}
checked={settings.state.autoUseAi === 'show'}
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
@ -147,13 +143,13 @@ export default defineComponent({
desc="每次搜索,提示您进行手动查询"
>
<Radio
checked={settings.state.autoUseAi === 'show'}
checked={settings.state.autoUseAi === 'auto'}
onClick={() => {
settings.state.autoUseAi = 'show'
settings.state.autoUseAi = 'auto'
}}
/>
</SettingItem>
</div> */}
</div>
</div>
)
}

View File

@ -27,10 +27,10 @@ export default function useSortable(list: Ref<any[]>, type: Ref<string>) {
scrollSpeed: 10,
...(type.value === 'page'
? {
invertSwap: true,
invertedSwapThreshold: 1,
filter: '.operation-button'
}
invertSwap: true,
invertedSwapThreshold: 1,
filter: '.operation-button'
}
: {}),
ghostClass: 'opacity-0',
onStart: (e: any) => {

View File

@ -98,7 +98,7 @@ export default defineStore('user', () => {
Object.assign(layout.state.dock, remoteData.value.dock)
Object.assign(layout.state.dir, remoteData.value.dir)
}
watch(() => profile.username, async (val) => {
watch(() => profile.username, async (val, pre) => {
console.log(val);
if (!val) return
@ -138,6 +138,7 @@ export default defineStore('user', () => {
token.value = ''
Object.assign(profile, { ...defaultUserInfo })
}
const updateProfile = () => {
request('PUT', '/api/profile', {
returnType: 'text',

View File

@ -9,10 +9,9 @@ export function sendParent(
{
autoSearch: boolean
showTabButton: boolean
ifSearch: boolean
isSearch: boolean
}
]
| ['information', string]
) {
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'
}
>
{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>
<span class={'text-[42px] mb-1'}>
{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 dayjs from "dayjs";
import { defineStore } from "pinia";
@ -99,13 +97,10 @@ export default defineStore("work", () => {
stopTomatoTime()
}
// sendParent(['information', '恭喜你完成了一个番茄钟' + generateRandomString(4)])
if (remainingTime.value === 0) {
state.timeList.push(
dayjs().valueOf()
)
sendParent(['information', '恭喜你完成了一个番茄钟'])
}
})
const openShowModel = ref<undefined | null | TomatoTarget>()