save
This commit is contained in:
parent
eac8854337
commit
2aa592e48e
88
src/App.vue
88
src/App.vue
|
@ -32,52 +32,52 @@ 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
|
||||||
@dblclick="
|
@dblclick="
|
||||||
() => {
|
() => {
|
||||||
layout.state.simple = !layout.state.simple
|
layout.state.simple = !layout.state.simple
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<GLobalModal />
|
<GLobalModal />
|
||||||
<SettingsOverlay />
|
<SettingsOverlay />
|
||||||
<SettingsButton />
|
<SettingsButton />
|
||||||
|
|
||||||
<Sider
|
<Sider
|
||||||
v-if="
|
v-if="
|
||||||
!layout.state.simple ||
|
!layout.state.simple ||
|
||||||
(layout.state.simple && settings.state.simpleModeShowString.includes('showSider'))
|
(layout.state.simple && settings.state.simpleModeShowString.includes('showSider'))
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<LoginModal v-if="router.path === 'global-login'" />
|
<LoginModal v-if="router.path === 'global-login'" />
|
||||||
<Transition>
|
<Transition>
|
||||||
<Grid v-if="layout.ready && !layout.state.simple" />
|
<Grid v-if="layout.ready && !layout.state.simple" />
|
||||||
</Transition>
|
</Transition>
|
||||||
<Dock
|
<Dock
|
||||||
v-if="
|
v-if="
|
||||||
!layout.state.simple ||
|
!layout.state.simple ||
|
||||||
(layout.state.simple && settings.state.simpleModeShowString.includes('showDock'))
|
(layout.state.simple && settings.state.simpleModeShowString.includes('showDock'))
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="fixed z-40 right-[14%] top-8"
|
class="fixed z-40 right-[14%] top-8"
|
||||||
v-if="
|
v-if="
|
||||||
!layout.state.simple ||
|
(!layout.state.simple && settings.state.showPet) ||
|
||||||
(layout.state.simple && settings.state.simpleModeShowString.includes('showPet'))
|
(layout.state.simple && settings.state.simpleModeShowString.includes('showPet'))
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<Fox />
|
<Fox />
|
||||||
</div>
|
|
||||||
<DirModal />
|
|
||||||
<GlobalMenu />
|
|
||||||
<WelcomePage></WelcomePage>
|
|
||||||
<TomatoPage></TomatoPage>
|
|
||||||
|
|
||||||
<BackupRecovery v-if="router.path === 'global-backup'"></BackupRecovery>
|
|
||||||
</div>
|
</div>
|
||||||
<ModalPgae />
|
<DirModal />
|
||||||
|
<GlobalMenu />
|
||||||
|
<WelcomePage></WelcomePage>
|
||||||
|
<TomatoPage></TomatoPage>
|
||||||
|
|
||||||
|
<BackupRecovery v-if="router.path === 'global-backup'"></BackupRecovery>
|
||||||
|
</div>
|
||||||
|
<ModalPgae />
|
||||||
<!-- </ConfigProvider> -->
|
<!-- </ConfigProvider> -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,157 @@
|
||||||
|
import SettingItem from '@/settings/SettingItem'
|
||||||
|
import useSettingsStore from '@/settings/useSettingsStore'
|
||||||
|
import { Radio, Switch } from 'ant-design-vue'
|
||||||
|
import clsx from 'clsx'
|
||||||
|
import { defineComponent, watch } from 'vue'
|
||||||
|
import useLayoutStore from '../useLayoutStore'
|
||||||
|
import { sendParent } from '@/utils/parent'
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
setup() {
|
||||||
|
const settings = useSettingsStore()
|
||||||
|
const layout = useLayoutStore()
|
||||||
|
watch(
|
||||||
|
() => ({
|
||||||
|
autoSearch: settings.state.autoUseAi === 'show',
|
||||||
|
showTabButton: settings.state.showPetOnTab,
|
||||||
|
isSearch: settings.state.autoUseAi === ''
|
||||||
|
}),
|
||||||
|
(val) => {
|
||||||
|
console.log(val)
|
||||||
|
sendParent([
|
||||||
|
'configAI',
|
||||||
|
{
|
||||||
|
autoSearch: val.autoSearch,
|
||||||
|
showTabButton: val.showTabButton,
|
||||||
|
isSearch: val.isSearch
|
||||||
|
}
|
||||||
|
])
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return () => (
|
||||||
|
<div class="p-4 flex flex-col ">
|
||||||
|
<div class={'flex flex-col'}>
|
||||||
|
<span
|
||||||
|
class={clsx(
|
||||||
|
'text-[14px] font-bold',
|
||||||
|
useLayoutStore().state.current === 0 ? 'text-white' : ' text-[#333]'
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
AI助手
|
||||||
|
</span>
|
||||||
|
<span class={'text-[13px] text-[#666] '}>设置AI助手样式</span>
|
||||||
|
<div
|
||||||
|
class={clsx(
|
||||||
|
'w-full h-[1px] bg-black/10 mt-1 mb-2',
|
||||||
|
useLayoutStore().state.current === 0 ? 'bg-white/10' : ' bg-black/10'
|
||||||
|
)}
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
<span
|
||||||
|
class={clsx(
|
||||||
|
'text-[14px] font-bold my-2',
|
||||||
|
useLayoutStore().state.current === 0 ? 'text-white' : 'text-[#333]'
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
功能开关
|
||||||
|
</span>
|
||||||
|
<SettingItem
|
||||||
|
v-slots={{
|
||||||
|
label: () => <div>标签页助手</div>
|
||||||
|
}}
|
||||||
|
noRoundedB
|
||||||
|
desc="fatfox标签页内的小助手"
|
||||||
|
>
|
||||||
|
<Switch
|
||||||
|
checked={settings.state.showPet}
|
||||||
|
onUpdate:checked={(e) => {
|
||||||
|
if (e) settings.state.showPet = true
|
||||||
|
else settings.state.showPet = false
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</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',
|
||||||
|
useLayoutStore().state.current === 0 ? 'text-white' : 'text-[#333]'
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
结果增强
|
||||||
|
</span>
|
||||||
|
<SettingItem
|
||||||
|
v-slots={{
|
||||||
|
label: () => <div>结果增强开关</div>
|
||||||
|
}}
|
||||||
|
desc="使用搜索引擎时,Fatfox会给您更多有效的结果"
|
||||||
|
>
|
||||||
|
<Switch
|
||||||
|
checked={settings.state.autoUseAi !== ''}
|
||||||
|
onUpdate:checked={(e) => {
|
||||||
|
if (e) settings.state.autoUseAi = 'show'
|
||||||
|
else settings.state.autoUseAi = ''
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</SettingItem>
|
||||||
|
|
||||||
|
<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
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<span>何时使用结果增强</span>
|
||||||
|
<SettingItem
|
||||||
|
v-slots={{
|
||||||
|
label: () => <div>每次询问</div>
|
||||||
|
}}
|
||||||
|
noBg
|
||||||
|
desc="每次搜索直接询问fatfox"
|
||||||
|
>
|
||||||
|
<Radio
|
||||||
|
checked={settings.state.autoUseAi === 'show'}
|
||||||
|
onClick={() => {
|
||||||
|
settings.state.autoUseAi = 'show'
|
||||||
|
}}
|
||||||
|
onUpdate:checked={(e) => {
|
||||||
|
if (e) settings.state.showSider = 'auto'
|
||||||
|
else settings.state.showSider = 'show'
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</SettingItem>
|
||||||
|
<SettingItem
|
||||||
|
v-slots={{
|
||||||
|
label: () => <div>手动询问</div>
|
||||||
|
}}
|
||||||
|
noBg
|
||||||
|
desc="每次搜索,提示您进行手动查询"
|
||||||
|
>
|
||||||
|
<Radio
|
||||||
|
checked={settings.state.autoUseAi === 'auto'}
|
||||||
|
onClick={() => {
|
||||||
|
settings.state.autoUseAi = 'auto'
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</SettingItem>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
|
@ -15,6 +15,9 @@ export default defineComponent({
|
||||||
noBg: {
|
noBg: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
desc: {
|
||||||
|
type: String
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
slots: {} as SlotsType<{
|
slots: {} as SlotsType<{
|
||||||
|
@ -39,8 +42,17 @@ export default defineComponent({
|
||||||
marginBottom: props.noRoundedB ? 0 : '12px'
|
marginBottom: props.noRoundedB ? 0 : '12px'
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div class={clsx('text-sm mr-4', isGame.value ? 'text-white' : 'text-black/60')}>
|
<div
|
||||||
{ctx.slots.label?.()}
|
class={clsx('text-sm mr-4 flex flex-col', isGame.value ? 'text-white' : 'text-black/60')}
|
||||||
|
>
|
||||||
|
<span> {ctx.slots.label?.()}</span>
|
||||||
|
{props.desc ? (
|
||||||
|
<span
|
||||||
|
class={clsx('text-[12px] ', isGame.value ? 'text-white opacity-50 ' : 'text-black/60')}
|
||||||
|
>
|
||||||
|
{props.desc}
|
||||||
|
</span>
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
<div class="">{ctx.slots.default?.()}</div>
|
<div class="">{ctx.slots.default?.()}</div>
|
||||||
{/* {ctx.slots.end?.()} */}
|
{/* {ctx.slots.end?.()} */}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import SiderSetting from '@/layout/grid/SiderSetting'
|
||||||
import DockSetting from '@/layout/grid/DockSetting'
|
import DockSetting from '@/layout/grid/DockSetting'
|
||||||
import Feedback from '@/layout/grid/Feedback'
|
import Feedback from '@/layout/grid/Feedback'
|
||||||
import Reset from '@/layout/grid/Reset'
|
import Reset from '@/layout/grid/Reset'
|
||||||
|
import AiSetting from '@/layout/grid/AiSetting'
|
||||||
|
|
||||||
export default defineComponent(() => {
|
export default defineComponent(() => {
|
||||||
const router = useRouterStore()
|
const router = useRouterStore()
|
||||||
|
@ -35,6 +36,8 @@ export default defineComponent(() => {
|
||||||
<Reset />
|
<Reset />
|
||||||
) : router.path === 'settings-fallback' ? (
|
) : router.path === 'settings-fallback' ? (
|
||||||
<Feedback />
|
<Feedback />
|
||||||
|
) : router.path === 'settings-ai' ? (
|
||||||
|
<AiSetting />
|
||||||
) : null}
|
) : null}
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -40,7 +40,9 @@ export default defineStore(
|
||||||
// 显示隐藏
|
// 显示隐藏
|
||||||
showSider: 'show' as VisibleState,
|
showSider: 'show' as VisibleState,
|
||||||
showDock: 'show' as VisibleState,
|
showDock: 'show' as VisibleState,
|
||||||
showPet: 'show' as VisibleState,
|
showPet: true,
|
||||||
|
showPetOnTab: true,
|
||||||
|
autoUseAi: 'show' as VisibleState,
|
||||||
showTop: 'show' as VisibleState,
|
showTop: 'show' as VisibleState,
|
||||||
showTime: true,
|
showTime: true,
|
||||||
timeOptions: ['date', 'week', '12hour', 'lunal', 'second'] as TimeUnit[],
|
timeOptions: ['date', 'week', '12hour', 'lunal', 'second'] as TimeUnit[],
|
||||||
|
|
|
@ -7,8 +7,9 @@ export function sendParent(
|
||||||
| [
|
| [
|
||||||
'configAI',
|
'configAI',
|
||||||
{
|
{
|
||||||
autoSearch: true
|
autoSearch: boolean
|
||||||
showTabButton: true
|
showTabButton: boolean
|
||||||
|
isSearch: boolean
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -29,10 +29,13 @@ export default defineComponent(() => {
|
||||||
}, 500) //
|
}, 500) //
|
||||||
watch(searchText, (newValue) => {
|
watch(searchText, (newValue) => {
|
||||||
debouncedHandler(newValue)
|
debouncedHandler(newValue)
|
||||||
|
}, {
|
||||||
|
immediate: true
|
||||||
})
|
})
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
store.state.pageIndex = 1
|
store.state.pageIndex = 1
|
||||||
store.getNews()
|
store.getNews()
|
||||||
|
searchText.value = ''
|
||||||
})
|
})
|
||||||
return () => (
|
return () => (
|
||||||
<div
|
<div
|
||||||
|
@ -59,6 +62,10 @@ export default defineComponent(() => {
|
||||||
}}
|
}}
|
||||||
></input>
|
></input>
|
||||||
<div
|
<div
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation()
|
||||||
|
searchText.value = ''
|
||||||
|
}}
|
||||||
class={
|
class={
|
||||||
'absolute cursor-pointer hidden group-hover:block right-3 top-1/2 -translate-y-1/2'
|
'absolute cursor-pointer hidden group-hover:block right-3 top-1/2 -translate-y-1/2'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue