feat(todos): 待办弹窗按source=ticket分流——工单badge(青)+详情指向/ticket/api/ticket_detail_popup.dspy?from_todo=1
配合pipeline-service的register_todo_provider(工单模块注入): 平台待办通道新增工单来源, 客户回复待确认/运维待认领/受理人待处理 统一在头部角标+待办弹窗异步通知
This commit is contained in:
parent
3e8789998d
commit
3465825d38
@ -23,6 +23,7 @@ TYPE_COLOR = {
|
||||
}
|
||||
|
||||
detail_url = entire_url("/pipeline-sdlc/api/todo_detail.dspy")
|
||||
ticket_detail_url = entire_url("/ticket/api/ticket_detail_popup.dspy")
|
||||
|
||||
|
||||
def _s(v):
|
||||
@ -60,7 +61,13 @@ for t in (todos or []):
|
||||
tid = _s(t.get('id'))
|
||||
kind = 'question' if src == 'question' else 'human_task'
|
||||
task_type = _s(t.get('task_type'))
|
||||
if src == 'question':
|
||||
if src == 'ticket':
|
||||
# 工单待办(2026-09-10 接入平台待办):badge 用 provider 给的分类
|
||||
badge = _s(t.get('badge')) or '工单'
|
||||
badge_color = '#0ea5e9'
|
||||
title = _clip(t.get('title'), 80) or '工单'
|
||||
summary = _clip(t.get('description'), 110)
|
||||
elif src == 'question':
|
||||
badge = '待答问题'
|
||||
badge_color = '#8b5cf6'
|
||||
title = _clip(t.get('question'), 80) or '冒泡问题'
|
||||
@ -79,10 +86,18 @@ for t in (todos or []):
|
||||
if t.get('created_at'):
|
||||
meta_bits.append(_s(t.get('created_at')))
|
||||
|
||||
open_script = ("var du=" + _json.dumps(detail_url) + "+'?kind=" + kind + "&id='+encodeURIComponent("
|
||||
+ _json.dumps(tid) + ");"
|
||||
"var rp=await fetch(du);var dd=await rp.json();"
|
||||
"await bricks.widgetBuild(dd,bricks.app);")
|
||||
if src == 'ticket':
|
||||
# 工单待办详情走 ticket 模块自持端点(from_todo=1 → 弹窗 id 用待办专用,
|
||||
# 关闭时连带关待办列表弹窗)
|
||||
open_script = ("var du=" + _json.dumps(ticket_detail_url) + "+'?from_todo=1&id='+encodeURIComponent("
|
||||
+ _json.dumps(tid) + ");"
|
||||
"var rp=await fetch(du);var dd=await rp.json();"
|
||||
"await bricks.widgetBuild(dd,bricks.app);")
|
||||
else:
|
||||
open_script = ("var du=" + _json.dumps(detail_url) + "+'?kind=" + kind + "&id='+encodeURIComponent("
|
||||
+ _json.dumps(tid) + ");"
|
||||
"var rp=await fetch(du);var dd=await rp.json();"
|
||||
"await bricks.widgetBuild(dd,bricks.app);")
|
||||
|
||||
sub = [
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user