fix: 修复导出下载链路(Electron 保存对话框 + 原生文件写入 + revoke 竞态)
This commit is contained in:
@@ -139,8 +139,8 @@ async function doExportLogsCsv() {
|
||||
it.remark || ''
|
||||
])
|
||||
}
|
||||
downloadCsv('工作记录_' + t.replace(/-/g, '') + '.csv', rows)
|
||||
showToast('工作记录 CSV 已导出')
|
||||
const p = await downloadCsv('工作记录_' + t.replace(/-/g, '') + '.csv', rows)
|
||||
showToast(p ? 'CSV 已导出到:' + p : 'CSV 已导出到系统下载目录')
|
||||
}
|
||||
|
||||
async function doExportAttendanceCsv() {
|
||||
@@ -163,8 +163,8 @@ async function doExportAttendanceCsv() {
|
||||
a.note || ''
|
||||
])
|
||||
}
|
||||
downloadCsv('考勤记录_' + t.replace(/-/g, '') + '.csv', rows)
|
||||
showToast('考勤 CSV 已导出')
|
||||
const p = await downloadCsv('考勤记录_' + t.replace(/-/g, '') + '.csv', rows)
|
||||
showToast(p ? 'CSV 已导出到:' + p : 'CSV 已导出到系统下载目录')
|
||||
}
|
||||
onMounted(load)
|
||||
|
||||
@@ -219,7 +219,8 @@ async function toggleArchive(p: Project) {
|
||||
|
||||
async function doExport() {
|
||||
const text = await exportAll()
|
||||
downloadText('实习日志备份_' + todayStr().replace(/-/g, '') + '.json', text)
|
||||
const p = await downloadText('实习日志备份_' + todayStr().replace(/-/g, '') + '.json', text)
|
||||
showToast(p ? '备份已导出到:' + p : '备份已导出到系统下载目录')
|
||||
}
|
||||
|
||||
function onFile(e: Event) {
|
||||
|
||||
Reference in New Issue
Block a user