world/wwwroot/create_page.ui

76 lines
2.1 KiB
XML

{
"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": "value",
"textField": "text"
},
{
"name": "status",
"label": "状态",
"uitype": "code",
"dataurl": "{{entire_url('/world/api/get_search_status.dspy')}}",
"valueField": "value",
"textField": "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})}})"
}
]
}
]
}