123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- <%@ page contentType="text/html; charset=gb2312" language="java"%>
- <%@ page language="java" import="model.setup.constant.Collection" %>
- <%@ page language="java"
- import="com.sysmodel.datamodel.xmlmodel.ModelFactory,
- com.sysmodel.datamodel.xmlmodel.able.MdpConstant,
- com.sysmodel.datamodel.xmlmodel.able.Property,
- com.sysmodel.datamodel.xmlmodel.able.Template,
- com.sysmodel.datamodel.xmlmodel.DataContent,
- java.util.*"%>
-
- <html>
- <%
- String nodeID = request.getParameter("nodeID")==null?"":(String)request.getParameter("nodeID") ;
- String codeName =request.getParameter("codeName") == null ? "" : request.getParameter("codeName");
- Collection cs = new Collection(nodeID,codeName,request.getContextPath());
- MdpConstant constant = ModelFactory.getSysmodel().getMdpConstantByName(codeName);
- %>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>常量信息维护</title>
- <script>
- function submitAction(codeName,nodeID,cmd){
- form1.action = "listExec.jsp?codeName="+codeName+"&nodeID="+nodeID+"&cmd="+cmd ;
- form1.submit();
- }
- function checkEmpty(aControlName,aTipMsg){
- var aObj = document.forms[0].elements[aControlName];
- if(aObj.value==""){
- alert(aTipMsg + "不能为空!");
- aObj.focus();
- return false;
- }
- return true;
- }
- function isNumeric(aControlName,aTipMsg,aRegexValue){
- var aObj = document.forms[0].elements[aControlName];
- if(aObj.value=="") return true;
- var regex = new RegExp(aRegexValue);
- if(!regex.test(aObj.value)){
- alert(aTipMsg + "不是数值!");
- aObj.focus();
- return false;
- }
- return true;
- }
- function checkRange(aControlName,aTipMsg,maxValue,minValue){
- var aObj = document.forms[0].elements[aControlName];
- if(aObj.value=="") return true;
- var aCompareValue = parseFloat(aObj.value);
- if (maxValue != "" && aCompareValue > maxValue) {
- alert(aTipMsg + "不能大于 " + maxValue + " !");
- aObj.focus();
- return false;
- }
- if (minValue != "" && aCompareValue < minValue) {
- alert(aTipMsg + "不能小于 " + minValue + " !");
- aObj.focus();
- return false;
- }
- return true;
- }
- function checkMaxLength(aControlName,aTipMsg,maxLength){
- var aObj = document.forms[0].elements[aControlName];
- if(aObj.value.length>maxLength){
- alert(aTipMsg + "数据长度不能大于 " + maxLength + " 位!");
- return false;
- }
- return true;
- }
- function validateAllCode(aControlName,aTipMsg,dataType,theMaxLength,theScaleSize){
- var aObj = document.forms[0].elements[aControlName];
- if(dataType == "number"){
- if(isNumeric(aControlName,aTipMsg,"^(-|\\+)?\\d+(\\.\\d+)?$")) {
- return true;
- } else {
- document.forms[0].elements[aControlName].focus;
- return false ;
- }
- }else if(dataType =="string"){
-
- if(checkMaxLength(aControlName,aTipMsg,theMaxLength)) {
- return true;
- } else{
- document.forms[0].elements[aControlName].focus;
- return false;
- }
- }
- return true;
- }
- function checkinput(){
- return true;
- }
- </script>
- <link rel="stylesheet" href="../../../styles/css.css" type="text/css">
- </head>
- <body>
- <form name="form1" method="post" action="">
- <div id="total">
- <div class="whiteborder">
- <div class="titback">
- <div class="floatleft"><img src="../../../images/index/arrow1.gif" width="20" height="24" /></div>
- <div class="dropshadow"> <%=constant.getDescription()%>维护</div>
- <div class="clear"></div>
- </div>
- <div class="report">
- <%=cs.createDetailHTML()%>
- </div>
- <div class="btmbox">
- <%if(!nodeID.equals("")){%>
- <input type="button" class="button" value="修改" onClick="if(checkinput())submitAction('<%=codeName%>','<%=nodeID%>','modify')" >
- <%}%>
- <%if(nodeID.equals("")){%>
- <input type="button" class="button" value="保存" onClick="if(checkinput())submitAction('<%=codeName%>','<%=nodeID%>','add')">
- <%}%>
- <input type="button" class="button" value="重置" onClick="document.form1.reset();">
- </div>
- <div class="report">
- <table align="center" width="100%" class="DefTableStyles" id="SortTable">
- <thead>
- <tr align="center" valign="middle" class="TableBgColorBlack" height="26">
- <% List array_elements = constant.getListDataContent();
- DataContent dataContent = null;
- Template template = constant.getTemplate();
- List listProperty = template.getListproperty();
- for (int i = 0; i < listProperty.size(); i++) {
- Property property = (Property)listProperty.get(i);
- %>
- <td nowrap><%=property.getDescription() %></td>
- <%
- }
- %>
- <td>删除</td>
- </tr>
- </thead>
-
-
-
-
-
- <tbody>
- <%
- String lineUrl = "";
- for (int i = 0; i < array_elements.size(); i++) {
-
- String className = "";
- if(i%2 == 0) className = "TableBgColorAsh"; else className = "TableBgColorBsh";
- %>
- <tr align="center" valign="middle" class="<%=className %>">
- <%
- dataContent = (DataContent)array_elements.get(i);
- String tempNodeId = (String)dataContent.getValue("fd_code");
- lineUrl = "list.jsp?nodeID="+tempNodeId+"&codeName="+codeName;
- for (int j = 0; j < listProperty.size(); j++) {
- Property property = (Property)listProperty.get(j);
- String showName = dataContent.getValue(property.getName()) == null ? "" : (String)dataContent.getValue(property.getName());
- %><td nowrap <%if(j == 0) out.print(" align='right'"); %>><a class="blueback" href="<%=lineUrl%>"><%=showName%></a></td><%
- }
- %>
- <td align="center"><img src="../../../images/button/table_del.gif" onClick="submitAction('<%=codeName%>','<%=tempNodeId%>','delete');"></img></td>
- </tr>
- <%
- }
- %>
- </tbody>
- </table>
- </div>
-
-
-
- </div>
- </div>
- </form>
- </body>
- </html>
|