From 619b9cca7ac819b8984e6846e396c5ceb89b3a7a Mon Sep 17 00:00:00 2001 From: wkc <978997012@qq.com> Date: Sun, 8 Feb 2026 13:59:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0restoreImportState?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E6=81=A2=E5=A4=8D=E5=AF=BC=E5=85=A5=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在methods中添加restoreImportState方法,用于在页面加载时恢复之前的导入状态: - 从localStorage读取保存的导入任务 - 如果有失败记录,恢复显示失败记录按钮 - 恢复当前任务ID Co-Authored-By: Claude Sonnet 4.5 --- .../views/ccdiPurchaseTransaction/index.vue | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ruoyi-ui/src/views/ccdiPurchaseTransaction/index.vue b/ruoyi-ui/src/views/ccdiPurchaseTransaction/index.vue index 03187ff..e27dc86 100644 --- a/ruoyi-ui/src/views/ccdiPurchaseTransaction/index.vue +++ b/ruoyi-ui/src/views/ccdiPurchaseTransaction/index.vue @@ -730,6 +730,25 @@ export default { this.loading = false; }); }, + /** + * 恢复导入状态 + * 在created()钩子中调用 + */ + restoreImportState() { + const savedTask = this.getImportTaskFromStorage(); + + if (!savedTask) { + this.showFailureButton = false; + this.currentTaskId = null; + return; + } + + // 如果有失败记录,恢复按钮显示 + if (savedTask.hasFailures && savedTask.taskId) { + this.currentTaskId = savedTask.taskId; + this.showFailureButton = true; + } + }, // 格式化金额 formatAmount(amount) { if (amount === null || amount === undefined || amount === '') return '-';