feat: 修改导入处理逻辑以支持状态持久化

- handleFileSuccess: 清除旧数据,保存新任务初始状态
- handleImportComplete: 更新localStorage中的完整任务状态

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
wkc
2026-02-06 12:31:17 +08:00
parent 0c9627617c
commit cb12f1db70

View File

@@ -687,6 +687,26 @@ export default {
if (response.code === 200) {
const taskId = response.data.taskId;
// 清除旧的导入记录(防止并发)
if (this.pollingTimer) {
clearInterval(this.pollingTimer);
this.pollingTimer = null;
}
this.clearImportTaskFromStorage();
// 保存新任务的初始状态
this.saveImportTaskToStorage({
taskId: taskId,
status: 'PROCESSING',
timestamp: Date.now(),
hasFailures: false
});
// 重置状态
this.showFailureButton = false;
this.currentTaskId = taskId;
// 显示后台处理提示
this.$notify({
title: '导入任务已提交',