123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- <%@ page contentType="text/html; charset=UTF-8" 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.math.BigDecimal,
- 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=UTF-8">
- <title>常量信息维护</title>
- <link rel="stylesheet" href="../../../styles/css.css" type="text/css">
- <link rel="stylesheet" type="text/css" href="../../../../scripts/easyui/themes/default/easyui.css">
- <link rel="stylesheet" type="text/css" href="../../../../scripts/easyui/themes/icon.css">
- <link rel="stylesheet" type="text/css" href="../../../../scripts/easyui/themes/color.css">
- <link rel="stylesheet" type="text/css" href="../../../../scripts/easyui/demo/demo.css">
- <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script>
- <script type="text/javascript" src="../../../../scripts/easyui/jquery.easyui.min.js"></script>
- <script type="text/javascript" src="../../../../scripts/easyui/locale/easyui-lang-zh_CN.js"></script>
- <script>
- function submitAction(codeName,nodeID,cmd){
- if(cmd == "delete"){
- if(confirm("确定要删除吗?")){
- } else{
- return;
- }
- }
- 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;
- }
- function saveConButton(codeName,nodeID,cmd){
- $('#consMap_save').form('submit',{
- url: 'listExec.jsp?codeName='+codeName+'&nodeID='+nodeID+'&cmd='+cmd,
- onSubmit: function(){
- return $(this).form('validate');
- },
- success: function(result){
- var result = eval('('+result+')');
- if (!result.success){
- $.messager.show({
- title: 'Error',
- msg: result.success
- });
- } else {
- $('#consMapList').datagrid('reload'); // reload the user data
- }
- }
- });
- }
- function destroyMapButton(codeName,nodeID,cmd){
-
- $.messager.confirm('常量删除','确定要删除常量吗?',
- function(r){
- if (r){
- $.post('listExec.jsp',{codeName:codeName,nodeID:nodeID,cmd:cmd},function(result){
- if (result.success){
- $('#consMapList').datagrid('reload'); // reload the user data
- } else {
- $.messager.show({ // show error message
- title: 'Error',
- msg: result.errorMsg
- });
- }
- },'json');
- }
- });
-
- };
- </script>
- </head>
- <body>
- <div class="easyui-panel" title="<%=constant.getDescription()%>维护">
- <form name="form1" method="post" action="" id ="consMap_save">
- <div style="padding:0px 0px 0px 0px">
- <%=cs.createDetailHTML()%>
- <div style="text-align:center;padding:5px">
- <%if(!nodeID.equals("")){%>
- <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveConButton('<%=codeName%>','<%=nodeID%>','modify')">修改</a>
- <%}%>
- <%if(nodeID.equals("")){%>
- <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveConButton('<%=codeName%>','<%=nodeID%>','add')">保存</a>
- <%}%>
- <!-- <input type="button" class="button" value="重置" onClick="document.form1.reset();"> -->
- </div>
- </div>
- <div class="report">
- <%
- List array_elements = constant.getListDataContent();
- DataContent dataContent = null;
- Template template = constant.getTemplate();
- List listProperty = template.getListproperty();
- int icols = listProperty.size();
- %>
- <div id="grid-example" style="height:500px;">
- <table id="consMapList" title="常量列表" class="easyui-datagrid"
- data-options="singleSelect:false,url:'json_data.jsp?nodeID=<%=nodeID %>&codeName=<%=codeName %>'"
- pagination="true"
- rownumbers="true"
- fit = "true"
- fitColumns="true">
- <thead>
- <tr>
- <%
-
- for (int j = 0; j < icols; j++) {
- Property property = (Property)listProperty.get(j);
- %>
- <th field="<%=property.getName() %>" width="50"><%=property.getDescription() %></th>
- <%} %>
- <th field="edit" width="50">修改</th>
- <th field="delete" width="50">删除</th>
-
- </tr>
- </thead>
- </table>
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
- </body>
- </html>
|