Merge pull request #1099 from SauronSkywalker/fix/export-file-naming-mode
# 修复:导出文件命名方式中"时间范围模式"选项不生效
This commit is contained in:
4 files changed
+14
-5
No files matched your search
@@ -26,7 +26,7 @@ import { useAutomationRunner, useAutomationStore } from './hooks/useAutomation'
|
||||
import { AutomationModal } from './components/Automation/AutomationModal'
|
||||
import { AutomationTaskForm } from './components/Automation/AutomationTaskForm'
|
||||
|
||||
import type { SessionRow } from './types'
|
||||
import type { SessionRow, TextExportFormat } from './types'
|
||||
import { getSelectionScopeFromRows, resolveScopeDisplayNames } from './utils/session'
|
||||
import {
|
||||
emitSingleExportDialogStatus,
|
||||
@@ -139,8 +139,9 @@ function ExportPage() {
|
||||
|
||||
const handleExportDefaultsChanged = useCallback((patch: ExportDefaultsSettingsPatch) => {
|
||||
updateOptions({
|
||||
...(patch.format ? { defaultFormat: patch.format as any } : {}),
|
||||
...(patch.format ? { format: patch.format as TextExportFormat } : {}),
|
||||
...(patch.avatars !== undefined ? { exportAvatars: patch.avatars } : {}),
|
||||
...(patch.fileNamingMode !== undefined ? { fileNamingMode: patch.fileNamingMode } : {}),
|
||||
})
|
||||
}, [updateOptions])
|
||||
|
||||
|
||||
@@ -175,7 +175,8 @@ export const createDefaultExportOptions = (): import('./types').ExportOptions =>
|
||||
excelCompactColumns: true,
|
||||
txtColumns: defaultTxtColumns,
|
||||
displayNamePreference: 'remark',
|
||||
exportConcurrency: 2
|
||||
exportConcurrency: 2,
|
||||
fileNamingMode: 'classic'
|
||||
})
|
||||
|
||||
// ─── Empty progress factory ──────────────────────────────────
|
||||
|
||||
@@ -62,7 +62,8 @@ export function useExportConfig(): ExportConfigResult {
|
||||
pathStyle,
|
||||
excelCompact,
|
||||
txtCols,
|
||||
concurrency
|
||||
concurrency,
|
||||
fileNamingMode
|
||||
] = await Promise.all([
|
||||
configService.getExportPath(),
|
||||
configService.getExportWriteLayout(),
|
||||
@@ -74,7 +75,8 @@ export function useExportConfig(): ExportConfigResult {
|
||||
configService.getExportDefaultPathStyle(),
|
||||
configService.getExportDefaultExcelCompactColumns(),
|
||||
configService.getExportDefaultTxtColumns(),
|
||||
configService.getExportDefaultConcurrency()
|
||||
configService.getExportDefaultConcurrency(),
|
||||
configService.getExportDefaultFileNamingMode()
|
||||
])
|
||||
|
||||
if (!isMounted) return
|
||||
@@ -118,6 +120,7 @@ export function useExportConfig(): ExportConfigResult {
|
||||
if (typeof excelCompact === 'boolean') newOptions.excelCompactColumns = excelCompact
|
||||
if (Array.isArray(txtCols)) newOptions.txtColumns = txtCols
|
||||
if (typeof concurrency === 'number' && concurrency > 0) newOptions.exportConcurrency = concurrency
|
||||
if (fileNamingMode === 'classic' || fileNamingMode === 'date-range') newOptions.fileNamingMode = fileNamingMode
|
||||
|
||||
// Date range
|
||||
setRawDateRangeConfigState(dateRange)
|
||||
@@ -192,6 +195,9 @@ export function useExportConfig(): ExportConfigResult {
|
||||
if (patch.exportConcurrency !== undefined) {
|
||||
void configService.setExportDefaultConcurrency(patch.exportConcurrency)
|
||||
}
|
||||
if (patch.fileNamingMode !== undefined) {
|
||||
void configService.setExportDefaultFileNamingMode(patch.fileNamingMode)
|
||||
}
|
||||
|
||||
// Auto-derive exportMedia
|
||||
next.exportMedia = (
|
||||
|
||||
@@ -75,6 +75,7 @@ export interface ExportOptions {
|
||||
txtColumns: string[]
|
||||
displayNamePreference: DisplayNamePreference
|
||||
exportConcurrency: number
|
||||
fileNamingMode: 'classic' | 'date-range'
|
||||
}
|
||||
|
||||
// ─── Session ─────────────────────────────────────────────────
|
||||
|
||||
Reference in new issue
Block a user