From edee247a112380c951986303ca8d311b143f50c9 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Thu, 18 Jun 2026 16:13:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20test=5Fpricing=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E8=BF=94=E5=9B=9E=E5=AE=8C=E6=95=B4=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6JSON?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - dspy: 直接return VScrollPanel+Text子控件的完整JSON,不再用status/data包装 - ui: actiontype从urldata改为bricks,直接实例化返回的控件 - 解决status_of模板${items}数组替换不支持的问题 --- wwwroot/test_pricing_program.dspy | 23 +++++++++-------------- wwwroot/test_pricing_program.ui | 20 +------------------- 2 files changed, 10 insertions(+), 33 deletions(-) diff --git a/wwwroot/test_pricing_program.dspy b/wwwroot/test_pricing_program.dspy index 5687d70..7802605 100644 --- a/wwwroot/test_pricing_program.dspy +++ b/wwwroot/test_pricing_program.dspy @@ -16,19 +16,14 @@ try: "widgettype": "Text", "options": {"text": json.dumps(x, ensure_ascii=False), "width": "100%"} }) - return { - "status": "ok", - "data": { - "ppid": ppid, - "data": data, - "items": subwidgets - } - } + return json.dumps({ + "widgettype": "VScrollPanel", + "options": {"width": "100%", "height": "100%"}, + "subwidgets": subwidgets + }, ensure_ascii=False) except Exception as e: exception(f'{ppid=}, {data=}, {e}{format_exc()}') - return { - "status": "error", - "data": { - "message": f'{ppid=}, {data=}, {e}' - } - } + return json.dumps({ + "widgettype": "Text", + "options": {"width": "100%", "color": "red", "text": f'{ppid=}, {data=}, {e}'} + }, ensure_ascii=False) diff --git a/wwwroot/test_pricing_program.ui b/wwwroot/test_pricing_program.ui index 8410be2..a1fe98a 100644 --- a/wwwroot/test_pricing_program.ui +++ b/wwwroot/test_pricing_program.ui @@ -41,29 +41,11 @@ { "wid": "input_form", "event": "submit", - "actiontype": "urldata", + "actiontype": "bricks", "target": "result", "options": { "url": "{{entire_url('./test_pricing_program.dspy')}}", "params":{} - }, - "status_of": { - "ok": { - "widgettype": "VScrollPanel", - "options":{ - "width": "100%", - "height": "100%" - }, - "subwidgets": "${items}" - }, - "error": { - "widgettype": "Text", - "options":{ - "width": "100%", - "color": "red", - "text": "${message}" - } - } } } ]