From 5f406180dc461a8648aa54a8ba8713235959246c Mon Sep 17 00:00:00 2001 From: potaser Date: Thu, 27 Aug 2026 10:03:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9ANL=20=E5=90=91?= =?UTF-8?q?=E5=AF=BC=E6=8B=96=E6=8B=BD=E4=B8=8A=E4=BC=A0=E6=8C=89=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=90=8D=E7=B2=BE=E7=A1=AE=E5=8C=B9=E9=85=8D=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A7=BD=EF=BC=8C=E9=81=BF=E5=85=8D=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=AF=AF=E5=A1=AB=20samples.tsv=20=E6=A7=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/vue3/index.html | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/apps/web/vue3/index.html b/apps/web/vue3/index.html index 209f8a75b..8711554d2 100644 --- a/apps/web/vue3/index.html +++ b/apps/web/vue3/index.html @@ -20869,18 +20869,25 @@ compare: [[flesh, peel]]`; if (!response.ok) throw new Error(await extensionApiError(response, '文件上传失败')); const data = await response.json(); const uploaded = (data.files || []).map(name => `input/${jobId}/${name}`); - const targetInput = lightweightNlRun.inputs.find(item => !String(item.value || '').trim()) || lightweightNlRun.inputs[0]; - if (targetInput) { - targetInput.value = uploaded.shift() || ''; - const rest = uploaded.filter(Boolean); - if (rest.length) { - const emptyInputs = lightweightNlRun.inputs.filter(item => !String(item.value || '').trim()); - for (let i = 0; i < rest.length && i < emptyInputs.length; i++) { - emptyInputs[i].value = rest[i]; - } + // 优先按文件名与输入槽名精确匹配填入,避免把序列文件误填进 samples.tsv 等槽位 + const remaining = [...uploaded]; + for (const input of lightweightNlRun.inputs) { + if (String(input.value || '').trim()) continue; + const slotName = String(input.key || '').trim().toLowerCase(); + const hitIndex = remaining.findIndex(path => { + const base = String(path || '').split('/').pop().toLowerCase(); + return slotName && (base === slotName || base.endsWith('.' + slotName)); + }); + if (hitIndex >= 0) { + input.value = remaining.splice(hitIndex, 1)[0]; } } - ElMessage.success(`已上传 ${uploaded.length} 个文件`); + const emptyInputs = lightweightNlRun.inputs.filter(item => !String(item.value || '').trim()); + for (let i = 0; i < remaining.length && i < emptyInputs.length; i++) { + emptyInputs[i].value = remaining[i]; + } + const matched = uploaded.length - remaining.length; + ElMessage.success(`已上传 ${uploaded.length} 个文件${matched ? `,已自动匹配 ${matched} 个输入槽` : ''}`); } catch (err) { ElMessage.error(err.message || '文件上传失败'); } finally {