392bf898ee7f8517d521a46194a9eeee09bab843.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%@ page language="java"
  3. import="java.util.*,
  4. com.sysmodel.collectmodel.xmlmodel.able.FormCollection,
  5. com.sysmodel.datamodel.xmlmodel.ModelFactory,
  6. com.sysmodel.datamodel.xmlmodel.impl.MdpClassImpl,
  7. com.sysmodel.datamodel.xmlmodel.able.SysModel,
  8. com.sysmodel.datamodel.xmlmodel.impl.MdpAttributeImpl,
  9. com.sysmodel.collectmodel.xmlmodel.impl.ReportFieldImpl,
  10. com.sysmodel.XFormModelImpl,
  11. com.sysmodel.xformmodel.impl.RegExpImpl,
  12. com.sysmodel.xformmodel.importcontrol.DateControl,
  13. com.sysmodel.xformmodel.able.Validate,
  14. com.sysmodel.xformmodel.impl.DojoInputTypeImpl,
  15. com.sysmodel.collectmodel.xmlmanager.xmlobjdll.CollectModeldllImpl
  16. "%>
  17. <%
  18. String pageid = request.getParameter("pageid") == null ? "" : request.getParameter("pageid");
  19. String name = request.getParameter("name") == null ? "" : request.getParameter("name");
  20. String action = "add";
  21. SysModel sysmodel = ModelFactory.getSysmodel();
  22. MdpClassImpl MdpClass = null;
  23. FormCollection FormCollection = null;
  24. ArrayList reportFields = null;
  25. String label = "";
  26. String colspan = "";
  27. String size = "";
  28. String need = "";
  29. String trime = "";
  30. String format = "";
  31. String invalidMessage = "";
  32. String promptMessage = "";
  33. String regxValue = "";
  34. int columnCount = 0;
  35. String dojoInuptType = "";
  36. if(session.getAttribute("FormCollect"+pageid) == null ){
  37. return;
  38. } else {
  39. FormCollection = (FormCollection)session.getAttribute("FormCollect"+pageid);
  40. int iclassid = Integer.parseInt(FormCollection.getClassid());
  41. MdpClass = (MdpClassImpl)sysmodel.getMdpClassByClassID(iclassid);
  42. reportFields = FormCollection.getReportFieldByControlType(FormCollection , "date");
  43. columnCount = FormCollection.getPageBody().getColumnCount();
  44. if(!name.equals("")){
  45. action = "edit";
  46. ReportFieldImpl ReportFieldImpl = FormCollection.getReportFieldByName(FormCollection,name);
  47. label = ReportFieldImpl.getLabel();
  48. colspan = ReportFieldImpl.getColspan()+"";
  49. DateControl DateControl = (DateControl)ReportFieldImpl.getControl();
  50. size = DateControl.getSize();
  51. format = DateControl.getFormat();
  52. Validate Validate = ReportFieldImpl.getValidate();
  53. if(Validate!=null){
  54. need = new Boolean(Validate.isNeed()).toString();
  55. dojoInuptType = Validate.getDojoType();
  56. }
  57. trime = new Boolean(Validate.isTrim()).toString();
  58. invalidMessage = Validate.getInvalidMessage();
  59. promptMessage = Validate.getPromptMessage();
  60. regxValue = Validate.getRegxValue();
  61. }
  62. }
  63. %>
  64. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  65. <html>
  66. <head>
  67. <title>定义日期采集构件</title>
  68. <meta http-equiv="pragma" content="no-cache">
  69. <meta http-equiv="cache-control" content="no-cache">
  70. <meta http-equiv="expires" content="0">
  71. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  72. <meta http-equiv="description" content="定义日期采集构件">
  73. <script type="text/javascript" src="../../../scripts/creatselect.js"></script>
  74. <link rel="stylesheet" href="../../../styles/css.css" type="text/css"></link>
  75. <link rel="stylesheet" href="../../../styles/style.css" type="text/css"></link>
  76. <script type="text/javascript" src="../../../scripts/dojo/dojo/dojo.js" djConfig="isDebug: false, parseOnLoad: true"></script>
  77. <script type="text/javascript">
  78. dojo.require("dijit.form.Form");
  79. dojo.require("dijit.form.ValidationTextBox");
  80. dojo.require("dijit.form.ComboBox");
  81. dojo.require("dijit.form.FilteringSelect");
  82. dojo.require("dijit.form.NumberSpinner");
  83. dojo.require("dijit.form.Button");
  84. dojo.require("dijit.Tooltip");
  85. dojo.require("dojo.parser");
  86. </script>
  87. <style type="text/css">
  88. @import "../../../scripts/dojo/dojo/resources/dojo.css";
  89. @import "../../../scripts/dojo/dijit/themes/tundra/tundra.css";
  90. @import "../../../scripts/dojo/dijit/themes/tundra/tundra_rtl.css";
  91. @import "../../../scripts/dojo/dijit/tests/css/dijitTests.css";
  92. .formQuestion {
  93. background-color:#d0e3f5;
  94. padding:0.3em;
  95. font-weight:900;
  96. font-family:Verdana, Arial, sans-serif;
  97. font-size:0.8em;
  98. color:#5a5a5a;
  99. }
  100. .formAnswer {
  101. background-color:#f5eede;
  102. padding:0.3em;
  103. margin-bottom:1em;
  104. width: 100%;
  105. }
  106. .pageSubContentTitle {
  107. color:#8e8e8e;
  108. font-size:1em;
  109. font-family:Verdana, Arial, sans-serif;
  110. margin-bottom:0.75em;
  111. }
  112. .small INPUT {
  113. width: 2.5em;
  114. }
  115. .medium INPUT {
  116. width: 10em;
  117. }
  118. .long INPUT {
  119. width: 20em;
  120. }
  121. .firstLabel {
  122. display: inline-block;
  123. display: -moz-inline-box;
  124. width: 10em;
  125. min-width: 10em;
  126. }
  127. .secondLabel {
  128. width: auto;
  129. margin-left: 5em;
  130. margin-right: 1em;
  131. }
  132. fieldset label {
  133. margin-right: 1em;
  134. }
  135. .noticeMessage {
  136. display: block;
  137. float: right;
  138. font-weight: normal;
  139. font-family:Arial, Verdana, sans-serif;
  140. color:#663;
  141. font-size:0.9em;
  142. }
  143. </style>
  144. </head>
  145. <body class="tundra">
  146. <form name="form1" method="post" action="dateExc.jsp">
  147. <input type="hidden" name="pageid" value="<%=pageid %>">
  148. <input type="hidden" name="action" value="<%=action %>">
  149. <input type="hidden" name="oName" value="<%=name %>">
  150. <div id=total>
  151. <div class="whiteborder">
  152. <div class="titback">
  153. <div class="floatleft"><img src="../../../images/index/arrow1.gif" width="20" height="24"/></div>
  154. <div class="dropshadow">定义日期采集构件</div>
  155. <div class="clear"></div>
  156. </div>
  157. <div class="report">
  158. <table border="0" align="center" width="100%" cellpadding="1" cellspacing="1" class="ltab2">
  159. <tr class="">
  160. <td>字段</td>
  161. <td align="left" >
  162. <select id="name" name="name"
  163. dojoType="dijit.form.FilteringSelect"
  164. required="true"
  165. autocomplete="true">
  166. <option value="0" selected></option>
  167. <%
  168. CollectModeldllImpl CollectModeldllImpl = new CollectModeldllImpl();
  169. ArrayList mdpAttributes = (ArrayList)MdpClass.getAllMdpAttributes();
  170. for (int i=0 ; i< mdpAttributes.size() ; i++){
  171. MdpAttributeImpl MdpAttributeImpl = (MdpAttributeImpl)mdpAttributes.get(i);
  172. if( MdpAttributeImpl.getDataType().equals("date")){
  173. if(name.equals("")){
  174. if(reportFields.size()>0 ){
  175. if(CollectModeldllImpl.isReportFieldExist(MdpAttributeImpl,reportFields)) {
  176. %>
  177. <option value="<%=MdpAttributeImpl.getName() %>"><%=MdpAttributeImpl.getDescription()%></option>
  178. <%
  179. }
  180. }else{%>
  181. <option value="<%=MdpAttributeImpl.getName() %>"><%=MdpAttributeImpl.getDescription()%></option>
  182. <% }
  183. }else{
  184. %>
  185. <option value="<%=MdpAttributeImpl.getName() %>" <%if(MdpAttributeImpl.getName().equals(name) )out.print("selected");%>><%=MdpAttributeImpl.getDescription()%></option>
  186. <%
  187. }
  188. }
  189. }
  190. %>
  191. </select>
  192. </td>
  193. </tr>
  194. <tr class="">
  195. <td>标题</td>
  196. <td align="left">
  197. <input type="text" value="<%=label %>"
  198. id="label" name="label" class="medium"
  199. dojoType="dijit.form.ValidationTextBox"
  200. required="true"
  201. ucfirst="true"
  202. invalidMessage="标题必须填写!">
  203. </td>
  204. </tr>
  205. <tr class="">
  206. <td>合并值</td>
  207. <td align="left" >
  208. <select id="colspan" name="colspan"
  209. dojoType="dijit.form.FilteringSelect"
  210. required="true"
  211. autocomplete="true">
  212. <option value="" ></option>
  213. <% if(columnCount > 0){
  214. for (int i = 2 ; i<= columnCount * 2 ; i++){
  215. %>
  216. <option value="<%=i %>" <%if(colspan.equals(i+""))out.print("selected"); %>><%=i %></option>
  217. <%}} %>
  218. </select>
  219. </td>
  220. </tr>
  221. <tr class="">
  222. <td>size:</td>
  223. <td align="left">
  224. <input dojotype="dijit.form.NumberSpinner"
  225. id="size" name="size"
  226. value="<%=size %>"
  227. required="true"
  228. constraints="{min: 0, max:100, places:0}"
  229. size=10
  230. invalidMessage="size必须录入数字">
  231. </td>
  232. </tr>
  233. <tr class="">
  234. <td>录入提示</td>
  235. <td align="left" >
  236. <input type="text" value="<%=promptMessage %>"
  237. id="promptMessage" name="promptMessage" class="medium"
  238. dojoType="dijit.form.ValidationTextBox"
  239. required="false"
  240. ucfirst="true"
  241. invalidMessage="">
  242. </td>
  243. </tr>
  244. <tr class="">
  245. <td>验证失败提示</td>
  246. <td align="left" >
  247. <input type="text" value="<%=invalidMessage %>"
  248. id="invalidMessage" name="invalidMessage" class="medium"
  249. dojoType="dijit.form.ValidationTextBox"
  250. required="false"
  251. ucfirst="true"
  252. invalidMessage="">
  253. </td>
  254. </tr>
  255. <tr class="">
  256. <td>是否必填</td>
  257. <td align="left" >
  258. <select id="need" name="need"
  259. dojoType="dijit.form.FilteringSelect"
  260. required="true"
  261. autocomplete="true">
  262. <option value="true" <%if(need.equals("true"))out.print("selected"); %>>true</option>
  263. <option value="false"<%if(need.equals("false"))out.print("selected"); %>>false</option>
  264. </select>
  265. </td>
  266. </tr>
  267. <tr class="">
  268. <td>是否去掉空格</td>
  269. <td align="left" >
  270. <select id="trime" name="trime"
  271. dojoType="dijit.form.FilteringSelect"
  272. required="true"
  273. autocomplete="true">
  274. <option value="true" <%if(trime.equals("false"))out.print("selected"); %>>true</option>
  275. <option value="false" <%if(trime.equals("false"))out.print("selected"); %>>false</option>
  276. </select>
  277. </td>
  278. </tr>
  279. <tr class="">
  280. <td>格式</td>
  281. <td align="left">
  282. <select id="format" name="format"
  283. dojoType="dijit.form.FilteringSelect"
  284. required="true"
  285. autocomplete="true">
  286. <option value="0"></option>
  287. <option value="yyyy-MM-dd" <%if(format.equals("yyyy-MM-dd"))out.print("selected"); %>>yyyy-MM-dd</option>
  288. <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>
  289. <option value="yyyy-MM-dd HH:mm" <%if(format.equals("yyyy-MM-dd HH:mm"))out.print("selected"); %>>yyyy-MM-dd HH:mm</option>
  290. <option value="yyyy-MM-dd HH" <%if(format.equals("yyyy-MM-dd HH"))out.print("selected"); %>>yyyy-MM-dd HH</option>
  291. </select>
  292. </td>
  293. </tr>
  294. <tr class="">
  295. <td>正则表达式</td>
  296. <td align="left">
  297. <select id="regxValue" name="regxValue"
  298. dojoType="dijit.form.FilteringSelect"
  299. required="true"
  300. autocomplete="true">
  301. <option value="0"></option>
  302. <% ArrayList regExps=XFormModelImpl.getInstance().getRegExps();
  303. for(int j = 0; j<regExps.size(); j++){
  304. RegExpImpl RegExpImpl=(RegExpImpl)regExps.get(j);
  305. %>
  306. <option value="<%=RegExpImpl.getCode() %>" <%if(RegExpImpl.getCode().equals(regxValue))out.print("selected");%>><%=RegExpImpl.getName() %></option>
  307. <%} %>
  308. </select>
  309. </td>
  310. </tr>
  311. <tr class="">
  312. <td>dojo]控件类型</td>
  313. <td align="left">
  314. <select id="dojoInuptType" name="dojoInuptType"
  315. dojoType="dijit.form.FilteringSelect"
  316. required="true"
  317. autocomplete="true">
  318. <option value="0"></option>
  319. <% ArrayList dojoInuptTypes = XFormModelImpl.getInstance().getDojoInuptTypesByType("date");
  320. for(int j = 0; j<dojoInuptTypes.size(); j++){
  321. DojoInputTypeImpl DojoInputTypeImpl=(DojoInputTypeImpl)dojoInuptTypes.get(j);
  322. %>
  323. <option value="<%=DojoInputTypeImpl.getCode() %>" <%if(DojoInputTypeImpl.getCode().equals(dojoInuptType))out.print("selected");%>><%=DojoInputTypeImpl.getName() %></option>
  324. <%} %>
  325. </select>
  326. </td>
  327. </tr>
  328. </table>
  329. </div>
  330. <div class="btmbox">
  331. <button id="save" dojoType="dijit.form.Button" onClick='console.log("clicked simple")' type="submit" iconClass="plusIcon">
  332. 保存
  333. </button>
  334. <span dojoType="dijit.Tooltip" connectId="save">保存按钮</span>&nbsp;&nbsp;
  335. <button id="reset" dojoType="dijit.form.Button" onClick='document.form1.reset();' type="button" iconClass="plusIcon">
  336. 重置
  337. </button>
  338. <span dojoType="dijit.Tooltip" connectId="save">重置按钮</span>&nbsp;&nbsp;
  339. <button id="close" dojoType="dijit.form.Button" onClick='window.close();' type="button" iconClass="plusIcon">
  340. 关闭
  341. </button>
  342. <span dojoType="dijit.Tooltip" connectId="save">关闭按钮</span>&nbsp;&nbsp;
  343. </div>
  344. </div>
  345. </div>
  346. </form>
  347. <br>
  348. </body>
  349. </html>