world_snapshot/wwwroot/create_page.ui

68 lines
2.0 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_snapshot/api/create_snapshot.dspy')}}",
"method": "POST",
"submit_label": "生成快照",
"fields": [
{
"name": "world_id",
"label": "目标世界",
"uitype": "code",
"required": true,
"dataurl": "{{entire_url('/world_snapshot/api/get_search_world_id.dspy')}}",
"valueField": "value",
"textField": "text"
},
{
"name": "name",
"label": "快照名称",
"uitype": "str",
"required": true
},
{
"name": "snapshot_type",
"label": "快照类型",
"uitype": "code",
"dataurl": "{{entire_url('/world_snapshot/api/get_search_snapshot_type.dspy')}}",
"valueField": "value",
"textField": "text"
},
{
"name": "status",
"label": "状态",
"uitype": "code",
"dataurl": "{{entire_url('/world_snapshot/api/get_search_status.dspy')}}",
"valueField": "value",
"textField": "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})}})"
}
]
}
]
}