Merge commit '7e68ebb5057275db12d7275f5df53b5a58961178' into dev
This commit is contained in:
commit
f369a51043
Binary file not shown.
After Width: | Height: | Size: 95 KiB |
|
@ -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">
|
||||||
|
|
|
@ -9,6 +9,8 @@ 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',
|
||||||
|
@ -122,15 +124,26 @@ export default defineComponent(() => {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return () => (
|
return () => (
|
||||||
<canvas
|
<>
|
||||||
ref={(el) => (container = el as any)}
|
<img
|
||||||
onMouseenter={() => {
|
src={FoxImg}
|
||||||
run('dianji')
|
onClick={() => {
|
||||||
}}
|
run('aixin')
|
||||||
onClick={() => {
|
sendParent(['openSide'])
|
||||||
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'])
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -97,7 +97,6 @@ export const LinkItem = defineComponent({
|
||||||
w: 1,
|
w: 1,
|
||||||
h: 1
|
h: 1
|
||||||
})
|
})
|
||||||
globalToast.success('添加成功')
|
|
||||||
} else {
|
} else {
|
||||||
layout.addBlock(
|
layout.addBlock(
|
||||||
{
|
{
|
||||||
|
@ -118,6 +117,7 @@ export const LinkItem = defineComponent({
|
||||||
layout.state.currentPage = addTo?.value
|
layout.state.currentPage = addTo?.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
globalToast.success('添加成功')
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
添加
|
添加
|
||||||
|
|
|
@ -5,6 +5,7 @@ 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: {
|
||||||
|
@ -105,6 +106,8 @@ export const WidgetItem = defineComponent({
|
||||||
},
|
},
|
||||||
addTo?.value
|
addTo?.value
|
||||||
)
|
)
|
||||||
|
globalToast.success('添加成功')
|
||||||
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
添加
|
添加
|
||||||
|
|
|
@ -10,6 +10,7 @@ import useUserStore from '@/user/useUserStore'
|
||||||
import useRouterStore from '@/useRouterStore'
|
import useRouterStore from '@/useRouterStore'
|
||||||
import useBackgroundStore from './useBackgroundStore'
|
import useBackgroundStore from './useBackgroundStore'
|
||||||
import CustomWallpaper from './CustomWallpaper'
|
import CustomWallpaper from './CustomWallpaper'
|
||||||
|
import { videoArr } from '@/config'
|
||||||
|
|
||||||
addIcons(BiChevronLeft, BiChevronDown)
|
addIcons(BiChevronLeft, BiChevronDown)
|
||||||
|
|
||||||
|
@ -170,7 +171,12 @@ export default defineComponent(() => {
|
||||||
class="h-[156px] relative cursor-pointer group w-full flex-grow-0 rounded-xl overflow-hidden"
|
class="h-[156px] relative cursor-pointer group w-full flex-grow-0 rounded-xl overflow-hidden"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={item.url + '?x-oss-process=image/resize,w_300'}
|
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')
|
||||||
|
}
|
||||||
class=" duration-150 absolute w-full h-full object-cover flex-grow-0 rounded-xl group-hover:scale-[1.2]"
|
class=" duration-150 absolute w-full h-full object-cover flex-grow-0 rounded-xl group-hover:scale-[1.2]"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -40,20 +40,13 @@ export default function useResource(tag: Ref<string>, type: string) {
|
||||||
if (videoArr.includes(suffix)) {
|
if (videoArr.includes(suffix)) {
|
||||||
// 内部视频
|
// 内部视频
|
||||||
// 先显示截图,再去数据库看是否有存货
|
// 先显示截图,再去数据库看是否有存货
|
||||||
|
|
||||||
resource.video = ''
|
resource.video = ''
|
||||||
resource.image = val + '?x-oss-process=video/snapshot,t_0,f_jpg,m_fast'
|
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'
|
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) => {
|
db.getItem<{ tag: string; file: Blob }[]>('videoList').then((res) => {
|
||||||
if (!res) return
|
const handle = (res: any[] | undefined) => {
|
||||||
const item = res.find((item) => item.tag === val)
|
res = res || []
|
||||||
if (item) {
|
|
||||||
|
|
||||||
resource.video = URL.createObjectURL(item.file)
|
|
||||||
resource.type = 'local'
|
|
||||||
} else {
|
|
||||||
// 不存在,需要存入
|
// 不存在,需要存入
|
||||||
|
|
||||||
fetch(val)
|
fetch(val)
|
||||||
.then((res) => res.blob())
|
.then((res) => res.blob())
|
||||||
.then((blob) => {
|
.then((blob) => {
|
||||||
|
@ -61,12 +54,23 @@ export default function useResource(tag: Ref<string>, type: string) {
|
||||||
res.pop()
|
res.pop()
|
||||||
}
|
}
|
||||||
res.unshift({ tag: val, file: blob })
|
res.unshift({ tag: val, file: blob })
|
||||||
|
db.setItem('videoList', res)
|
||||||
resource.video = URL.createObjectURL(blob)
|
resource.video = URL.createObjectURL(blob)
|
||||||
resource.type = 'own'
|
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 {
|
} else {
|
||||||
// 图片
|
// 图片
|
||||||
resource.image = val
|
resource.image = val
|
||||||
|
@ -97,10 +101,9 @@ export default function useResource(tag: Ref<string>, type: string) {
|
||||||
if (!res) return
|
if (!res) return
|
||||||
const item = res.find((item) => item.tag === val)
|
const item = res.find((item) => item.tag === val)
|
||||||
if (!item) return
|
if (!item) return
|
||||||
|
|
||||||
const url = URL.createObjectURL(item.file)
|
const url = URL.createObjectURL(item.file)
|
||||||
|
|
||||||
|
|
||||||
resource.image = item.type === 'image' ? url : ''
|
resource.image = item.type === 'image' ? url : ''
|
||||||
resource.video = item.type === 'video' ? url : ''
|
resource.video = item.type === 'video' ? url : ''
|
||||||
resource.brief = url
|
resource.brief = url
|
||||||
|
|
|
@ -9,22 +9,28 @@ 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 === 'show',
|
autoSearch: settings.state.autoUseAi === 'auto',
|
||||||
showTabButton: settings.state.showPetOnTab,
|
showTabButton: settings.state.showPetOnTab,
|
||||||
isSearch: settings.state.autoUseAi === ''
|
ifSearch: settings.state.autoUseAi !== ''
|
||||||
}),
|
}),
|
||||||
(val) => {
|
(val) => {
|
||||||
|
|
||||||
sendParent([
|
sendParent([
|
||||||
'configAI',
|
'configAI',
|
||||||
{
|
{
|
||||||
autoSearch: val.autoSearch,
|
autoSearch: val.autoSearch,
|
||||||
showTabButton: val.showTabButton,
|
showTabButton: val.showTabButton,
|
||||||
isSearch: val.isSearch
|
ifSearch: val.ifSearch
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
console.log({
|
||||||
|
autoSearch: val.autoSearch,
|
||||||
|
showTabButton: val.showTabButton,
|
||||||
|
ifSearch: val.ifSearch
|
||||||
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
immediate: true
|
immediate: true
|
||||||
|
@ -57,6 +63,21 @@ 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>
|
||||||
|
@ -72,21 +93,7 @@ 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',
|
||||||
|
@ -110,7 +117,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
|
||||||
|
@ -125,14 +132,11 @@ export default defineComponent({
|
||||||
desc="每次搜索直接询问fatfox"
|
desc="每次搜索直接询问fatfox"
|
||||||
>
|
>
|
||||||
<Radio
|
<Radio
|
||||||
checked={settings.state.autoUseAi === 'show'}
|
checked={settings.state.autoUseAi === 'auto'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
settings.state.autoUseAi = 'show'
|
settings.state.autoUseAi = 'auto'
|
||||||
}}
|
|
||||||
onUpdate:checked={(e) => {
|
|
||||||
if (e) settings.state.showSider = 'auto'
|
|
||||||
else settings.state.showSider = 'show'
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
</SettingItem>
|
</SettingItem>
|
||||||
<SettingItem
|
<SettingItem
|
||||||
|
@ -143,13 +147,13 @@ export default defineComponent({
|
||||||
desc="每次搜索,提示您进行手动查询"
|
desc="每次搜索,提示您进行手动查询"
|
||||||
>
|
>
|
||||||
<Radio
|
<Radio
|
||||||
checked={settings.state.autoUseAi === 'auto'}
|
checked={settings.state.autoUseAi === 'show'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
settings.state.autoUseAi = 'auto'
|
settings.state.autoUseAi = 'show'
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</SettingItem>
|
</SettingItem>
|
||||||
</div>
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,10 +27,10 @@ export default function useSortable(list: Ref<any[]>, type: Ref<string>) {
|
||||||
scrollSpeed: 10,
|
scrollSpeed: 10,
|
||||||
...(type.value === 'page'
|
...(type.value === 'page'
|
||||||
? {
|
? {
|
||||||
invertSwap: true,
|
invertSwap: true,
|
||||||
invertedSwapThreshold: 1,
|
invertedSwapThreshold: 1,
|
||||||
filter: '.operation-button'
|
filter: '.operation-button'
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
ghostClass: 'opacity-0',
|
ghostClass: 'opacity-0',
|
||||||
onStart: (e: any) => {
|
onStart: (e: any) => {
|
||||||
|
|
|
@ -98,7 +98,7 @@ export default defineStore('user', () => {
|
||||||
Object.assign(layout.state.dock, remoteData.value.dock)
|
Object.assign(layout.state.dock, remoteData.value.dock)
|
||||||
Object.assign(layout.state.dir, remoteData.value.dir)
|
Object.assign(layout.state.dir, remoteData.value.dir)
|
||||||
}
|
}
|
||||||
watch(() => profile.username, async (val, pre) => {
|
watch(() => profile.username, async (val) => {
|
||||||
console.log(val);
|
console.log(val);
|
||||||
|
|
||||||
if (!val) return
|
if (!val) return
|
||||||
|
@ -138,7 +138,6 @@ export default defineStore('user', () => {
|
||||||
token.value = ''
|
token.value = ''
|
||||||
Object.assign(profile, { ...defaultUserInfo })
|
Object.assign(profile, { ...defaultUserInfo })
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateProfile = () => {
|
const updateProfile = () => {
|
||||||
request('PUT', '/api/profile', {
|
request('PUT', '/api/profile', {
|
||||||
returnType: 'text',
|
returnType: 'text',
|
||||||
|
|
|
@ -9,9 +9,10 @@ export function sendParent(
|
||||||
{
|
{
|
||||||
autoSearch: boolean
|
autoSearch: boolean
|
||||||
showTabButton: boolean
|
showTabButton: boolean
|
||||||
isSearch: boolean
|
ifSearch: boolean
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
| ['information', string]
|
||||||
) {
|
) {
|
||||||
parent.window.postMessage(
|
parent.window.postMessage(
|
||||||
{
|
{
|
||||||
|
|
|
@ -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 ? store.state.list.filter((val) => !val.isCompleted).pop()?.title : '无目标'}
|
{store.state.list.length !== 0 ? 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)}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
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";
|
||||||
|
@ -97,10 +99,13 @@ 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>()
|
||||||
|
|
Loading…
Reference in New Issue