sysLogSwitchManagement.jsp 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/commons/include/html_doctype.html" %>
  3. <html>
  4. <head>
  5. <%@include file="/commons/include/get.jsp" %>
  6. <title>系统日志开关管理列表</title>
  7. <style type="text/css">
  8. .inputChange{
  9. background-color: #BBAAAA!important;
  10. }
  11. #logSwitchManagement td,#logSwitchManagement th{
  12. cursor: pointer;
  13. border-bottom: 1px solid #CCCCCC;
  14. border-left: 1px solid #CCCCCC;
  15. overflow: hidden;
  16. padding: 7px;
  17. }
  18. [name=logSwitchTr]:hover{
  19. background: #D4D4D4;
  20. }
  21. .edit-label{
  22. margin: 5px;
  23. padding: 5px;
  24. }
  25. </style>
  26. <script type="text/javascript">
  27. $(function(){
  28. $("[name=logSwitchTr]").click(function(){
  29. var _this = $(this);
  30. var isSelf = _this.next().hasClass("logSwitchEditTr");
  31. saveData();
  32. if(!isSelf){
  33. var tr = $("#logSwitchEditTr").clone().removeAttr("id");
  34. var value = $("[name=status]",_this).val();
  35. var memo = $("[name=memo]",_this).text();
  36. $("[name=status]:[value="+value+"]",tr).attr("checked","checked");
  37. $("[name=memo]",tr).val(memo);
  38. tr.insertAfter(_this);
  39. }
  40. });
  41. });
  42. function saveData(){
  43. $("#logSwitchManagement tr.logSwitchEditTr").each(function(){
  44. var _this = $(this);
  45. var prev=_this.prev();
  46. var memo = $("[name=memo]",_this).val();
  47. var status = $("[name=status]:checked",_this).val();
  48. var memoSpan = $("[name=memo]",prev);
  49. var statusSpan = $("[name=statusSpan]",prev);
  50. var statusInput = $("[name=status]",prev);
  51. memoSpan.text(memo);
  52. statusInput.val(status);
  53. if(status=="1"){
  54. statusSpan.text('开启');
  55. }else{
  56. statusSpan.text('关闭');
  57. }
  58. var id = $("[name=id]",prev).val();
  59. var model = $("[name=model]",prev).val();
  60. var url = __ctx+"/platform/system/sysLogSwitch/save.ht";
  61. var json = {
  62. id:id,
  63. model:model,
  64. status:status,
  65. memo:memo
  66. };
  67. var param = {
  68. json:JSON2.stringify(json)
  69. };
  70. $.post(url,param,function(){
  71. });
  72. _this.remove();
  73. });
  74. };
  75. </script>
  76. </head>
  77. <body>
  78. <div class="panel">
  79. <div class="hide-panel">
  80. <div class="panel-top">
  81. <div class="tbar-title">
  82. <span class="tbar-label">系统日志开关管理列表</span>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="panel-body">
  87. <table id="logSwitchManagement" class="table-grid" >
  88. <thead>
  89. <tr>
  90. <th>模块名</th>
  91. <th>备注</th>
  92. <th>状态</th>
  93. </tr>
  94. </thead>
  95. <tbody>
  96. <c:forEach items="${sysLogSwitchList}" var="item" varStatus="status">
  97. <tr name="logSwitchTr" >
  98. <td >
  99. <span>${item.model}</span>
  100. <input type="hidden" name="id" value="${item.id}"/>
  101. <input type="hidden" name="model" value="${item.model}"/>
  102. </td>
  103. <td>
  104. <span name="memo">${item.memo}</span>
  105. </td>
  106. <td>
  107. <%--
  108. <input type="hidden" name="status" value="${item.status}" ivalue="${item.status}">
  109. <label><input type="radio" class="logSwitch_status" value="0" name="status_${status.index}" <c:if test="${item.status ne 1}">checked="checked" </c:if> />关闭</label>
  110. <label><input type="radio" class="logSwitch_status" value="1" name="status_${status.index}" <c:if test="${item.status eq 1}">checked="checked" </c:if> />开启</label>
  111. --%>
  112. <span>
  113. <input type="hidden" name="status" value="${item.status}">
  114. <span name="statusSpan">
  115. <c:choose>
  116. <c:when test="${item.status eq 1 }"> 开启</c:when>
  117. <c:otherwise>关闭</c:otherwise>
  118. </c:choose>
  119. </span>
  120. </span>
  121. </td>
  122. </tr>
  123. </c:forEach>
  124. </tbody>
  125. </table>
  126. </div><!-- end of panel-body -->
  127. </div> <!-- end of panel -->
  128. <div style="display: none;">
  129. <div id="logSwitchEditDiv">
  130. <table id="logSwitchEditTable">
  131. <tr id="logSwitchEditTr" class="logSwitchEditTr">
  132. <td colspan="4">
  133. <div style="height:60px;width:100%;background:#EEE;padding:0 0 18px 0;">
  134. <div style="padding: 5px">
  135. <span class="edit-label">状态:</span>
  136. <span>
  137. <label><input type="radio" class="logSwitch_status" value="1" name="status" />开启</label>
  138. <label><input type="radio" class="logSwitch_status" value="0" name="status" />关闭</label>
  139. </span>
  140. </div>
  141. <div style="padding: 5px">
  142. <span class="edit-label">备注:</span>
  143. <span>
  144. <input name="memo" class="inputText" style="width: 300px"/>
  145. </span>
  146. </div>
  147. </div>
  148. </td>
  149. </tr>
  150. </table>
  151. </div>
  152. </div>
  153. </body>
  154. </html>