From 5af747e004d42a43502a5d1136f5bc36cf080eaf Mon Sep 17 00:00:00 2001 From: p
Date: Wed, 12 Aug 2026 14:36:52 +0800 Subject: [PATCH] workspace: standard subwidgets + auto_open --- wwwroot/api/workspace_popup.dspy | 35 +++++++++++--------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/wwwroot/api/workspace_popup.dspy b/wwwroot/api/workspace_popup.dspy index cae63e2..d729a99 100644 --- a/wwwroot/api/workspace_popup.dspy +++ b/wwwroot/api/workspace_popup.dspy @@ -1,4 +1,4 @@ -# workspace_popup.dspy - 返回 PopupWindow,内容直接放 resizebox +# workspace_popup.dspy - 返回 PopupWindow(用 subwidgets 标准方式) uid = await get_user() if not uid: @@ -21,39 +21,28 @@ async with DBPools().sqlorContext(dbname) as sor: if not pid: resp = { "widgettype": "PopupWindow", - "options": { - "title": "提示", - "cwidth": 30, "cheight": 8, "auto_open": True - }, + "options": {"title": "提示", "cwidth": 30, "cheight": 8, "auto_open": True}, "subwidgets": [{ "widgettype": "Text", "options": {"text": "请先选择项目", "cfontsize": 1, "color": "#64748b", "padding": "20px"} }] } else: - content_widget = { - "widgettype": "Splitter", - "options": {"direction": "horizontal", "split": "30%"}, - "subwidgets": [ - { + resp = { + "widgettype": "PopupWindow", + "options": {"title": pname + " - 工作空间", "cwidth": 80, "cheight": 36, "auto_open": True}, + "subwidgets": [{ + "widgettype": "Splitter", + "options": {"direction": "horizontal", "split": "30%"}, + "subwidgets": [{ "widgettype": "Tree", "id": "ws_tree", "options": {"dataurl": "/pipeline-sdlc/api/workspace_tree.dspy", "css": "filler", "padding": "4px", "cheight": "100%"}, "binds": [{"wid": "self", "event": "selected", "actiontype": "urlwidget", "target": "ws_files", "options": {"url": "/pipeline-sdlc/api/workspace_files.dspy"}}] - }, - { + }, { "widgettype": "VScrollPanel", "id": "ws_files", "options": {"css": "filler", "padding": "8px", "gap": "4px"} - } - ] - } - - resp = { - "widgettype": "PopupWindow", - "options": { - "title": pname + " - 工作空间", - "cwidth": 80, "cheight": 36, "auto_open": True, - "content": content_widget - } + }] + }] } return json.dumps(resp, ensure_ascii=False)