{ "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})}})" } ] } ] }