activitiDeployment.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <div id="activitiDeployment" class="plg-tab-container">
  2. <div id="activitiDeployment-grid-1" 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: "id",
  12. name: "id",
  13. type: 'txt',
  14. hidden: true
  15. },
  16. {
  17. id: "name",
  18. name: "部署名称",
  19. type: 'ro',
  20. width: 200
  21. },
  22. {
  23. id: "category",
  24. name: "部署类目",
  25. type: 'ro',
  26. width: 200
  27. },
  28. {
  29. id: "deploymentTime",
  30. name: "部署时间",
  31. type: 'ro',
  32. width: '*'
  33. }
  34. ],
  35. imagePath: "/prologui/assets/PlgGrid",
  36. url: "/api/service-activiti/model/deployment", //数据接口
  37. type: "get", //数据提交方式,默认为get
  38. params: {
  39. pageNum: 1,
  40. pageSize: 10,
  41. deployName: null
  42. }, //查询提交参数,分页参数默认为pageNum,pageSize
  43. multiselect: false, //是否支持多选
  44. page: true, //是否启用分页
  45. toolbar:[
  46. {type:"button", name:"deleteBtn", className: "danger", value:"<i class='layui-icon layui-icon-delete'></i>删除"},{type: "newcolumn"},
  47. {type: "input", name: 'deployName', label: '部署名称:', placeholder: '请输入部署名称', offsetLeft:20},{type: "newcolumn"}
  48. ,{type:"button", name:"searchBtn", value:"查询"},{type: "newcolumn"}
  49. ],
  50. totalCount: "totalCount" //总记录数字段,默认totalCount
  51.   
  52. };
  53. var activitiDeployment = new PlgGrid(opts);
  54. activitiDeployment.renderTo("activitiDeployment-grid-1");
  55. activitiDeployment.loadData();
  56. activitiDeployment.attachToolBarEvent("onButtonClick", function(name){
  57. if(name == "deleteBtn"){
  58. delactivitiDeployment();
  59. }else if(name == "searchBtn"){
  60. search();
  61. }
  62. });
  63. function search(){
  64. var deployName = $("input[name='deployName']").val();
  65. var am = activitiDeployment.getParams();
  66. am.deployName = deployName;
  67. activitiDeployment.reload();
  68. }
  69. function delactivitiDeployment() {
  70. var deploymentId = activitiDeployment.getSelectedRowId();
  71. if(!deploymentId){
  72. layer.msg("请选择一条数据");
  73. return;
  74. }
  75. layer.confirm('确定删除?', {
  76. btn: ['确定', '取消'],
  77. }, function(index, layero) {
  78. //按钮【按钮一】的回调
  79. $.ajax({
  80. type: 'GET',
  81. url: "/api/service-activiti/activiti/deldeploy",
  82. data: {
  83. deploymentId : deploymentId
  84. },
  85. async: false,
  86. success: function(data) {
  87. activitiDeployment.reload();
  88. alert(data.message);
  89. }
  90. });
  91. layer.close(index)
  92. });
  93. };
  94. </script>