listhtmlbak.jsp 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <%@ page contentType="text/html; charset=gb2312" language="java"%>
  2. <%@ page language="java" import="model.setup.constant.Collection" %>
  3. <%@ page language="java"
  4. import="com.sysmodel.datamodel.xmlmodel.ModelFactory,
  5. com.sysmodel.datamodel.xmlmodel.able.MdpConstant,
  6. com.sysmodel.datamodel.xmlmodel.able.Property,
  7. com.sysmodel.datamodel.xmlmodel.able.Template,
  8. com.sysmodel.datamodel.xmlmodel.DataContent,
  9. java.util.*"%>
  10. <html>
  11. <%
  12. String nodeID = request.getParameter("nodeID")==null?"":(String)request.getParameter("nodeID") ;
  13. String codeName =request.getParameter("codeName") == null ? "" : request.getParameter("codeName");
  14. Collection cs = new Collection(nodeID,codeName,request.getContextPath());
  15. MdpConstant constant = ModelFactory.getSysmodel().getMdpConstantByName(codeName);
  16. %>
  17. <head>
  18. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  19. <title>常量信息维护</title>
  20. <script>
  21. function submitAction(codeName,nodeID,cmd){
  22. form1.action = "listExec.jsp?codeName="+codeName+"&nodeID="+nodeID+"&cmd="+cmd ;
  23. form1.submit();
  24. }
  25. function checkEmpty(aControlName,aTipMsg){
  26. var aObj = document.forms[0].elements[aControlName];
  27. if(aObj.value==""){
  28. alert(aTipMsg + "不能为空!");
  29. aObj.focus();
  30. return false;
  31. }
  32. return true;
  33. }
  34. function isNumeric(aControlName,aTipMsg,aRegexValue){
  35. var aObj = document.forms[0].elements[aControlName];
  36. if(aObj.value=="") return true;
  37. var regex = new RegExp(aRegexValue);
  38. if(!regex.test(aObj.value)){
  39. alert(aTipMsg + "不是数值!");
  40. aObj.focus();
  41. return false;
  42. }
  43. return true;
  44. }
  45. function checkRange(aControlName,aTipMsg,maxValue,minValue){
  46. var aObj = document.forms[0].elements[aControlName];
  47. if(aObj.value=="") return true;
  48. var aCompareValue = parseFloat(aObj.value);
  49. if (maxValue != "" && aCompareValue > maxValue) {
  50. alert(aTipMsg + "不能大于 " + maxValue + " !");
  51. aObj.focus();
  52. return false;
  53. }
  54. if (minValue != "" && aCompareValue < minValue) {
  55. alert(aTipMsg + "不能小于 " + minValue + " !");
  56. aObj.focus();
  57. return false;
  58. }
  59. return true;
  60. }
  61. function checkMaxLength(aControlName,aTipMsg,maxLength){
  62. var aObj = document.forms[0].elements[aControlName];
  63. if(aObj.value.length>maxLength){
  64. alert(aTipMsg + "数据长度不能大于 " + maxLength + " 位!");
  65. return false;
  66. }
  67. return true;
  68. }
  69. function validateAllCode(aControlName,aTipMsg,dataType,theMaxLength,theScaleSize){
  70. var aObj = document.forms[0].elements[aControlName];
  71. if(dataType == "number"){
  72. if(isNumeric(aControlName,aTipMsg,"^(-|\\+)?\\d+(\\.\\d+)?$")) {
  73. return true;
  74. } else {
  75. document.forms[0].elements[aControlName].focus;
  76. return false ;
  77. }
  78. }else if(dataType =="string"){
  79. if(checkMaxLength(aControlName,aTipMsg,theMaxLength)) {
  80. return true;
  81. } else{
  82. document.forms[0].elements[aControlName].focus;
  83. return false;
  84. }
  85. }
  86. return true;
  87. }
  88. function checkinput(){
  89. return true;
  90. }
  91. </script>
  92. <link rel="stylesheet" href="../../../styles/css.css" type="text/css">
  93. </head>
  94. <body>
  95. <form name="form1" method="post" action="">
  96. <div id="total">
  97. <div class="whiteborder">
  98. <div class="titback">
  99. <div class="floatleft"><img src="../../../images/index/arrow1.gif" width="20" height="24" /></div>
  100. <div class="dropshadow">&nbsp;&nbsp;<%=constant.getDescription()%>维护</div>
  101. <div class="clear"></div>
  102. </div>
  103. <div class="report">
  104. <%=cs.createDetailHTML()%>
  105. </div>
  106. <div class="btmbox">
  107. <%if(!nodeID.equals("")){%>
  108. <input type="button" class="button" value="修改" onClick="if(checkinput())submitAction('<%=codeName%>','<%=nodeID%>','modify')" >
  109. <%}%>
  110. <%if(nodeID.equals("")){%>
  111. <input type="button" class="button" value="保存" onClick="if(checkinput())submitAction('<%=codeName%>','<%=nodeID%>','add')">
  112. <%}%>
  113. <input type="button" class="button" value="重置" onClick="document.form1.reset();">
  114. </div>
  115. <div class="report">
  116. <table align="center" width="100%" class="DefTableStyles" id="SortTable">
  117. <thead>
  118. <tr align="center" valign="middle" class="TableBgColorBlack" height="26">
  119. <% List array_elements = constant.getListDataContent();
  120. DataContent dataContent = null;
  121. Template template = constant.getTemplate();
  122. List listProperty = template.getListproperty();
  123. for (int i = 0; i < listProperty.size(); i++) {
  124. Property property = (Property)listProperty.get(i);
  125. %>
  126. <td nowrap><%=property.getDescription() %></td>
  127. <%
  128. }
  129. %>
  130. <td>删除</td>
  131. </tr>
  132. </thead>
  133. <tbody>
  134. <%
  135. String lineUrl = "";
  136. for (int i = 0; i < array_elements.size(); i++) {
  137. String className = "";
  138. if(i%2 == 0) className = "TableBgColorAsh"; else className = "TableBgColorBsh";
  139. %>
  140. <tr align="center" valign="middle" class="<%=className %>">
  141. <%
  142. dataContent = (DataContent)array_elements.get(i);
  143. String tempNodeId = (String)dataContent.getValue("fd_code");
  144. lineUrl = "list.jsp?nodeID="+tempNodeId+"&codeName="+codeName;
  145. for (int j = 0; j < listProperty.size(); j++) {
  146. Property property = (Property)listProperty.get(j);
  147. String showName = dataContent.getValue(property.getName()) == null ? "" : (String)dataContent.getValue(property.getName());
  148. %><td nowrap <%if(j == 0) out.print(" align='right'"); %>><a class="blueback" href="<%=lineUrl%>"><%=showName%></a></td><%
  149. }
  150. %>
  151. <td align="center"><img src="../../../images/button/table_del.gif" onClick="submitAction('<%=codeName%>','<%=tempNodeId%>','delete');"></img></td>
  152. </tr>
  153. <%
  154. }
  155. %>
  156. </tbody>
  157. </table>
  158. </div>
  159. </div>
  160. </div>
  161. </form>
  162. </body>
  163. </html>