typelist.jsp
资源名称:(J2EE)oa.rar [点击查看]
上传用户:lm2018
上传日期:2015-12-12
资源大小:30449k
文件大小:6k
源码类别:
Jsp/Servlet
开发平台:
Java
- <%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
- <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
- <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
- <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
- <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
- <%String path = request.getContextPath();
- String basePath = request.getScheme() + "://"
- + request.getServerName() + ":" + request.getServerPort()
- + path + "/";
- %>
- <script>
- function dh(id){
- var oo=document.getElementsByName(id);
- var img = document.getElementById(id+"_img");
- for(var i=0;i<oo.length;i++){
- if(oo[i].style.display=="none"){
- oo[i].style.display="block";
- img.src="<%=path%>/Jsp_file/system/open.gif";
- }else{
- oo[i].style.display="none";
- img.src="<%=path%>/Jsp_file/system/close.gif";
- }
- }
- }
- function addtype(){
- //添加参数类别
- var div=document.getElementById("t");
- div.style.visibility="visible";
- }
- function addparam(tid,tname,tmemo){
- //添加参数名称
- var div=document.getElementById("p");
- div.style.visibility="visible";
- document.getElementById("ty").innerText=tid;
- document.getElementById("typename").innerText=tname;
- document.getElementById("typememo").innerText=tmemo;
- }
- function savetype(){
- //保存添加参数类别
- location.href="${pageContext.request.contextPath}/system.do?task=savetype&tname="+document.getElementById("typename").value+"&tmemo="+document.getElementById("typememo").value;
- }
- function saveparam(){
- //保存添加参数名称
- location.href="${pageContext.request.contextPath}/system.do?task=saveparam&pname="+document.getElementById("paramname").value+"&pmemo="+document.getElementById("parammemo").value+"&tid="+document.getElementById("ty").value;
- }
- function edittype(tid,tname,tmemo){
- //修改参数类别
- var div=document.getElementById("dot");
- div.style.visibility="visible";
- document.getElementById("ty").innerText=tid;
- document.getElementById("tyname").innerText=tname;
- document.getElementById("tymemo").innerText=tmemo;
- }
- function doedittype(){
- //保存修改参数类别
- location.href="${pageContext.request.contextPath}/system.do?task=edittype&tname="+document.getElementById("tyname").value+"&tmemo="+document.getElementById("tymemo").value+"&tid="+document.getElementById("ty").value;
- }
- function editparam(tid,pid,pname,pmemo){
- //修改参数名称
- var div=document.getElementById("dop");
- div.style.visibility="visible";
- document.getElementById("ty").innerText=tid;
- document.getElementById("tp").innerText=pid;
- document.getElementById("paname").innerText=pname;
- document.getElementById("pamemo").innerText=pmemo;
- }
- function doeditparam(){
- //保存修改参数名称
- 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;
- }
- function deltype(tid){
- //删除参数类别
- location.href="${pageContext.request.contextPath}/system.do?task=deltype&tid="+tid;
- }
- function delparam(pid){
- //删除参数名称
- location.href="${pageContext.request.contextPath}/system.do?task=delparam&pid="+pid;
- }
- </script>
- <body>
- <INPUT type="hidden" name="ty">
- <input type="hidden" name="tp">
- <DIV id="t" style="visibility: hidden;">
- 添加参数类别:
- <br>
- 类别名称:
- <INPUT type="text" name="typename" maxlength="15">
- 类别备注:
- <INPUT type="text" name="typememo" maxlength="20">
- <INPUT type="button" value="保存" onclick="savetype()">
- </DIV>
- ${msg}
- <DIV id="p" style="visibility: hidden;">
- 添加参数名称:
- <br>
- 参数名称:
- <INPUT type="text" name="paramname" maxlength="15">
- 参数备注:
- <INPUT type="text" name="parammemo" maxlength="20">
- <INPUT type="button" value="保存" onclick="saveparam()">
- </DIV>
- <DIV id="dot" style="visibility: hidden;">
- 修改参数类别:
- <br>
- 类别名称:
- <input type="text" name="tyname" maxlength="15">
- 类别备注:
- <input type="text" name="tymemo" maxlength="20">
- <input type="button" value="修改" onclick="doedittype()">
- </DIV>
- <DIV id="dop" style="visibility: hidden;">
- 修改参数名称:
- <br>
- 参数名称:
- <INPUT type="text" name="paname" maxlength="15">
- 参数备注:
- <input type="text" name="pamemo" maxlength="20">
- <INPUT type="button" value="修改" onclick="doeditparam()">
- </DIV>
- <table width=100% border="3" cellpadding="2" cellspacing="2" bordercolor="#3399FF" bgcolor="#99CCFF">
- <tr>
- <TD >
- 参数名称
- </TD>
- <TD >
- 备注
- </TD>
- <TD>
- 操作<a href="javascript:addtype()">[添加大类]</a>
- </TD>
- </tr>
- <c:forEach var="typ" items="${typelist}">
- <tr>
- <td align="center">
- <div onclick="dh('${typ.tid}');">
- <img src="<%=path%>/Jsp_file/system/open.gif" id="${typ.tid}_img">
- ${typ.tname}
- </div>
- </td>
- <TD>
- ${typ.tmemo}
- </TD>
- <td>
- <a href="javascript:addparam('${typ.tid}','${typ.tname}','${typ.tmemo}')">添加子类</a> <a href="javascript:edittype('${typ.tid}','${typ.tname}','${typ.tmemo}')">修改</a> <a href="javascript:deltype('${typ.tid}')"
- onclick="return window.confirm('您确定删除类别${typ.tname}吗?')">删除</a>
- </td>
- </tr>
- <c:forEach var="par" items="${paramlist}">
- <c:if test="${typ.tid==par.tid}">
- <tr id="${typ.tid}">
- <td>
- <div style="margin-left:20px;">
- ${par.pname}
- </div>
- </td>
- <TD>
- ${par.pmemo}
- </TD>
- <td>
- <a href="javascript:editparam('${typ.tid}','${par.pid}','${par.pname}','${par.pmemo}')">修改</a> <a href="javascript:delparam('${par.pid}')" onclick="return window.confirm('您确定删除参数${par.pname}吗?')">删除</a>
- </td>
- </tr>
- </c:if>
- </c:forEach>
- </c:forEach>
- </table>
- </body>