截图模块优化调整
This commit is contained in:
@@ -13,6 +13,7 @@ import { invoke } from '@tauri-apps/api/core'
|
||||
import { open as openDialog } from '@tauri-apps/plugin-dialog'
|
||||
import { useDownloaderStore, type DownloadTask, type TaskStatus, type CheckUrlResult } from '@/stores/downloaderStore'
|
||||
import { useModuleTabs } from '@/lib/useModuleTabs'
|
||||
import { useModuleTabsStore } from '@/stores/moduleTabsStore'
|
||||
import { createLogger } from '@/lib/logger'
|
||||
import { pendingNewDownload } from '@/lib/trayEvents'
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
||||
@@ -42,6 +43,7 @@ const logger = createLogger('downloader')
|
||||
|
||||
// ===== 主 Tab 状态 =====
|
||||
const activeTab = ref('tasks')
|
||||
const tabsStore = useModuleTabsStore()
|
||||
const tabsListRef = useModuleTabs(activeTab, [
|
||||
{ value: 'tasks', label: '下载任务' },
|
||||
{ value: 'settings', label: '设置' },
|
||||
@@ -483,6 +485,9 @@ const handleSaveSettings = async (): Promise<boolean> => {
|
||||
}
|
||||
}
|
||||
|
||||
// 注册保存处理函数到标签栏 store(TitleBar 保存按钮调用)
|
||||
tabsStore.registerSave(handleSaveSettings)
|
||||
|
||||
// Dialog 保存:成功后关闭弹窗
|
||||
const handleDialogSave = async () => {
|
||||
const ok = await handleSaveSettings()
|
||||
@@ -963,14 +968,6 @@ const toggleSortOrder = () => {
|
||||
<TabsContent value="settings" class="flex-1 mt-4 min-h-0 tab-animate">
|
||||
<ScrollArea class="h-full pr-3">
|
||||
<div class="flex flex-col gap-4 pb-4 max-w-2xl">
|
||||
<!-- 顶部保存按钮 -->
|
||||
<div class="flex justify-end">
|
||||
<Button @click="handleSaveSettings">
|
||||
<Check class="h-4 w-4" />
|
||||
保存设置
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<!-- 下载设置 -->
|
||||
<Card>
|
||||
<CardHeader>
|
||||
|
||||
Reference in New Issue
Block a user