{ "widgettype": "Form", "id": "new_ticket_form", "options": { "cols": 1, "title": "提交工单", "padding": "16px", "submit_url": "{{entire_url('/ticket/api/ticket_create.dspy')}}", "method": "POST", "fields": [ {"name": "title", "label": "问题标题", "uitype": "str", "required": true, "placeholder": "一句话概括您的问题"}, {"name": "description", "label": "问题描述", "uitype": "text", "required": true, "placeholder": "详细描述问题现象、发生时间、涉及的功能/账户等,便于快速定位"}, {"name": "category", "label": "问题分类", "uitype": "code", "value": "consult", "data": [{"value": "consult", "text": "使用咨询"}, {"value": "fault", "text": "故障报修"}, {"value": "billing", "text": "计费账务"}, {"value": "other", "text": "其他"}]}, {"name": "priority", "label": "优先级", "uitype": "code", "value": "normal", "data": [{"value": "low", "text": "低"}, {"value": "normal", "text": "普通"}, {"value": "high", "text": "高"}, {"value": "urgent", "text": "紧急"}]} ] }, "binds": [ {"wid": "self", "event": "submited", "actiontype": "script", "target": "self", "script": "var d=event.params||{}; await bricks.show_resp_message_or_error(d); if(d.success){ var pw=bricks.getWidgetById('new_ticket_pw',bricks.app); if(pw){pw.destroy();} var tbl=bricks.getWidgetById('my_ticket_table',bricks.app.root); if(tbl){await tbl.render({});} if(window.refreshTodo){window.refreshTodo();} }"} ] }