typelist.jsp
上传用户:lm2018
上传日期:2015-12-12
资源大小:30449k
文件大小:6k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
  2. <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
  3. <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
  4. <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
  5. <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
  6. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  7. <%String path = request.getContextPath();
  8. String basePath = request.getScheme() + "://"
  9. + request.getServerName() + ":" + request.getServerPort()
  10. + path + "/";
  11. %>
  12. <script>
  13. function dh(id){
  14. var oo=document.getElementsByName(id);
  15. var img = document.getElementById(id+"_img");
  16. for(var i=0;i<oo.length;i++){
  17. if(oo[i].style.display=="none"){
  18. oo[i].style.display="block";
  19. img.src="<%=path%>/Jsp_file/system/open.gif";
  20. }else{
  21. oo[i].style.display="none";
  22. img.src="<%=path%>/Jsp_file/system/close.gif";
  23. }
  24. }
  25. }
  26. function addtype(){ 
  27. //添加参数类别
  28. var div=document.getElementById("t");
  29. div.style.visibility="visible";  
  30. }
  31. function addparam(tid,tname,tmemo){
  32. //添加参数名称
  33. var div=document.getElementById("p");
  34. div.style.visibility="visible"; 
  35. document.getElementById("ty").innerText=tid;
  36.    document.getElementById("typename").innerText=tname;
  37.    document.getElementById("typememo").innerText=tmemo;
  38. }
  39. function savetype(){
  40. //保存添加参数类别
  41. location.href="${pageContext.request.contextPath}/system.do?task=savetype&tname="+document.getElementById("typename").value+"&tmemo="+document.getElementById("typememo").value;
  42. }
  43. function saveparam(){
  44. //保存添加参数名称
  45. location.href="${pageContext.request.contextPath}/system.do?task=saveparam&pname="+document.getElementById("paramname").value+"&pmemo="+document.getElementById("parammemo").value+"&tid="+document.getElementById("ty").value;
  46. }
  47. function edittype(tid,tname,tmemo){
  48. //修改参数类别
  49. var div=document.getElementById("dot");
  50. div.style.visibility="visible";
  51. document.getElementById("ty").innerText=tid;
  52. document.getElementById("tyname").innerText=tname;
  53. document.getElementById("tymemo").innerText=tmemo;
  54. }
  55. function doedittype(){
  56. //保存修改参数类别
  57. location.href="${pageContext.request.contextPath}/system.do?task=edittype&tname="+document.getElementById("tyname").value+"&tmemo="+document.getElementById("tymemo").value+"&tid="+document.getElementById("ty").value;
  58. }
  59. function editparam(tid,pid,pname,pmemo){
  60. //修改参数名称
  61. var div=document.getElementById("dop");
  62. div.style.visibility="visible";
  63. document.getElementById("ty").innerText=tid;
  64. document.getElementById("tp").innerText=pid;
  65. document.getElementById("paname").innerText=pname;
  66. document.getElementById("pamemo").innerText=pmemo;
  67. }
  68. function doeditparam(){
  69. //保存修改参数名称
  70. location.href="${pageContext.request.contextPath}/system.do?task=editparam&pname="+document.getElementById("paname").value+"&pmemo="+document.getElementById("pamemo").value+"&pid="+document.getElementById("tp").value+"&tid="+document.getElementById("ty").value;
  71. }
  72. function deltype(tid){
  73. //删除参数类别
  74. location.href="${pageContext.request.contextPath}/system.do?task=deltype&tid="+tid;
  75. }
  76. function delparam(pid){
  77. //删除参数名称
  78. location.href="${pageContext.request.contextPath}/system.do?task=delparam&pid="+pid;
  79. }
  80. </script>
  81. <body>
  82. <INPUT type="hidden" name="ty">
  83. <input type="hidden" name="tp">
  84. <DIV id="t" style="visibility: hidden;">
  85. 添加参数类别:
  86. <br>
  87. 类别名称:
  88. <INPUT type="text" name="typename" maxlength="15">
  89. 类别备注:
  90. <INPUT type="text" name="typememo" maxlength="20">
  91. <INPUT type="button" value="保存" onclick="savetype()">
  92. </DIV>
  93. ${msg}
  94. <DIV id="p" style="visibility: hidden;">
  95. 添加参数名称:
  96. <br>
  97. 参数名称:
  98. <INPUT type="text" name="paramname" maxlength="15">
  99. 参数备注:
  100. <INPUT type="text" name="parammemo" maxlength="20">
  101. <INPUT type="button" value="保存" onclick="saveparam()">
  102. </DIV>
  103. <DIV id="dot" style="visibility: hidden;">
  104. 修改参数类别:
  105. <br>
  106. 类别名称:
  107. <input type="text" name="tyname" maxlength="15">
  108. 类别备注:
  109. <input type="text" name="tymemo" maxlength="20">
  110. <input type="button" value="修改" onclick="doedittype()">
  111. </DIV>
  112. <DIV id="dop" style="visibility: hidden;">
  113. 修改参数名称:
  114. <br>
  115. 参数名称:
  116. <INPUT type="text" name="paname" maxlength="15">
  117. 参数备注:
  118. <input type="text" name="pamemo" maxlength="20">
  119. <INPUT type="button" value="修改" onclick="doeditparam()">
  120. </DIV>
  121. <table width=100% border="3" cellpadding="2" cellspacing="2" bordercolor="#3399FF" bgcolor="#99CCFF">
  122. <tr>
  123. <TD >
  124. 参数名称
  125. </TD>
  126. <TD >
  127. 备注
  128. </TD>
  129. <TD>
  130. 操作<a href="javascript:addtype()">[添加大类]</a>
  131. </TD>
  132. </tr>
  133. <c:forEach var="typ" items="${typelist}">
  134. <tr>
  135. <td align="center">
  136. <div onclick="dh('${typ.tid}');">
  137. <img src="<%=path%>/Jsp_file/system/open.gif" id="${typ.tid}_img">
  138. ${typ.tname}
  139. </div>
  140. </td>
  141. <TD>
  142. ${typ.tmemo}
  143. </TD>
  144. <td>
  145. <a href="javascript:addparam('${typ.tid}','${typ.tname}','${typ.tmemo}')">添加子类</a>&nbsp; <a href="javascript:edittype('${typ.tid}','${typ.tname}','${typ.tmemo}')">修改</a>&nbsp; <a href="javascript:deltype('${typ.tid}')"
  146. onclick="return window.confirm('您确定删除类别${typ.tname}吗?')">删除</a>
  147. </td>
  148. </tr>
  149. <c:forEach var="par" items="${paramlist}">
  150. <c:if test="${typ.tid==par.tid}">
  151. <tr id="${typ.tid}">
  152. <td>
  153. <div style="margin-left:20px;">
  154. ${par.pname}
  155. </div>
  156. </td>
  157. <TD>
  158. ${par.pmemo}
  159. </TD>
  160. <td>
  161. <a href="javascript:editparam('${typ.tid}','${par.pid}','${par.pname}','${par.pmemo}')">修改</a>&nbsp; <a href="javascript:delparam('${par.pid}')" onclick="return window.confirm('您确定删除参数${par.pname}吗?')">删除</a>
  162. </td>
  163. </tr>
  164. </c:if>
  165. </c:forEach>
  166. </c:forEach>
  167. </table>
  168. </body>