fix: test_pricing结果直接返回完整控件JSON
- dspy: 直接return VScrollPanel+Text子控件的完整JSON,不再用status/data包装
- ui: actiontype从urldata改为bricks,直接实例化返回的控件
- 解决status_of模板${items}数组替换不支持的问题
This commit is contained in:
parent
d22dbc57ae
commit
edee247a11
@ -16,19 +16,14 @@ try:
|
|||||||
"widgettype": "Text",
|
"widgettype": "Text",
|
||||||
"options": {"text": json.dumps(x, ensure_ascii=False), "width": "100%"}
|
"options": {"text": json.dumps(x, ensure_ascii=False), "width": "100%"}
|
||||||
})
|
})
|
||||||
return {
|
return json.dumps({
|
||||||
"status": "ok",
|
"widgettype": "VScrollPanel",
|
||||||
"data": {
|
"options": {"width": "100%", "height": "100%"},
|
||||||
"ppid": ppid,
|
"subwidgets": subwidgets
|
||||||
"data": data,
|
}, ensure_ascii=False)
|
||||||
"items": subwidgets
|
|
||||||
}
|
|
||||||
}
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
exception(f'{ppid=}, {data=}, {e}{format_exc()}')
|
exception(f'{ppid=}, {data=}, {e}{format_exc()}')
|
||||||
return {
|
return json.dumps({
|
||||||
"status": "error",
|
"widgettype": "Text",
|
||||||
"data": {
|
"options": {"width": "100%", "color": "red", "text": f'{ppid=}, {data=}, {e}'}
|
||||||
"message": f'{ppid=}, {data=}, {e}'
|
}, ensure_ascii=False)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -41,29 +41,11 @@
|
|||||||
{
|
{
|
||||||
"wid": "input_form",
|
"wid": "input_form",
|
||||||
"event": "submit",
|
"event": "submit",
|
||||||
"actiontype": "urldata",
|
"actiontype": "bricks",
|
||||||
"target": "result",
|
"target": "result",
|
||||||
"options": {
|
"options": {
|
||||||
"url": "{{entire_url('./test_pricing_program.dspy')}}",
|
"url": "{{entire_url('./test_pricing_program.dspy')}}",
|
||||||
"params":{}
|
"params":{}
|
||||||
},
|
|
||||||
"status_of": {
|
|
||||||
"ok": {
|
|
||||||
"widgettype": "VScrollPanel",
|
|
||||||
"options":{
|
|
||||||
"width": "100%",
|
|
||||||
"height": "100%"
|
|
||||||
},
|
|
||||||
"subwidgets": "${items}"
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"widgettype": "Text",
|
|
||||||
"options":{
|
|
||||||
"width": "100%",
|
|
||||||
"color": "red",
|
|
||||||
"text": "${message}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user