feat: test_pricing_program结果每条记录单独显示
- dspy: 每条结果json.dumps(r, ensure_ascii=False)后以\n\n分隔 - ui: 结果区改为VScrollPanel,支持长结果滚动
This commit is contained in:
parent
759cd14a56
commit
972400e382
@ -4,12 +4,19 @@ try:
|
||||
if isinstance(data, str):
|
||||
data = json.loads(data)
|
||||
x = await buffered_charging(ppid, data)
|
||||
items = []
|
||||
if isinstance(x, list):
|
||||
for r in x:
|
||||
items.append(json.dumps(r, ensure_ascii=False))
|
||||
else:
|
||||
items.append(json.dumps(x, ensure_ascii=False))
|
||||
result_text = '\n\n'.join(items)
|
||||
return {
|
||||
"status": "ok",
|
||||
"data": {
|
||||
"ppid": ppid,
|
||||
"data": data,
|
||||
"result": x
|
||||
"items": result_text
|
||||
}
|
||||
}
|
||||
except Exception as e:
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"widgettype": "VScrollPanel",
|
||||
"id": "result",
|
||||
"options": {
|
||||
"height": "50%",
|
||||
@ -52,7 +52,7 @@
|
||||
"widgettype": "Text",
|
||||
"options":{
|
||||
"width": "100%",
|
||||
"text": "${result}"
|
||||
"text": "${items}"
|
||||
}
|
||||
},
|
||||
"error": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user