From f80a58682803dec89cea821bb978e58e8cf5a27d Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 25 Aug 2026 13:19:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(todo):=20=E5=BE=85=E5=8A=9E=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=8A=A0=E9=9C=80=E6=B1=82/=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E6=8C=89=E9=92=AE(=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E9=80=9A=E8=BF=87/=E9=80=80=E5=9B=9E=E9=87=8D=E5=81=9A)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/todo_badge.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/wwwroot/todo_badge.js b/wwwroot/todo_badge.js index 004acc9..127f43c 100644 --- a/wwwroot/todo_badge.js +++ b/wwwroot/todo_badge.js @@ -30,7 +30,7 @@ todos.forEach(function(t){ var src = t.source || ''; var title = src === 'question' ? (t.question || '') : (t.title || ''); - var label = src === 'question' ? '问题' : (t.task_type === 'bug_acceptance' ? 'Bug验收' : '人类任务'); + var label = src === 'question' ? '问题' : (t.task_type === 'bug_acceptance' ? 'Bug验收' : (t.task_type === 'requirement_confirmation' ? '需求确认' : (t.task_type === 'design_confirmation' ? '设计确认' : '人类任务'))); var card = new bricks.VBox({bgcolor:'#fff', border:'1px solid #e2e8f0', borderRadius:'8px', padding:'10px 14px', gap:'6px', marginBottom:'4px'}); var hdr = new bricks.HBox({alignItems:'center', gap:'8px'}); hdr.add_widget(new bricks.Text({text:label, cfontsize:0.7, color:'#ffffff', padding:'1px 8px', style:{background: src==='question' ? '#8b5cf6' : (t.task_type==='bug_acceptance' ? '#f0a040' : '#2563eb'), borderRadius:'10px', fontWeight:'bold'}})); @@ -62,6 +62,31 @@ hb.add_widget(okb); hb.add_widget(nob); card.add_widget(hb); + } else if (src === 'human_task' && (t.task_type === 'requirement_confirmation' || t.task_type === 'design_confirmation')) { + var cb = new bricks.HBox({gap:'6px'}); + var okb2 = new bricks.Button({label:'确认通过', css:'small'}); + okb2.set_click(function(){ + fetch('/pipeline-sdlc/api/stage_confirm.dspy', {method:'POST', headers:{'Content-Type':'application/x-www-form-urlencoded'}, body:'human_task_id='+encodeURIComponent(t.id)+'&confirmed=1'}) + .then(function(r){ return r.json(); }) + .then(function(d){ + alert(d.success ? (d.message || '已确认,继续后续任务') : (d.error || '失败')); + if (d.success) { pw.destroy(); refreshTodo(); } + }); + }); + var rb2 = new bricks.Button({label:'不确定,退回重做', css:'small'}); + rb2.set_click(function(){ + var v = prompt('请填写修改意见(将退回重做):', ''); + if (v === null) return; + fetch('/pipeline-sdlc/api/stage_confirm.dspy', {method:'POST', headers:{'Content-Type':'application/x-www-form-urlencoded'}, body:'human_task_id='+encodeURIComponent(t.id)+'&confirmed=0&comment='+encodeURIComponent(v)}) + .then(function(r){ return r.json(); }) + .then(function(d){ + alert(d.success ? (d.message || '已退回重做') : (d.error || '失败')); + if (d.success) { pw.destroy(); refreshTodo(); } + }); + }); + cb.add_widget(okb2); + cb.add_widget(rb2); + card.add_widget(cb); } else if (src === 'human_task') { var db = new bricks.Button({label:'处理', css:'small'}); db.set_click(function(){