From a8ead96ab32454a85ab11fcdc1a860279ae59b74 Mon Sep 17 00:00:00 2001 From: "agent.develop" Date: Sun, 30 Aug 2026 22:14:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=B0=E5=BB=BA=E4=B8=96=E7=95=8C?= =?UTF-8?q?=E5=85=A5=E5=8F=A3=E6=94=B9=E7=9C=9F=E5=AE=9E=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E9=A1=B5create=5Fpage.ui(=E5=8E=9F=E6=8C=87=E5=90=91create=5Fw?= =?UTF-8?q?orld.dspy=E8=BF=94=E5=9B=9EJSON=E6=97=A0=E6=B3=95=E6=B8=B2?= =?UTF-8?q?=E6=9F=93)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/create_page.ui | 76 ++++++++++++++++++++++++++++++++++++++++++ wwwroot/index.ui | 2 +- 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 wwwroot/create_page.ui diff --git a/wwwroot/create_page.ui b/wwwroot/create_page.ui new file mode 100644 index 0000000..20c7b28 --- /dev/null +++ b/wwwroot/create_page.ui @@ -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})}})" + } + ] + } + ] +} \ No newline at end of file diff --git a/wwwroot/index.ui b/wwwroot/index.ui index 9aa7bad..43303cd 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -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"}}