activitiDefine.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <div id="activitiDefineDIV" class="plg-tab-container">
  2. <div id="activitiDefine" class="grid-container-full"></div>
  3. </div>
  4. <script type="text/javascript">
  5. var $ = layui.jquery,
  6. upload = layui.upload;
  7. var opts = {
  8. skin: "terrace",
  9. columns: [
  10. {
  11. id: "processDefineId",
  12. name: "processDefineId",
  13. type: 'txt',
  14. hidden: true
  15. },
  16. {
  17. id: "processDefineName",
  18. name: "流程实例定义名称",
  19. type: 'ro',
  20. width: 150
  21. },
  22. {
  23. id: "processDefineKey",
  24. name: "key值",
  25. type: 'ro',
  26. width: 200
  27. },
  28. {
  29. id: "description",
  30. name: "描述",
  31. type: 'ro',
  32. width: 150
  33. },
  34. {
  35. id: "resourceName",
  36. name: "xml文件名",
  37. type: 'ro',
  38. width: 150
  39. },
  40. {
  41. id: "diagramResourceName",
  42. name: "png文件名",
  43. type: 'ro',
  44. width: '*'
  45. }
  46. // {
  47. // id: "",
  48. // name: "操作",
  49. // type: 'ro',
  50. // width: 160,
  51. // render: function(v, d) {
  52. // return '<a href="javascript:void(0);" style="color: dodgerblue;" onclick="delactivitiDeployment(\'' + d["id"] + '\')">删除</a>';
  53. // }
  54. // }
  55. ],
  56. imagePath: "/prologui/assets/PlgGrid",
  57. url: "/api/service-activiti/activiti/processDefine", //数据接口
  58. type: "get", //数据提交方式,默认为get
  59. params: {
  60. pageNum: 1,
  61. pageSize: 10,
  62. defineName: null
  63. }, //查询提交参数,分页参数默认为pageNum,pageSize
  64. multiselect: false, //是否支持多选
  65. page: true, //是否启用分页
  66. toolbar:[
  67. {type: "input", name: 'defineName', label: '流程定义名称:',placeholder: '请输入流程定义名称'},{type: "newcolumn"}
  68. ,{type:"button", name:"searchBtn", value:"查询", offsetLeft:10},{type: "newcolumn"}
  69. ],
  70. totalCount: "totalCount" //总记录数字段,默认totalCount
  71.   
  72. };
  73. var activitiDefine = new PlgGrid(opts);
  74. activitiDefine.renderTo("activitiDefine");
  75. activitiDefine.loadData();
  76. activitiDefine.attachToolBarEvent("onButtonClick", function(name){
  77. if(name == "searchBtn"){
  78. search();
  79. }
  80. });
  81. function search(){
  82. // var defineName = $("#defineName").val();
  83. // var am = activitiDefine.getParams();
  84. // am.defineName = defineName;
  85. // activitiDefine.loadData();
  86. var defineName = $("input[name='defineName']").val();
  87. var am = activitiDefine.getParams();
  88. am.defineName = defineName;
  89. activitiDefine.reload();
  90. }
  91. function delactivitiDeployment(deploymentId) {
  92. layer.confirm('确定删除?', {
  93. btn: ['确定', '取消'],
  94. }, function(index, layero) {
  95. //按钮【按钮一】的回调
  96. $.ajax({
  97. type: 'GET',
  98. url: "/api/service-activiti/activiti/deldeploy",
  99. data: {
  100. deploymentId : deploymentId
  101. },
  102. async: false,
  103. success: function(data) {
  104. activitiDefine.reload();
  105. alert(data.message);
  106. }
  107. });
  108. layer.close(index)
  109. });
  110. };
  111. </script>