fix: 新建世界入口改真实表单页create_page.ui(原指向create_world.dspy返回JSON无法渲染)

This commit is contained in:
agent.develop 2026-08-30 22:14:24 +08:00
parent 327ea5faa3
commit a8ead96ab3
2 changed files with 77 additions and 1 deletions

76
wwwroot/create_page.ui Normal file
View File

@ -0,0 +1,76 @@
{
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%",
"padding": "20px"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"label": "新建世界",
"fontSize": "20px"
}
},
{
"widgettype": "Form",
"options": {
"title": "新建世界",
"submit_url": "{{entire_url('/world/api/create_world.dspy')}}",
"method": "POST",
"submit_label": "创建",
"fields": [
{
"name": "name",
"label": "世界名称",
"uitype": "str",
"required": true,
"placeholder": "输入世界名称"
},
{
"name": "code",
"label": "世界编码",
"uitype": "str",
"placeholder": "留空自动生成"
},
{
"name": "description",
"label": "描述",
"uitype": "text"
},
{
"name": "world_type",
"label": "世界类型",
"uitype": "code",
"dataurl": "{{entire_url('/world/api/get_search_world_type.dspy')}}",
"valueField": "world_type",
"textField": "world_type_text"
},
{
"name": "status",
"label": "状态",
"uitype": "code",
"dataurl": "{{entire_url('/world/api/get_search_status.dspy')}}",
"valueField": "status",
"textField": "status_text"
},
{
"name": "config_json",
"label": "世界配置JSON",
"uitype": "text"
}
]
},
"binds": [
{
"wid": "self",
"event": "submited",
"actiontype": "script",
"target": "self",
"script": "event.params.json().then(function(r){if(r&&r.widgettype){bricks.widgetBuild(r,bricks.Body)}else{var ok=r&&r.success;new bricks.Message({title:ok?'成功':'失败',message:ok?('已创建'+(r.id?(' id='+r.id):'')):(r&&r.message?r.message:'操作失败'),timeout:4})}})"
}
]
}
]
}

View File

@ -10,7 +10,7 @@
"subwidgets": [{"widgettype": "Text", "options": {"label": "世界列表"}}]},
{"widgettype": "VBox", "options": {"backgroundColor": "#FFFFFF", "padding": "20px", "cursor": "pointer"},
"binds": [{"wid": "self", "event": "click", "actiontype": "urlwidget", "target": "app.world_content",
"options": {"url": "{{entire_url('/world/api/create_world.dspy')}}"}, "mode": "replace"}],
"options": {"url": "{{entire_url('/world/create_page.ui')}}"}, "mode": "replace"}],
"subwidgets": [{"widgettype": "Text", "options": {"label": "新建世界"}}]}
]},
{"widgettype": "VBox", "id": "world_content", "options": {"width": "100%", "flex": "1", "marginTop": "20px"}}