30 lines
2.4 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"widgettype": "VBox",
"options": {"width": "100%", "height": "100%", "padding": "0"},
"subwidgets": [
{
"widgettype": "HBox",
"options": {"width": "100%", "alignItems": "center", "padding": "16px 24px 8px 24px", "cheight": 6, "gap": "12px"},
"subwidgets": [
{"widgettype": "Title2", "options": {"text": "技能管理"}},
{"widgettype": "Text", "options": {"text": "技能生命周期:开发 → 测试 → 审批 → 发布(发布后同步到所有机构)", "cfontsize": 0.9, "color": "#94a3b8"}},
{"widgettype": "Filler"},
{
"widgettype": "Button",
"id": "btn_new",
"options": {"label": " 新建提议", "css": "small", "color": "#2563eb"},
"binds": [{
"wid": "self", "event": "click", "actiontype": "script", "target": "self",
"script": "var pw=new bricks.PopupWindow({title:'新建技能提议',cwidth:60,cheight:34,auto_open:true});var form=new bricks.Form({name:'skp',cols:1,fields:[{name:'name',uitype:'text',label:'技能名',placeholder:'如 question-escalation',required:true},{name:'description',uitype:'text',label:'描述',placeholder:'一句话说明触发条件'},{name:'content',uitype:'textarea',label:'SKILL.md 内容',cheight:12,required:true}]});var vb=new bricks.VBox({padding:'16px',gap:'12px'});vb.add_widget(form);var save=new bricks.Button({label:'提交',css:'primary'});save.set_click(function(){var v=form.getValue();if(!v||!v.name||!v.content){alert('请填写技能名和内容');return;}var body=new URLSearchParams();body.append('action','create');body.append('name',v.name);body.append('description',v.description||'');body.append('content',v.content);fetch('/pipeline_core/api/skill_proposals.dspy',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:body}).then(function(r){return r.json()}).then(function(d){if(d.success){pw.destroy();location.reload();}else{alert(d.error||'创建失败');}});});vb.add_widget(save);pw.content_w.add_widget(vb);"
}]
}
]
},
{
"widgettype": "urlwidget",
"id": "proposal_list",
"options": {"url": "{{entire_url('/pipeline_core/api/skill_proposals_list.dspy')}}", "method": "GET"}
}
]
}