fix: 新建脚本入口改真实表单页create_script.ui(原直接指向add_script_engine.dspy)

This commit is contained in:
agent.develop 2026-08-30 22:14:25 +08:00
parent e7f99bb026
commit 1330e45f7a
2 changed files with 71 additions and 1 deletions

70
wwwroot/create_script.ui Normal file
View File

@ -0,0 +1,70 @@
{
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%",
"padding": "20px"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"label": "新建脚本",
"fontSize": "20px"
}
},
{
"widgettype": "Form",
"options": {
"title": "新建脚本",
"submit_url": "{{entire_url('/script_engine/script_engine/add_script_engine.dspy')}}",
"method": "POST",
"submit_label": "创建",
"fields": [
{
"name": "script_name",
"label": "脚本名称",
"uitype": "str",
"required": true
},
{
"name": "script_type",
"label": "脚本类型",
"uitype": "code",
"dataurl": "{{entire_url('/script_engine/api/get_search_script_type.dspy')}}",
"valueField": "script_type",
"textField": "script_type_text"
},
{
"name": "content",
"label": "脚本内容",
"uitype": "text",
"required": true
},
{
"name": "description",
"label": "描述",
"uitype": "str"
},
{
"name": "status",
"label": "状态",
"uitype": "code",
"dataurl": "{{entire_url('/script_engine/api/get_search_status.dspy')}}",
"valueField": "status",
"textField": "status_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": "脚本列表", "fontSize": "16px"}}]}, "subwidgets": [{"widgettype": "Text", "options": {"label": "脚本列表", "fontSize": "16px"}}]},
{"widgettype": "VBox", "options": {"backgroundColor": "#FFFFFF", "padding": "20px", "cursor": "pointer"}, {"widgettype": "VBox", "options": {"backgroundColor": "#FFFFFF", "padding": "20px", "cursor": "pointer"},
"binds": [{"wid": "self", "event": "click", "actiontype": "urlwidget", "target": "app.script_engine_content", "binds": [{"wid": "self", "event": "click", "actiontype": "urlwidget", "target": "app.script_engine_content",
"options": {"url": "{{entire_url('/script_engine/script_engine/add_script_engine.dspy')}}"}, "mode": "replace"}], "options": {"url": "{{entire_url('/script_engine/create_script.ui')}}"}, "mode": "replace"}],
"subwidgets": [{"widgettype": "Text", "options": {"label": "新建脚本", "fontSize": "16px"}}]} "subwidgets": [{"widgettype": "Text", "options": {"label": "新建脚本", "fontSize": "16px"}}]}
]}, ]},
{"widgettype": "VBox", "id": "script_engine_content", "options": {"width": "100%", "flex": "1", "marginTop": "20px"}} {"widgettype": "VBox", "id": "script_engine_content", "options": {"width": "100%", "flex": "1", "marginTop": "20px"}}