layui中table表格的操作列(删除,编辑)等按钮的操作 1暂停和中⽌按钮功能
2if (obj.event === 'del') {
3 firm('确认中⽌么', function (index) {
4 $.ajax({
5 type: "post",
6 url: "/flow/processIntance/delete.afca",delete删除表格还是内容
7 data: {
8 "processInstanceId": data.processInstanceId,
9 "deleteReason": inputValue
10 },
11 dataType: 'json',
12 success: function (data) {
13
14if (de === '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 });
25return;
26 }
27 },
28 error: function () {
29 }
30 })
31 });
32 } else if (obj.event === 'start-process' || obj.event === 'stop-process') {
33var text = (data.suspended) ? "继续" : "暂停";
34 firm('确认' + 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
45if (de === '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 });
55return;
56 }
57 },
58 error: function () {
59 }
60 })
61 });
62 }
1 //编辑,删除,发布申请
2 ('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: lName,
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 de === '0'){
42 obj.del();
43 layer.close(index);
44 layer.msg(message,{icon: 1,time:2000});
45 load({
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 firm('确认删除么', 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 = de;
74 // console.log(message);
75 // console.log(code);
76 de === '0'){
77 //obj.del();
78 layer.close(index);
79 layer.alert(message,{icon: 1,time:2000});
80 load({
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='+lSceneId+'&'+'id='+data.id;
99 //脚本编辑弹出层
100 var name = lName);
101 // console.lName);
102 parent.layer.open({
103 type: 2,
104 title: '编辑脚本定义',
105 // ,
106 shadeClose: true,
107 shade: 0.8,
108 // maxmin: true,
109 area: ['100%', '100%'],
110 content: 'html/taskManagement/scriptManagement/workToolEdit.html?toolSceneId='+lSceneId+'&'+'id='+data.id
111 });
112 }else if(obj.event === 'showInformation'){
113 //脚本展⽰弹出层
114 var name = lName);
115 // console.lName);
116 parent.layer.open({
117 type: 2,
118 title: '展⽰脚本定义',
119 // ,
120 shadeClose: true,
121 shade: 0.8,
122 // maxmin: true,
123 area: ['100%', '100%'],
124 content: 'html/taskManagement/scriptManagement/showScriptInformation.html?id='+data.id
125 });
126 }
127 else if(obj.event ==='jump'){
128 // window.location.href='openScriptParaVerManagement.html?toolId='+data.id;
129 var name = lName);
130 // console.lName);
131 parent.layer.open({
132 type: 2,
133 title: '参数版本管理',
134 // ,
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.categor 140 });
141 }
142 });
1 //html代码
2<script type="text/html" id="barDemo">
3 <!--操作⼯具-->
4 <a href="" lay-event="edit">编辑</a>
5 <a href="" lay-event="jump">参数管理</a>
6 <a href="" lay-event="del">删除</a>
7 {{# if (d.status !="1"){}}
8 <a href="" lay-event="check">发布申请</a>
9 {{#}}}
10</script>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论