fix: test_pricing结果直接返回完整控件JSON

- dspy: 直接return VScrollPanel+Text子控件的完整JSON,不再用status/data包装
- ui: actiontype从urldata改为bricks,直接实例化返回的控件
- 解决status_of模板${items}数组替换不支持的问题
This commit is contained in:
Hermes Agent 2026-06-18 16:13:52 +08:00
parent d22dbc57ae
commit edee247a11
2 changed files with 10 additions and 33 deletions

View File

@ -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)

View File

@ -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}"
}
}
}
}
]