text.jsp 14 KB

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