From 23f265f2b12c5fc140b6e42976c08f92202e405d Mon Sep 17 00:00:00 2001 From: potaser Date: Fri, 21 Aug 2026 10:14:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(lightweight-extension):=20=E6=8B=96?= =?UTF-8?q?=E6=8B=BD/=E9=80=89=E5=8F=96=E4=B8=8A=E4=BC=A0=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E4=B8=8A=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 挂载 lightweightUploadProgress 到 handleDrop/handlePick, 读取本地文件时初始化进度并显示状态,失败时关闭进度。 Co-Authored-By: Claude Opus 5 (1M context) --- apps/web/vue3/index.html | 2 ++ apps/web/vue3/index_ml.html | 2 ++ apps/web/vue3/lightWeightExtensionTest.js | 11 +++++++++++ 3 files changed, 15 insertions(+) diff --git a/apps/web/vue3/index.html b/apps/web/vue3/index.html index c33dcf8c6..71a2efe5e 100644 --- a/apps/web/vue3/index.html +++ b/apps/web/vue3/index.html @@ -24565,6 +24565,7 @@ compare: [[flesh, peel]]`; appendExtensionFiles, buildLightweightExtensionStage, lightweightExtensionTestStatus, + lightweightUploadProgress, uploadExtensionWithProgress, }, event), handleLightweightExtensionFolderPick: (event) => window.LightWeightExtensionTest && window.LightWeightExtensionTest.handlePick({ @@ -24574,6 +24575,7 @@ compare: [[flesh, peel]]`; appendExtensionFiles, buildLightweightExtensionStage, lightweightExtensionTestStatus, + lightweightUploadProgress, uploadExtensionWithProgress, }, event), openLightweightExtensionFolderPicker: () => window.LightWeightExtensionTest && window.LightWeightExtensionTest.openPicker(), diff --git a/apps/web/vue3/index_ml.html b/apps/web/vue3/index_ml.html index 4f4862431..78e922879 100644 --- a/apps/web/vue3/index_ml.html +++ b/apps/web/vue3/index_ml.html @@ -24401,6 +24401,7 @@ compare: [[flesh, peel]]`; appendExtensionFiles, buildLightweightExtensionStage, lightweightExtensionTestStatus, + lightweightUploadProgress, uploadExtensionWithProgress, }, event), handleLightweightExtensionFolderPick: (event) => window.LightWeightExtensionTest && window.LightWeightExtensionTest.handlePick({ @@ -24410,6 +24411,7 @@ compare: [[flesh, peel]]`; appendExtensionFiles, buildLightweightExtensionStage, lightweightExtensionTestStatus, + lightweightUploadProgress, uploadExtensionWithProgress, }, event), openLightweightExtensionFolderPicker: () => window.LightWeightExtensionTest && window.LightWeightExtensionTest.openPicker(), diff --git a/apps/web/vue3/lightWeightExtensionTest.js b/apps/web/vue3/lightWeightExtensionTest.js index ba835f95d..5732266a3 100644 --- a/apps/web/vue3/lightWeightExtensionTest.js +++ b/apps/web/vue3/lightWeightExtensionTest.js @@ -282,12 +282,23 @@ function mountApi() { window.LightWeightExtensionTest = { async handleDrop(hooks, event) { + const progress = hooks.lightweightUploadProgress; try { + if (progress) { + progress.active = true; + progress.percent = 0; + progress.loaded = 0; + progress.total = 0; + progress.speed = 0; + progress.label = '本地文件读取中'; + } + hooks.lightweightExtensionTestStatus.value = '本地文件读取中...'; const files = await readDroppedFiles(event?.dataTransfer); await processFolderFiles(hooks, files); } catch (error) { const message = `失败:${error.message || '目录处理失败'}`; hooks.lightweightExtensionTestStatus.value = message; + if (progress) progress.active = false; notifyError(message); } },