simlpeModuleSettingForm.jsp 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <%@ page contentType="text/html;charset=UTF-8"%>
  2. <%@ include file="/jsp/include/taglib.jsp"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <!-- Meta, title, CSS, favicons, etc. -->
  8. <meta charset="utf-8">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  10. <meta name="viewport" content="width=device-width, initial-scale=1">
  11. <title>Gentelella Alela! | </title>
  12. <!-- Bootstrap -->
  13. <link href="${imgStatic }/vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
  14. <!-- Font Awesome -->
  15. <link href="${imgStatic }/vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
  16. <!-- iCheck -->
  17. <link href="${imgStatic }/vendors/iCheck/skins/flat/green.css" rel="stylesheet">
  18. <!-- Custom Theme Style -->
  19. <link href="${imgStatic }/build/css/custom.css" rel="stylesheet">
  20. <!-- 重要!样式重写! -->
  21. <link href="${imgStatic }/zwy/css/custom-override.css" rel="stylesheet">
  22. </head>
  23. <body>
  24. <div class="wd-content">
  25. <div class="wd-piece-content col-md-12 col-sm-12 col-xs-12">
  26. <div class="x_panel">
  27. <div class="x_content">
  28. <br />
  29. <form id="form-add-module" data-parsley-validate class="form-horizontal form-label-left">
  30. <div class="form-group">
  31. <table id="datatable" class="wd-table table table-striped table-bordered">
  32. <thead>
  33. <tr>
  34. <th style="width:20%;"> 业务元件 </th>
  35. <th> 描述 </th>
  36. <th style="width:12%;"></th>
  37. </tr>
  38. </thead>
  39. <tbody>
  40. <c:forEach items="${elementList}" var="businessElement">
  41. <tr>
  42. <td>${businessElement.name }</td>
  43. <td>${businessElement.remarks }</td>
  44. <td>
  45. <input type="checkbox" class="flat" ${not empty businessElement.moduleSettingId ? 'checked': ''} data-checked="${not empty businessElement.moduleSettingId ? '1': '2'}" data-elementid="${businessElement.id }" elementname="${businessElement.id }">
  46. </td>
  47. </tr>
  48. </c:forEach>
  49. </tbody>
  50. </table>
  51. </div>
  52. </form>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="form-group">
  57. <div class="col-xs-12 wd-center">
  58. <button class="bt wd-btn-normal wd-btn-width-middle wd-btn-white" type="button" id="cancle-add-module">取消</button>
  59. <button class="btn wd-btn-normal wd-btn-width-middle wd-btn-viridity" type="submit" id="submit-add-module">确认</button>
  60. </div>
  61. </div>
  62. </div>
  63. <!-- jQuery -->
  64. <script src="${imgStatic}/vendors/jquery/dist/jquery.min.js"></script>
  65. <!-- Bootstrap -->
  66. <script src="${imgStatic}/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
  67. <!-- iCheck -->
  68. <script src="${imgStatic}/vendors/iCheck/icheck.min.js"></script>
  69. <script src="${imgStatic }/vendors/layer/layer.js"></script>
  70. <script src="${imgStatic }/zwy/js/layer-customer.js"></script>
  71. <script src="${imgStatic }/zwy/js/layer-customer.js"></script>
  72. <script type="text/javascript">
  73. $(document).ready(function () {
  74. if ($("input.flat")[0]) {
  75. $('input.flat').iCheck({
  76. checkboxClass: 'icheckbox_flat-green',
  77. radioClass: 'iradio_flat-green'
  78. });
  79. }
  80. $("#cancle-add-module").click(function (event) {
  81. CloseIFrame();
  82. });
  83. $("#submit-add-module").click(function (event) {
  84. event.preventDefault();
  85. var delBussinessElementIds = '';
  86. var newBussinessElementIds = '';
  87. $("input.flat").each(function(dom, index){
  88. var checked = $(this).is(':checked');
  89. if ($(this).data("checked") == 1) {
  90. if (!checked) {
  91. delBussinessElementIds += $(this).data("elementid") + ",";
  92. }
  93. } else if($(this).data("checked") == 2) {
  94. if (checked) {
  95. newBussinessElementIds += $(this).data("elementid") + ",";
  96. }
  97. }
  98. })
  99. var moduleSetting = { "simpleModuleId": "${wdDefaultSimpleModule.id}", "newBussinessElementIds": newBussinessElementIds, "delBussinessElementIds" : delBussinessElementIds};
  100. $.ajax({
  101. url : "${ctx }/wd/simlpeModule/saveItem",
  102. data : moduleSetting,
  103. type: "post",
  104. success : function (data) {
  105. if (data.code == 200) {
  106. //ajax提交数据,在ajax的成功方法中添加下面语句
  107. CloseIFrame();
  108. }
  109. }
  110. });
  111. });
  112. });
  113. </script>
  114. </body>
  115. </html>