fix(todo_badge): Button 无 set_click 方法,改用 bind('click', ...) 绑定点击
This commit is contained in:
parent
f80a586828
commit
89f670af88
@ -42,7 +42,7 @@
|
|||||||
if (src === 'human_task' && t.task_type === 'bug_acceptance') {
|
if (src === 'human_task' && t.task_type === 'bug_acceptance') {
|
||||||
var hb = new bricks.HBox({gap:'6px'});
|
var hb = new bricks.HBox({gap:'6px'});
|
||||||
var okb = new bricks.Button({label:'通过', css:'small'});
|
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'})
|
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(r){ return r.json(); })
|
||||||
.then(function(d){
|
.then(function(d){
|
||||||
@ -51,7 +51,7 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
var nob = new bricks.Button({label:'不通过', css:'small'});
|
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'})
|
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(r){ return r.json(); })
|
||||||
.then(function(d){
|
.then(function(d){
|
||||||
@ -65,7 +65,7 @@
|
|||||||
} else if (src === 'human_task' && (t.task_type === 'requirement_confirmation' || t.task_type === 'design_confirmation')) {
|
} else if (src === 'human_task' && (t.task_type === 'requirement_confirmation' || t.task_type === 'design_confirmation')) {
|
||||||
var cb = new bricks.HBox({gap:'6px'});
|
var cb = new bricks.HBox({gap:'6px'});
|
||||||
var okb2 = new bricks.Button({label:'确认通过', css:'small'});
|
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'})
|
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(r){ return r.json(); })
|
||||||
.then(function(d){
|
.then(function(d){
|
||||||
@ -74,7 +74,7 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
var rb2 = new bricks.Button({label:'不确定,退回重做', css:'small'});
|
var rb2 = new bricks.Button({label:'不确定,退回重做', css:'small'});
|
||||||
rb2.set_click(function(){
|
rb2.bind('click', function(){
|
||||||
var v = prompt('请填写修改意见(将退回重做):', '');
|
var v = prompt('请填写修改意见(将退回重做):', '');
|
||||||
if (v === null) return;
|
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)})
|
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);
|
card.add_widget(cb);
|
||||||
} else if (src === 'human_task') {
|
} else if (src === 'human_task') {
|
||||||
var db = new bricks.Button({label:'处理', css:'small'});
|
var db = new bricks.Button({label:'处理', css:'small'});
|
||||||
db.set_click(function(){
|
db.bind('click', function(){
|
||||||
var v = prompt('请输入处理结果:', '');
|
var v = prompt('请输入处理结果:', '');
|
||||||
if (v === null) return;
|
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}))})
|
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}))})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user