- 3表: tk_tickets(状态机+受理角色/人+agent锁)/tk_messages(客户可见/内部备注)/tk_transfers(append-only流水) - core.py: 8态13迁移状态机全乐观锁; 转派候选动态查owner角色+'0'机构用户(不硬编码); 默认受理角色params可配(ticket_default_role=owner.maintainer) - agent.py: 异步poller(bid_flow范式), RAG检索'0'机构KB+历史工单, llm_call(org_id=0) LLM裁决能否回答(严格JSON), 硬门禁reply<20字符转人工, 故障≠答不了(fail_rounds>=3转人工), stale回收10min; 追问回流(agent_processing+owner空)立即拾取不等stale - todos.py: 平台待办provider, 状态派生(客户待确认/角色池待认领/受理人待处理) - init.py: load_ticket注册env+provider+poller(PIPELINE_MODE=web不启动) - wwwroot: 客户我的工单页+建单表单, 运维工单管理页(队列切换), 详情弹窗(正文与操作同屏,按视角出按钮) - load_path.py: logined全部API(业务权限服务端按current_role动态校验)+管理页壳owner三角色 - init/data.json: 7组码表+owner.maintainer角色种子(app_audit先例)
24 lines
1.6 KiB
XML
24 lines
1.6 KiB
XML
{
|
|
"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();} }"}
|
|
]
|
|
}
|