123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362 |
- <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
- <%@ page language="java"
- import="java.util.*,
- com.sysmodel.collectmodel.xmlmodel.able.FormCollection,
- com.sysmodel.datamodel.xmlmodel.ModelFactory,
- com.sysmodel.datamodel.xmlmodel.impl.MdpClassImpl,
- com.sysmodel.datamodel.xmlmodel.able.SysModel,
- com.sysmodel.datamodel.xmlmodel.impl.MdpAttributeImpl,
- com.sysmodel.collectmodel.xmlmodel.impl.ReportFieldImpl,
- com.sysmodel.XFormModelImpl,
- com.sysmodel.xformmodel.impl.RegExpImpl,
- com.sysmodel.xformmodel.importcontrol.DateControl,
- com.sysmodel.xformmodel.able.Validate,
- com.sysmodel.xformmodel.impl.DojoInputTypeImpl,
- com.sysmodel.collectmodel.xmlmanager.xmlobjdll.CollectModeldllImpl
- "%>
- <%
- String pageid = request.getParameter("pageid") == null ? "" : request.getParameter("pageid");
- String name = request.getParameter("name") == null ? "" : request.getParameter("name");
- String action = "add";
-
- SysModel sysmodel = ModelFactory.getSysmodel();
-
- MdpClassImpl MdpClass = null;
- FormCollection FormCollection = null;
- ArrayList reportFields = null;
- String label = "";
- String colspan = "";
- String size = "";
- String need = "";
- String trime = "";
- String format = "";
- String invalidMessage = "";
- String promptMessage = "";
- String regxValue = "";
- int columnCount = 0;
- String dojoInuptType = "";
-
- if(session.getAttribute("FormCollect"+pageid) == null ){
- return;
- } else {
- FormCollection = (FormCollection)session.getAttribute("FormCollect"+pageid);
-
- int iclassid = Integer.parseInt(FormCollection.getClassid());
- MdpClass = (MdpClassImpl)sysmodel.getMdpClassByClassID(iclassid);
-
- reportFields = FormCollection.getReportFieldByControlType(FormCollection , "date");
- columnCount = FormCollection.getPageBody().getColumnCount();
-
- if(!name.equals("")){
- action = "edit";
- ReportFieldImpl ReportFieldImpl = FormCollection.getReportFieldByName(FormCollection,name);
- label = ReportFieldImpl.getLabel();
- colspan = ReportFieldImpl.getColspan()+"";
- DateControl DateControl = (DateControl)ReportFieldImpl.getControl();
- size = DateControl.getSize();
- format = DateControl.getFormat();
-
- Validate Validate = ReportFieldImpl.getValidate();
- if(Validate!=null){
- need = new Boolean(Validate.isNeed()).toString();
- dojoInuptType = Validate.getDojoType();
- }
- trime = new Boolean(Validate.isTrim()).toString();
- invalidMessage = Validate.getInvalidMessage();
- promptMessage = Validate.getPromptMessage();
- regxValue = Validate.getRegxValue();
- }
- }
- %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <title>定义日期采集构件</title>
- <meta http-equiv="pragma" content="no-cache">
- <meta http-equiv="cache-control" content="no-cache">
- <meta http-equiv="expires" content="0">
- <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
- <meta http-equiv="description" content="定义日期采集构件">
- <script type="text/javascript" src="../../../scripts/creatselect.js"></script>
- <link rel="stylesheet" href="../../../styles/css.css" type="text/css"></link>
- <link rel="stylesheet" href="../../../styles/style.css" type="text/css"></link>
- <script type="text/javascript" src="../../../scripts/dojo/dojo/dojo.js" djConfig="isDebug: false, parseOnLoad: true"></script>
- <script type="text/javascript">
- dojo.require("dijit.form.Form");
- dojo.require("dijit.form.ValidationTextBox");
- dojo.require("dijit.form.ComboBox");
- dojo.require("dijit.form.FilteringSelect");
- dojo.require("dijit.form.NumberSpinner");
- dojo.require("dijit.form.Button");
- dojo.require("dijit.Tooltip");
- dojo.require("dojo.parser");
- </script>
- <style type="text/css">
- @import "../../../scripts/dojo/dojo/resources/dojo.css";
- @import "../../../scripts/dojo/dijit/themes/tundra/tundra.css";
- @import "../../../scripts/dojo/dijit/themes/tundra/tundra_rtl.css";
- @import "../../../scripts/dojo/dijit/tests/css/dijitTests.css";
- .formQuestion {
- background-color:#d0e3f5;
- padding:0.3em;
- font-weight:900;
- font-family:Verdana, Arial, sans-serif;
- font-size:0.8em;
- color:#5a5a5a;
- }
- .formAnswer {
- background-color:#f5eede;
- padding:0.3em;
- margin-bottom:1em;
- width: 100%;
- }
- .pageSubContentTitle {
- color:#8e8e8e;
- font-size:1em;
- font-family:Verdana, Arial, sans-serif;
- margin-bottom:0.75em;
- }
- .small INPUT {
- width: 2.5em;
- }
- .medium INPUT {
- width: 10em;
- }
- .long INPUT {
- width: 20em;
- }
- .firstLabel {
- display: inline-block;
- display: -moz-inline-box;
- width: 10em;
- min-width: 10em;
- }
- .secondLabel {
- width: auto;
- margin-left: 5em;
- margin-right: 1em;
- }
- fieldset label {
- margin-right: 1em;
- }
- .noticeMessage {
- display: block;
- float: right;
- font-weight: normal;
- font-family:Arial, Verdana, sans-serif;
- color:#663;
- font-size:0.9em;
- }
- </style>
-
- </head>
- <body class="tundra">
- <form name="form1" method="post" action="dateExc.jsp">
- <input type="hidden" name="pageid" value="<%=pageid %>">
- <input type="hidden" name="action" value="<%=action %>">
- <input type="hidden" name="oName" value="<%=name %>">
- <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">定义日期采集构件</div>
- <div class="clear"></div>
- </div>
- <div class="report">
- <table border="0" align="center" width="100%" cellpadding="1" cellspacing="1" class="ltab2">
- <tr class="">
- <td>字段</td>
- <td align="left" >
- <select id="name" name="name"
- dojoType="dijit.form.FilteringSelect"
- required="true"
- autocomplete="true">
- <option value="0" selected></option>
- <%
-
- CollectModeldllImpl CollectModeldllImpl = new CollectModeldllImpl();
- ArrayList mdpAttributes = (ArrayList)MdpClass.getAllMdpAttributes();
- for (int i=0 ; i< mdpAttributes.size() ; i++){
- MdpAttributeImpl MdpAttributeImpl = (MdpAttributeImpl)mdpAttributes.get(i);
- if( MdpAttributeImpl.getDataType().equals("date")){
- if(name.equals("")){
- if(reportFields.size()>0 ){
- if(CollectModeldllImpl.isReportFieldExist(MdpAttributeImpl,reportFields)) {
- %>
- <option value="<%=MdpAttributeImpl.getName() %>"><%=MdpAttributeImpl.getDescription()%></option>
- <%
- }
- }else{%>
- <option value="<%=MdpAttributeImpl.getName() %>"><%=MdpAttributeImpl.getDescription()%></option>
- <% }
- }else{
- %>
- <option value="<%=MdpAttributeImpl.getName() %>" <%if(MdpAttributeImpl.getName().equals(name) )out.print("selected");%>><%=MdpAttributeImpl.getDescription()%></option>
- <%
- }
-
- }
- }
-
- %>
-
-
- </select>
- </td>
- </tr>
- <tr class="">
- <td>标题</td>
- <td align="left">
- <input type="text" value="<%=label %>"
- id="label" name="label" class="medium"
- dojoType="dijit.form.ValidationTextBox"
- required="true"
- ucfirst="true"
- invalidMessage="标题必须填写!">
- </td>
- </tr>
- <tr class="">
- <td>合并值</td>
- <td align="left" >
- <select id="colspan" name="colspan"
- dojoType="dijit.form.FilteringSelect"
- required="true"
- autocomplete="true">
- <option value="" ></option>
- <% if(columnCount > 0){
- for (int i = 2 ; i<= columnCount * 2 ; i++){
- %>
- <option value="<%=i %>" <%if(colspan.equals(i+""))out.print("selected"); %>><%=i %></option>
- <%}} %>
- </select>
- </td>
- </tr>
- <tr class="">
- <td>size:</td>
- <td align="left">
- <input dojotype="dijit.form.NumberSpinner"
- id="size" name="size"
- value="<%=size %>"
- required="true"
- constraints="{min: 0, max:100, places:0}"
- size=10
- invalidMessage="size必须录入数字">
- </td>
- </tr>
- <tr class="">
- <td>录入提示</td>
- <td align="left" >
- <input type="text" value="<%=promptMessage %>"
- id="promptMessage" name="promptMessage" class="medium"
- dojoType="dijit.form.ValidationTextBox"
- required="false"
- ucfirst="true"
- invalidMessage="">
- </td>
- </tr>
- <tr class="">
- <td>验证失败提示</td>
- <td align="left" >
- <input type="text" value="<%=invalidMessage %>"
- id="invalidMessage" name="invalidMessage" class="medium"
- dojoType="dijit.form.ValidationTextBox"
- required="false"
- ucfirst="true"
- invalidMessage="">
- </td>
- </tr>
- <tr class="">
- <td>是否必填</td>
- <td align="left" >
- <select id="need" name="need"
- dojoType="dijit.form.FilteringSelect"
- required="true"
- autocomplete="true">
- <option value="true" <%if(need.equals("true"))out.print("selected"); %>>true</option>
- <option value="false"<%if(need.equals("false"))out.print("selected"); %>>false</option>
- </select>
- </td>
- </tr>
- <tr class="">
- <td>是否去掉空格</td>
- <td align="left" >
- <select id="trime" name="trime"
- dojoType="dijit.form.FilteringSelect"
- required="true"
- autocomplete="true">
- <option value="true" <%if(trime.equals("false"))out.print("selected"); %>>true</option>
- <option value="false" <%if(trime.equals("false"))out.print("selected"); %>>false</option>
- </select>
- </td>
- </tr>
- <tr class="">
- <td>格式</td>
- <td align="left">
- <select id="format" name="format"
- dojoType="dijit.form.FilteringSelect"
- required="true"
- autocomplete="true">
- <option value="0"></option>
- <option value="yyyy-MM-dd" <%if(format.equals("yyyy-MM-dd"))out.print("selected"); %>>yyyy-MM-dd</option>
- <option value="yyyy-MM-dd HH:mm:ss" <%if(format.equals("yyyy-MM-dd HH:mm:ss"))out.print("selected"); %>>yyyy-MM-dd HH:mm:ss</option>
- <option value="yyyy-MM-dd HH:mm" <%if(format.equals("yyyy-MM-dd HH:mm"))out.print("selected"); %>>yyyy-MM-dd HH:mm</option>
- <option value="yyyy-MM-dd HH" <%if(format.equals("yyyy-MM-dd HH"))out.print("selected"); %>>yyyy-MM-dd HH</option>
- </select>
- </td>
- </tr>
- <tr class="">
- <td>正则表达式</td>
- <td align="left">
- <select id="regxValue" name="regxValue"
- dojoType="dijit.form.FilteringSelect"
- required="true"
- autocomplete="true">
- <option value="0"></option>
- <% ArrayList regExps=XFormModelImpl.getInstance().getRegExps();
- for(int j = 0; j<regExps.size(); j++){
- RegExpImpl RegExpImpl=(RegExpImpl)regExps.get(j);
- %>
- <option value="<%=RegExpImpl.getCode() %>" <%if(RegExpImpl.getCode().equals(regxValue))out.print("selected");%>><%=RegExpImpl.getName() %></option>
- <%} %>
- </select>
- </td>
- </tr>
- <tr class="">
- <td>dojo]控件类型</td>
- <td align="left">
- <select id="dojoInuptType" name="dojoInuptType"
- dojoType="dijit.form.FilteringSelect"
- required="true"
- autocomplete="true">
- <option value="0"></option>
- <% ArrayList dojoInuptTypes = XFormModelImpl.getInstance().getDojoInuptTypesByType("date");
- for(int j = 0; j<dojoInuptTypes.size(); j++){
- DojoInputTypeImpl DojoInputTypeImpl=(DojoInputTypeImpl)dojoInuptTypes.get(j);
- %>
- <option value="<%=DojoInputTypeImpl.getCode() %>" <%if(DojoInputTypeImpl.getCode().equals(dojoInuptType))out.print("selected");%>><%=DojoInputTypeImpl.getName() %></option>
- <%} %>
- </select>
- </td>
- </tr>
- </table>
- </div>
- <div class="btmbox">
- <button id="save" dojoType="dijit.form.Button" onClick='console.log("clicked simple")' type="submit" iconClass="plusIcon">
- 保存
- </button>
- <span dojoType="dijit.Tooltip" connectId="save">保存按钮</span>
- <button id="reset" dojoType="dijit.form.Button" onClick='document.form1.reset();' type="button" iconClass="plusIcon">
- 重置
- </button>
- <span dojoType="dijit.Tooltip" connectId="save">重置按钮</span>
- <button id="close" dojoType="dijit.form.Button" onClick='window.close();' type="button" iconClass="plusIcon">
- 关闭
- </button>
- <span dojoType="dijit.Tooltip" connectId="save">关闭按钮</span>
- </div>
- </div>
- </div>
- </form>
- <br>
- </body>
- </html>
|