From 89f670af88ce415ca3207c2436111f7ac47a4f5b Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 25 Aug 2026 13:56:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(todo=5Fbadge):=20Button=20=E6=97=A0=20set?= =?UTF-8?q?=5Fclick=20=E6=96=B9=E6=B3=95=EF=BC=8C=E6=94=B9=E7=94=A8=20bind?= =?UTF-8?q?('click',=20...)=20=E7=BB=91=E5=AE=9A=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/todo_badge.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wwwroot/todo_badge.js b/wwwroot/todo_badge.js index 127f43c..8f52c8a 100644 --- a/wwwroot/todo_badge.js +++ b/wwwroot/todo_badge.js @@ -42,7 +42,7 @@ if (src === 'human_task' && t.task_type === 'bug_acceptance') { var hb = new bricks.HBox({gap:'6px'}); var okb = new bricks.Button({label:'通过', css:'small'}); - okb.set_click(function(){ + okb.bind('click', function(){ fetch('/pipeline-sdlc/api/bug_accept.dspy', {method:'POST', headers:{'Content-Type':'application/x-www-form-urlencoded'}, body:'bug_id='+encodeURIComponent(t.bug_id)+'&accept=1'}) .then(function(r){ return r.json(); }) .then(function(d){ @@ -51,7 +51,7 @@ }); }); var nob = new bricks.Button({label:'不通过', css:'small'}); - nob.set_click(function(){ + nob.bind('click', function(){ fetch('/pipeline-sdlc/api/bug_accept.dspy', {method:'POST', headers:{'Content-Type':'application/x-www-form-urlencoded'}, body:'bug_id='+encodeURIComponent(t.bug_id)+'&accept=0'}) .then(function(r){ return r.json(); }) .then(function(d){ @@ -65,7 +65,7 @@ } 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(){ + okb2.bind('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){ @@ -74,7 +74,7 @@ }); }); var rb2 = new bricks.Button({label:'不确定,退回重做', css:'small'}); - rb2.set_click(function(){ + rb2.bind('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)}) @@ -89,7 +89,7 @@ card.add_widget(cb); } else if (src === 'human_task') { var db = new bricks.Button({label:'处理', css:'small'}); - db.set_click(function(){ + db.bind('click', function(){ var v = prompt('请输入处理结果:', ''); if (v === null) return; fetch('/pipeline-sdlc/api/human_task_complete.dspy', {method:'POST', headers:{'Content-Type':'application/x-www-form-urlencoded'}, body:'human_task_id='+encodeURIComponent(t.id)+'&result_data='+encodeURIComponent(JSON.stringify({content:v}))})