1 暂停和中止按钮功能 2 if (obj.event === 'del') { 3 layer.confirm('确认中止么', function (index) { 4 $.ajax({ 5 type: "post", 6 url: "/flow/processIntance/delete.afca", 7 data: { 8 "processInstanceId": data.processInstanceId, 9 "deleteReason": inputValue10 },11 dataType: 'json',12 success: function (data) {13 14 if (data.code === '0') {15 // obj.del();16 layer.close(index);17 layer.msg(data.msg, {icon: 1, time: 2000, shade: 0.1});18 console.log(table);19 reload();20 } else {21 layer.close(index);22 layer.alert(data.msg, {23 icon: 2, title: '提示'24 });25 return;26 }27 },28 error: function () {29 }30 })31 });32 } else if (obj.event === 'start-process' || obj.event === 'stop-process') {33 var text = (data.suspended) ? "继续" : "暂停";34 layer.confirm('确认' + text + '当前流程吗', function (index) {35 $.ajax({36 type: "post",37 url: "/flow/isSuspended.afca",38 data: {39 "processInstanceId": data.processInstanceId,40 "type": data.suspended ? 'start' : 'stop'41 },42 dataType: 'json',43 success: function (data) {44 45 if (data.code === '0') {46 // obj.del();47 layer.close(index);48 layer.msg(data.msg, {icon: 1, time: 2000, shade: 0.1});49 reload();50 } else {51 layer.close(index);52 layer.alert(data.msg, {53 icon: 2, title: '提示'54 });55 return;56 }57 },58 error: function () {59 }60 })61 });62 }
1 //编辑,删除,发布申请 2 table.on('tool(demo)', function(obj){ 3 var data = obj.data; 4 // console.log(data) 5 if(obj.event === 'check'){ 6 // console.log(data.id); 7 $('.textCon').val(""); 8 layer.open({ 9 title: '发布申请' 10 ,type: 1 11 ,maxmin:true 12 ,area: ['700px','570px'] 13 ,content: $('#toExamine') 14 ,btn: ['申请', '取消'] 15 ,yes: function(index, layero) { 16 var userName = $('#userRadio').val(); 17 if(userName == null || userName == ''){ 18 layer.msg("请选择用户", {icon: 2, time: 2000}); 19 return; 20 } 21 var describe = $('.textCon').val(); 22 if(describe == null || describe == ''){ 23 layer.msg("请输入内容", {icon: 2, time: 2000}); 24 return; 25 } 26 $.ajax({ 27 type: "post", 28 url: "/approval/application/save.afca", 29 dataType:'json', 30 data: { 31 name: data.toolName, 32 targerId: data.id, 33 status: 0, 34 type: 'script', 35 describe: $('.textCon').val(), 36 key: 'script', 37 supUser:userName 38 }, 39 success: function (data) { 40 var message = data.msg; 41 if(data.code === '0'){ 42 obj.del(); 43 layer.close(index); 44 layer.msg(message,{icon: 1,time:2000}); 45 tableObj.reload({ 46 url:'/cd/workPlatform/tool/queryTools.afca' 47 }); 48 } else { 49 layer.alert(message, { 50 icon: 2,title:'提示' 51 }); 52 return; 53 } 54 }, 55 error: function () { 56 } 57 }) 58 } 59 }); 60 getAllUser(); 61 $('.laytable-cell-checkbox').eq(0).empty(); 62 } else if(obj.event === 'del'){ 63 layer.confirm('确认删除么', function(index) { 64 $.ajax({ 65 type: "post", 66 url: "/cd/workPlatform/tool/remove.afca", 67 dataType:'json', 68 data: "id="+data.id, 69 dataType: "json", 70 success: function (data) { 71 // console.log(data); 72 var message = data.msg; 73 var code = data.code; 74 // console.log(message); 75 // console.log(code); 76 if(data.code === '0'){ 77 //obj.del(); 78 layer.close(index); 79 layer.alert(message,{icon: 1,time:2000}); 80 tableObj.reload({ 81 url:'/cd/workPlatform/tool/queryTools.afca' 82 }); 83 } else { 84 layer.alert(message, { 85 icon: 2,title:'提示' 86 }); 87 return; 88 } 89 }, 90 error: function () { 91 } 92 93 }) 94 }); 95 //编辑脚本定义 96 }else if(obj.event === 'edit'){ 97 //之前版本 98 // window.location.href='workToolEdit.html?toolSceneId='+data.toolSceneId+'&'+'id='+data.id; 99 //脚本编辑弹出层100 var name = encodeURIComponent(data.toolName);101 // console.log(data.toolName);102 parent.layer.open({103 type: 2,104 title: '编辑脚本定义',105 // title:data.to,106 shadeClose: true,107 shade: 0.8,108 // maxmin: true,109 area: ['100%', '100%'],110 content: 'html/taskManagement/scriptManagement/workToolEdit.html?toolSceneId='+data.toolSceneId+'&'+'id='+data.id111 });112 }else if(obj.event === 'showInformation'){113 //脚本展示弹出层114 var name = encodeURIComponent(data.toolName);115 // console.log(data.toolName);116 parent.layer.open({117 type: 2,118 title: '展示脚本定义',119 // title:data.to,120 shadeClose: true,121 shade: 0.8,122 // maxmin: true,123 area: ['100%', '100%'],124 content: 'html/taskManagement/scriptManagement/showScriptInformation.html?id='+data.id125 });126 }127 else if(obj.event ==='jump'){128 // window.location.href='openScriptParaVerManagement.html?toolId='+data.id;129 var name = encodeURIComponent(data.toolName);130 // console.log(data.toolName);131 parent.layer.open({132 type: 2,133 title: '参数版本管理',134 // title:data.to,135 shadeClose: true,136 shade: 0.8,137 // maxmin: true,138 area: ['100%', '100%'],139 content: 'html/taskManagement/scriptManagement/openScriptParaVerManagement.html?toolId='+data.id+"&jiaoben="+name+"&banben="+data.version+"&scriptLanguage="+data.scriptLanguage+"&categoryName="+data.categoryName+"&=status"+data.status140 });141 }142 });
1 //html代码 2