list.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>原动力 - 内容管理系统</title>
  7. <link href="/resource/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
  8. <link href="/resource/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
  9. <link href="/resource/css/ionicons.min.css" rel="stylesheet" type="text/css" />
  10. <link href="/resource/css/iCheck/all.css" rel="stylesheet" type="text/css" />
  11. <link href="/resource/css/style.css" rel="stylesheet" type="text/css" />
  12. </head>
  13. <body>
  14. <div class="row">
  15. <div class="col-md-12">
  16. <h1 class="panel-heading">表单管理</h1>
  17. <!--breadcrumbs start -->
  18. <ul class="breadcrumb">
  19. <li><a href="/admin/dashboard/toIndex"><i class="fa fa-home"></i> 首页</a></li>
  20. <li class="active">表单管理</li>
  21. </ul>
  22. <!--breadcrumbs end -->
  23. </div>
  24. </div>
  25. <section class="panel">
  26. <div class="panel-body" shiro:hasAnyPermissions="system:form:toadd,system:form:add">
  27. <button class="btn btn-primary btn-addon btn-sm" th:onclick="javascript: toAdd()">
  28. <i class="fa fa-plus"></i> 添加表单
  29. </button>
  30. </div>
  31. <div class="panel-body table-responsive">
  32. <table class="table table-hover">
  33. <thead>
  34. <tr>
  35. <th style="width:50px;">选择</th>
  36. <th>表单编码</th>
  37. <th>表单名称</th>
  38. <th>附加表</th>
  39. <th>类型</th>
  40. <th>发布时间</th>
  41. <th style="width:300px;">操作</th>
  42. </tr>
  43. </thead>
  44. <tbody>
  45. <tr th:each="form : ${page.list}">
  46. <td><input type="checkbox" class="flat-grey list-child" th:value="${form.id}"/></td>
  47. <td th:text="${form.code}"></td>
  48. <td th:text="${form.formName}"></td>
  49. <td th:text="${'system_' + form.tableName}"></td>
  50. <td><span th:text="${form.type} == '1' ? '自定义表单' : '系统表单'" th:class="${form.type}=='1'? 'label label-success' : 'label label-danger'"></span></td>
  51. <td th:text="${#dates.format(form.createTime, 'yyyy-MM-dd')}"></td>
  52. <td class="operate">
  53. <a th:href="@{/admin/forms/toEdit(id=${form.id})}" class="btn btn-xs btn-success" shiro:hasAnyPermissions="system:form:toedit,system:form:update">编辑</a>
  54. <a href="javascript:void(0)" data-toggle="modal" class="btn btn-xs btn-danger" th:formid="${form.id}" th:onclick="javascript: confrimRemove(this.getAttribute('formid'))" th:if="${form.type}=='1'" shiro:hasAnyPermissions="system:form:delete">删除</a>
  55. </td>
  56. </tr>
  57. <tr th:if="${#lists.isEmpty(page.list)}">
  58. <td colspan="7" align="center">无数据</td>
  59. </tr>
  60. </tbody>
  61. </table>
  62. </div>
  63. <div class="panel-footer bg-white text-right">
  64. <ul class="pagination">
  65. <li><a th:href="@{/admin/forms/list(pageNum=1,pageSize=${page.pageSize})}" title="首页" th:class="${page.isFirstPage} ? 'paginationNotAllowed' : ''">«</a></li>
  66. <li><a th:href="@{/admin/forms/list(pageNum=${page.prePage},pageSize=${page.pageSize})}" title="上一页" th:if="${page.hasPreviousPage}">‹</a></li>
  67. <li th:each="pageinfo : ${page.navigatepageNums}"><a th:href="@{/admin/forms/list(pageNum=${pageinfo},pageSize=${page.pageSize})}" th:class="${pageinfo == page.pageNum} ? 'paginationActive' : ''" th:text="${pageinfo}"></a></li>
  68. <li><a th:href="@{/admin/forms/list(pageNum=${page.nextPage},pageSize=${page.pageSize})}" title="下一页" th:if="${page.hasNextPage}">›</a></li>
  69. <li><a th:href="@{/admin/forms/list(pageNum=${page.pages},pageSize=${page.pageSize})}" title="未页" th:class="${page.isLastPage} ? 'paginationNotAllowed' : ''">»</a></li>
  70. </ul>
  71. </div>
  72. </section>
  73. <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="remove-dialog" class="modal fade">
  74. <div class="modal-dialog">
  75. <div class="modal-content">
  76. <div class="modal-header">
  77. <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
  78. <h4 class="modal-title">操作提示?</h4>
  79. </div>
  80. <div class="modal-body">
  81. <div class="alert alert-block alert-danger">
  82. <strong>注意!</strong> 表单删除后,如有调用则会报错且删除后不可恢复.
  83. </div>
  84. <h4 class="modal-title">您确定要删除该记录吗?</h4>
  85. <input type="hidden" id="cacheID" />
  86. </div>
  87. <div class="modal-footer">
  88. <button type="button" class="btn btn-primary btn-addon btn-sm" onclick="remove();">确定</button>
  89. <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">取消</button>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. <script src="/resource/js/jquery.min.js"></script>
  95. <script src="/resource/js/bootstrap.min.js"></script>
  96. <script src="/resource/js/plugins/iCheck/icheck.min.js"></script>
  97. <!-- Director App -->
  98. <script src="/resource/js/Director/app.js"></script>
  99. <script src="/resource/js/jquery.serializejson.js"></script>
  100. <script>
  101. window.onload = function(){
  102. renderCheckBox();
  103. }
  104. function renderCheckBox(){
  105. $('input').on('ifChecked', function(event) {
  106. $(this).parents('li').addClass("task-done");
  107. console.log('ok');
  108. });
  109. $('input').on('ifUnchecked', function(event) {
  110. $(this).parents('li').removeClass("task-done");
  111. console.log('not');
  112. });
  113. $('input[type="checkbox"].flat-grey, input[type="radio"].flat-grey').iCheck({
  114. checkboxClass: 'icheckbox_flat-grey',
  115. radioClass: 'iradio_flat-grey'
  116. });
  117. }
  118. function toAdd(){
  119. window.location.href = "/admin/forms/toAdd";
  120. }
  121. function confrimRemove(id){
  122. $("#remove-dialog").modal();
  123. $("#cacheID").val(id);
  124. }
  125. function remove(){
  126. var currentID = $("#cacheID").val();
  127. window.location.href="/admin/forms/delete?id="+currentID;
  128. $("#remove-dialog").modal('hide');
  129. }
  130. </script>
  131. </body>
  132. </html>