From 68c2de6d2635d244dc350f417b52a8a4aba3fcfb Mon Sep 17 00:00:00 2001 From: QQ597901027 Date: Thu, 5 Nov 2026 09:19:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AE=BE=E7=BD=AE=E9=A1=B5=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E5=8C=BA=E4=B8=8B=E6=8B=89=E6=94=B9=E4=B8=BA=20select?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E5=86=8D=E5=8F=AA=E5=89=A9=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client.js | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/client.js b/client.js index a59bb3f..d4c5824 100644 --- a/client.js +++ b/client.js @@ -431,22 +431,32 @@ window.__ModuleLoader__.load({ ) : null + const workspacePaths = workspaces.map((item) => item.path).filter(Boolean) + const workspaceOptions = + workspace && !workspacePaths.includes(workspace) ? [workspace, ...workspacePaths] : workspacePaths + const workspaceTitles = Object.fromEntries(workspaces.map((item) => [item.path, item.title])) const workspaceRow = h( 'div', { style: { display: 'grid', gridTemplateColumns: '2fr 1fr', gap: 12, marginTop: 16 } }, h( Field, { label: DICTS.zh.workspace, hint: DICTS.zh.workspaceHint }, - h('input', { - style: inputStyle, - value: workspace, - list: 'abap-adt-workspaces', - onChange: (event) => setWorkspace(event.target.value), - onBlur: () => { - if (workspace && workspace !== file?.path?.replace(/[\\/]\.dsh-abap-adt[\\/].*$/, '')) load(workspace) + h( + 'select', + { + style: inputStyle, + value: workspace, + onChange: (event) => { + const next = event.target.value + setWorkspace(next) + if (next) load(next) + }, }, - placeholder: 'D:\\AIagent\\SAP', - }), + workspaceOptions.map((path) => { + const title = workspaceTitles[path] + return h('option', { key: path, value: path }, title && title !== path ? title + ' — ' + path : path) + }), + ), ), h( Field, @@ -457,11 +467,6 @@ window.__ModuleLoader__.load({ file?.path ? `${file.path}${file.exists ? '' : DICTS.zh.notExists}` : DICTS.zh.never, ), ), - h( - 'datalist', - { id: 'abap-adt-workspaces' }, - workspaces.map((item) => h('option', { key: item.id || item.path, value: item.path }, item.title)), - ), ) const destinationCards = destinations.length