暂停和中止按钮功能
if (obj.event === 'del') {
layer.confirm('确认中止么', function (index) {
$.ajax({
type: "post",
url: "/flow/processIntance/delete.afca",
data: {
"processInstanceId": data.processInstanceId,
"deleteReason": inputValue
},
dataType: 'json',
success: function (data) { if (data.code === '0') {
// obj.del();
layer.close(index);
layer.msg(data.msg, {icon: 1, time: 2000, shade: 0.1});
console.log(table);
reload();
} else {
layer.close(index);
layer.alert(data.msg, {
icon: 2, title: '提示'
});
return;
}
},
error: function () {
}
})
});
} else if (obj.event === 'start-process' || obj.event === 'stop-process') {
var text = (data.suspended) ? "继续" : "暂停";
layer.confirm('确认' + text + '当前流程吗', function (index) {
$.ajax({
type: "post",
url: "/flow/isSuspended.afca",
data: {
"processInstanceId": data.processInstanceId,
"type": data.suspended ? 'start' : 'stop'
},
dataType: 'json',
success: function (data) { if (data.code === '0') {
// obj.del();
layer.close(index);
layer.msg(data.msg, {icon: 1, time: 2000, shade: 0.1});
reload();
} else {
layer.close(index);
layer.alert(data.msg, {
icon: 2, title: '提示'
});
return;
}
},
error: function () {
}
})
});
}

     //编辑,删除,发布申请
table.on('tool(demo)', function(obj){
var data = obj.data;
// console.log(data)
if(obj.event === 'check'){
// console.log(data.id);
$('.textCon').val("");
layer.open({
title: '发布申请'
,type: 1
,maxmin:true
,area: ['700px','570px']
,content: $('#toExamine')
,btn: ['申请', '取消']
,yes: function(index, layero) {
var userName = $('#userRadio').val();
if(userName == null || userName == ''){
layer.msg("请选择用户", {icon: 2, time: 2000});
return;
}
var describe = $('.textCon').val();
if(describe == null || describe == ''){
layer.msg("请输入内容", {icon: 2, time: 2000});
return;
}
$.ajax({
type: "post",
url: "/approval/application/save.afca",
dataType:'json',
data: {
name: data.toolName,
targerId: data.id,
status: 0,
type: 'script',
describe: $('.textCon').val(),
key: 'script',
supUser:userName
},
success: function (data) {
var message = data.msg;
if(data.code === '0'){
obj.del();
layer.close(index);
layer.msg(message,{icon: 1,time:2000});
tableObj.reload({
url:'/cd/workPlatform/tool/queryTools.afca'
});
} else {
layer.alert(message, {
icon: 2,title:'提示'
});
return;
}
},
error: function () {
}
})
}
});
getAllUser();
$('.laytable-cell-checkbox').eq(0).empty();
} else if(obj.event === 'del'){
layer.confirm('确认删除么', function(index) {
$.ajax({
type: "post",
url: "/cd/workPlatform/tool/remove.afca",
dataType:'json',
data: "id="+data.id,
dataType: "json",
success: function (data) {
// console.log(data);
var message = data.msg;
var code = data.code;
// console.log(message);
// console.log(code);
if(data.code === '0'){
//obj.del();
layer.close(index);
layer.alert(message,{icon: 1,time:2000});
tableObj.reload({
url:'/cd/workPlatform/tool/queryTools.afca'
});
} else {
layer.alert(message, {
icon: 2,title:'提示'
});
return;
}
},
error: function () {
} })
});
//编辑脚本定义
}else if(obj.event === 'edit'){
//之前版本
// window.location.href='workToolEdit.html?toolSceneId='+data.toolSceneId+'&'+'id='+data.id;
//脚本编辑弹出层
var name = encodeURIComponent(data.toolName);
// console.log(data.toolName);
parent.layer.open({
type: 2,
title: '编辑脚本定义',
// title:data.to,
shadeClose: true,
shade: 0.8,
// maxmin: true,
area: ['100%', '100%'],
content: 'html/taskManagement/scriptManagement/workToolEdit.html?toolSceneId='+data.toolSceneId+'&'+'id='+data.id
});
}else if(obj.event === 'showInformation'){
//脚本展示弹出层
var name = encodeURIComponent(data.toolName);
// console.log(data.toolName);
parent.layer.open({
type: 2,
title: '展示脚本定义',
// title:data.to,
shadeClose: true,
shade: 0.8,
// maxmin: true,
area: ['100%', '100%'],
content: 'html/taskManagement/scriptManagement/showScriptInformation.html?id='+data.id
});
}
else if(obj.event ==='jump'){
// window.location.href='openScriptParaVerManagement.html?toolId='+data.id;
var name = encodeURIComponent(data.toolName);
// console.log(data.toolName);
parent.layer.open({
type: 2,
title: '参数版本管理',
// title:data.to,
shadeClose: true,
shade: 0.8,
// maxmin: true,
area: ['100%', '100%'],
content: 'html/taskManagement/scriptManagement/openScriptParaVerManagement.html?toolId='+data.id+"&jiaoben="+name+"&banben="+data.version+"&scriptLanguage="+data.scriptLanguage+"&categoryName="+data.categoryName+"&=status"+data.status
});
}
});
 //html代码
<script type="text/html" id="barDemo">
<!--操作工具-->
<a href="" lay-event="edit">编辑</a>
<a href="" lay-event="jump">参数管理</a>
<a href="" lay-event="del">删除</a>
{{# if (d.status !="1"){}}
<a href="" lay-event="check">发布申请</a>
{{#}}}
</script>

layui中table表格的操作列(删除,编辑)等按钮的操作的更多相关文章

  1. 关于html中table表格tr,td的高度和宽度

    关于html中table表格tr,td的高度和宽度 关于html中table表格tr,td的高度和宽度 做网页的时候经常会遇到各种各样的问题,经常遇到的一个就是会碰到表格宽度对不齐的问题.首先,来分析 ...

  2. jQuery遍历Table表格的行和列

    遍历Table表格的行和列,在开发中比较常用的功能,特别是前端开发人员,不多说,直接上代码,下面代码只是弹出第一列字段,请各位自己根据需求修改和扩展! <!DOCTYPE html PUBLIC ...

  3. jQuery 中使用 DOM 操作节点,对页面中的表格实现增、删、查、改操作

    查看本章节 查看作业目录 需求说明: 在 jQuery 中使用 DOM 操作节点,对页面中的表格实现增.删.查.改操作 点击"增加"超链接时,将表格中的第一条数据添加到表格的末尾 ...

  4. bootstrap table表格属性、列属性、事件、方法

    留存一份,原文地址http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation/ 表格参数 表格的参数定义在 jQuery.fn.bootst ...

  5. asp.net table表格表头及列固定实现

    http://blog.csdn.net/zdw_wym/article/details/48630337 在开发中常会遇到table表格中列特别多,下拉后,表头就看不见了,水平滚动后,第1.2列就看 ...

  6. 记一次LayUI中Table动态添加列数据

    这次在开发中遇到,有列数不固定的情况.废话不多说,先上图,在上代码. 下面上JS代码 function SearchData() { var dYear = $("#DYear") ...

  7. WPF下的Richtextbox中实现表格合并,添加删除行列等功能

    .Net中已有现在的方法实现这些功能,不过可能是由于未完善,未把方法公开出来.只能用反射的方法去调用它. 详细信息可以查看.Net Framework 的源代码 http://referencesou ...

  8. 刷连记录的迟到检测---Table表格增加一列值

    公司OA新增加了 刷脸记录 ,用于查看自己是否迟到,但是没有什么提醒,于是乎自己写了一个脚本 刷连记录 类似于这样的: 运行脚本后,是这个样子的: 擦,我本月已经迟到了 3次了.... 拖拽 刷脸记录 ...

  9. html中table表格标题固定表数据行出现滚动条

    需求 web系统中有的用户不喜欢分页,希望数据能在一个页面中全部显示出来. 但是页面中是有滚动条的,当查看下面的数据时就不知道数据行中的列对应的是哪个标题的列. 也就是无法知道这个列是什么数据. 所以 ...

随机推荐

  1. 【点分治】poj1741 Tree / poj2114 Boatherds / poj1987 Distance Statistics

    三道题都很类似.给出1741的代码 #include<cstdio> #include<algorithm> #include<cstring> using nam ...

  2. Scala学习总结

    1)将Array转化为String,toStrings()方法应该是序列化了的. scala> val args = Array("Hello", "world&q ...

  3. python 实现汉诺塔问题

    代码如下: def hano(n,x,y,z): if n==1: print(x,"->",z) else: #将n-1个盘子从x->y hano(n-1,x,z,y ...

  4. iOS开发技巧——关闭Autoresizing开启Autolayout

    在使用Autolayout时有时候会有莫名其妙的错误,是因为UIView是默认同时开启Autoresizing和Autolayout的. 但我们的Autolayout很容易和Autoresizing冲 ...

  5. iOS 获取自定义cell上按钮所对应cell的indexPath.row的方法

    在UITableView或UICollectionView的自定义cell中创建一button,在点击该按钮时知道该按钮所在的cell在UITableView或UICollectionView中的行数 ...

  6. 国内流行的开源.net微信公众平台SDK对比分析

    一.引言 目前微信公众平台正如火如荼的进行中,微信虽然在海外市场不敌WhatsApp,但是已经俘获了国内绝大部分用户的心.作为国内最大的,超级"app",微信已算是成功问鼎了.公众 ...

  7. C#调用页面中的窗体中的方法,获取窗体的元素。

    页面中的窗体 <div class="div_width" style="width: 100%; height: 95%;"> <ifram ...

  8. css活用,半星星的效果

    1.首先下载要用到星星字体 http://www.w3cplus.com/w3cplusDemo/demos/webFontIcon.html 2.css .cleanfloat::after{dis ...

  9. 基于jquery类库的绘制二维码的插件jquery.qrcode.js

     jquery.qrcode.min.js 如下 (function(r){r.fn.qrcode=function(h){var s;function u(a){this.mode=s;this.d ...

  10. Plplot中line width 问题

    Plplot延续了Pgplot的设计风格,线的宽度函数plwid(int width)只能用整型变量,不能精确控制线宽.用pscairo画出的曲线总是太粗,这是plplot一个很老的问题(issue) ...