select.jsp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%@ page language="java"
  3. import="java.util.*,
  4. com.sysmodel.listmodel.xmlmodel.impl.FormListImpl,
  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.listmodel.xmlmodel.impl.QueryFieldImpl,
  10. com.sysmodel.xformmodel.able.Validate,
  11. com.sysmodel.xformmodel.impl.DojoInputTypeImpl,
  12. com.sysmodel.XFormModelImpl,
  13. com.sysmodel.xformmodel.impl.RegExpImpl"%>
  14. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  15. <html>
  16. <head>
  17. <%String listid = request.getParameter("listid") == null ? "" : request.getParameter("listid");
  18. String dataName = request.getParameter("dataName") == null ? "" : request.getParameter("dataName");
  19. String label =request.getParameter("label") == null ? "" : request.getParameter("label");
  20. String classid = request.getParameter("classid") == null ? "0" : request.getParameter("classid");
  21. String dojoInuptType = "";
  22. String operator = "";
  23. String action = "add";
  24. String regxValue = "";
  25. FormListImpl FormList = null;
  26. ArrayList QueryFields=null;
  27. ArrayList tableList = null;
  28. if(session.getAttribute("FormList"+listid) == null){
  29. return;
  30. } else {
  31. FormList = (FormListImpl)session.getAttribute("FormList"+listid);
  32. tableList = FormList.getQueryTables();
  33. QueryFields = FormList.getQueryFields();
  34. for (int i = 0 ; i < QueryFields.size() ; i++){
  35. QueryFieldImpl QueryFieldImpl = (QueryFieldImpl)QueryFields.get(i);
  36. if(QueryFieldImpl.getDataName().equals(dataName) && QueryFieldImpl.getLabel().equals(label)){
  37. operator = QueryFieldImpl.getOperator();
  38. Validate Validate = QueryFieldImpl.getValidate();
  39. dojoInuptType =Validate.getDojoType();
  40. regxValue = Validate.getRegxValue();
  41. }
  42. }
  43. }
  44. if(!dataName.equals("") && !classid.equals("0")){
  45. action = "edit";
  46. }
  47. %>
  48. <title>定义选择查询构件</title>
  49. <meta http-equiv="pragma" content="no-cache">
  50. <meta http-equiv="cache-control" content="no-cache">
  51. <meta http-equiv="expires" content="0">
  52. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  53. <meta http-equiv="description" content="定义选择查询构件">
  54. <script type="text/javascript" src="../../../scripts/creatselect.js"></script>
  55. <link rel="stylesheet" href="../../../styles/css.css" type="text/css"></link>
  56. <link rel="stylesheet" href="../../../styles/style.css" type="text/css"></link>
  57. <script type="text/javascript" src="../../../scripts/dojo/dojo/dojo.js" djConfig="isDebug: false, parseOnLoad: true"></script>
  58. <script type="text/javascript">
  59. dojo.require("dijit.form.Form");
  60. dojo.require("dijit.form.ValidationTextBox");
  61. dojo.require("dijit.form.ComboBox");
  62. dojo.require("dijit.form.FilteringSelect");
  63. dojo.require("dijit.form.NumberSpinner");
  64. dojo.require("dijit.form.Button");
  65. dojo.require("dijit.Tooltip");
  66. </script>
  67. <style type="text/css">
  68. @import "../../../scripts/dojo/dojo/resources/dojo.css";
  69. @import "../../../scripts/dojo/dijit/themes/tundra/tundra.css";
  70. @import "../../../scripts/dojo/dijit/themes/tundra/tundra_rtl.css";
  71. @import "../../../scripts/dojo/dijit/tests/css/dijitTests.css";
  72. .formQuestion {
  73. background-color:#d0e3f5;
  74. padding:0.3em;
  75. font-weight:900;
  76. font-family:Verdana, Arial, sans-serif;
  77. font-size:0.8em;
  78. color:#5a5a5a;
  79. }
  80. .formAnswer {
  81. background-color:#f5eede;
  82. padding:0.3em;
  83. margin-bottom:1em;
  84. width: 100%;
  85. }
  86. .pageSubContentTitle {
  87. color:#8e8e8e;
  88. font-size:1em;
  89. font-family:Verdana, Arial, sans-serif;
  90. margin-bottom:0.75em;
  91. }
  92. .small INPUT {
  93. width: 2.5em;
  94. }
  95. .medium INPUT {
  96. width: 10em;
  97. }
  98. .long INPUT {
  99. width: 20em;
  100. }
  101. .firstLabel {
  102. display: inline-block;
  103. display: -moz-inline-box;
  104. width: 10em;
  105. min-width: 10em;
  106. }
  107. .secondLabel {
  108. width: auto;
  109. margin-left: 5em;
  110. margin-right: 1em;
  111. }
  112. fieldset label {
  113. margin-right: 1em;
  114. }
  115. .noticeMessage {
  116. display: block;
  117. float: right;
  118. font-weight: normal;
  119. font-family:Arial, Verdana, sans-serif;
  120. color:#663;
  121. font-size:0.9em;
  122. }
  123. </style>
  124. </head>
  125. <body class="tundra">
  126. <form name="form1" method="post" action="SelectExc.jsp">
  127. <input type="hidden" name="listid" value="<%=listid %>">
  128. <input type="hidden" name="action" value="<%=action %>">
  129. <input type="hidden" name="oDataName" value="<%=dataName %>">
  130. <input type="hidden" name="oLabel" value="<%=label %>">
  131. <div id=total>
  132. <div class="whiteborder">
  133. <div class="titback">
  134. <div class="floatleft"><img src="../../../images/index/arrow1.gif" width="20" height="24"/></div>
  135. <div class="dropshadow">定义选择查询构件</div>
  136. <div class="clear"></div>
  137. </div>
  138. <div class="report">
  139. <table border="0" align="center" width="100%" cellpadding="1" cellspacing="1" class="ltab2">
  140. <tr>
  141. <td width="15%">表名:&nbsp;<font color="red">*</font></td>
  142. <td align="left" >
  143. <select id="classid" name="classid" onChange="getTable(this,dojo.byId('dataName'),'constant')"
  144. dojoType="dijit.form.FilteringSelect"
  145. autocomplete="true" invalidMessage="表名必须填写!">
  146. <option value=" "></option>
  147. <%
  148. for(int i = 0 ; i < tableList.size(); i ++){
  149. int iclassid = Integer.parseInt((String)tableList.get(i));
  150. SysModel sysmodel = ModelFactory.getSysmodel();
  151. MdpClassImpl MdpClass = (MdpClassImpl)sysmodel.getMdpClassByClassID(iclassid);
  152. %>
  153. <option value="<%=iclassid %>" <%if(classid.equals((String)tableList.get(i)))out.print("selected"); %>><%=MdpClass.getDescription()%></option>
  154. <%}%>
  155. </select></td>
  156. </tr>
  157. <tr>
  158. <td>字段:&nbsp;<font color="red">*</font></td>
  159. <td align="left" ><select name="dataName" id="dataName"
  160. invalidMessage="字段必须填写!">
  161. <option value="0" selected></option>
  162. <%
  163. if(!dataName.equals("") && (!classid.equals("0"))){
  164. SysModel sysmodel = ModelFactory.getSysmodel();
  165. MdpClassImpl MdpClass = (MdpClassImpl)sysmodel.getMdpClassByClassID(Integer.parseInt(classid));
  166. ArrayList list = (ArrayList)MdpClass.getAllMdpAttributes();
  167. for(int i = 0 ; i < list.size(); i ++){
  168. MdpAttributeImpl MdpAttribute = (MdpAttributeImpl) list.get(i);
  169. %>
  170. <option value="<%=MdpAttribute.getName() %>" <%if(dataName.equals(MdpAttribute.getName()))out.print("selected") ;%>><%=MdpAttribute.getDescription()%></option>
  171. <%}}%>
  172. </select></td>
  173. </tr>
  174. <tr>
  175. <td>标题:&nbsp;<font color="red">*</font></td>
  176. <td align="left"><input type="text" id="label" name="label" class="medium"
  177. dojoType="dijit.form.ValidationTextBox"
  178. required="true"
  179. ucfirst="true"
  180. value="<%=label %>"
  181. invalidMessage="标题必须填写!"/></td>
  182. </tr>
  183. <tr>
  184. <td>操作类型:</td>
  185. <td align="left" ><select name="operator" dojoType="dijit.form.FilteringSelect"
  186. id="operator" autocomplete="true">
  187. <option value="0"></option>
  188. <option value="like" <%if(operator.equals("like")) out.print("selected"); %> >like</option>
  189. <option value="equals" <%if(operator.equals("equals")) out.print("selected"); %>>equals</option>
  190. <option value="morethan" <%if(operator.equals("morethan")) out.print("selected"); %>>大于等于</option>
  191. <option value="lessthan" <%if(operator.equals("lessthan")) out.print("selected"); %>>小于等于</option>
  192. </select></td>
  193. </tr>
  194. <tr class="">
  195. <td>dojo]控件类型</td>
  196. <td align="left">
  197. <select id="dojoInuptType" name="dojoInuptType"
  198. dojoType="dijit.form.FilteringSelect">
  199. <option value="0">--请选择--</option>
  200. <% ArrayList dojoInuptTypes = XFormModelImpl.getInstance().getDojoInuptTypesByType("text");
  201. for(int m = 0; m<dojoInuptTypes.size(); m++){
  202. DojoInputTypeImpl DojoInputTypeImpl=(DojoInputTypeImpl)dojoInuptTypes.get(m);
  203. %>
  204. <option value="<%=DojoInputTypeImpl.getCode() %>" <%if(DojoInputTypeImpl.getCode().equals(dojoInuptType))out.print("selected");%>><%=DojoInputTypeImpl.getName() %></option>
  205. <%} %>
  206. </select>
  207. </td>
  208. </tr>
  209. <tr class="">
  210. <td>正则表达式</td>
  211. <td align="left"><select id="regxValue" name="regxValue"
  212. dojoType="dijit.form.FilteringSelect">
  213. <option value="0">--请选择--</option>
  214. <% ArrayList regExps=XFormModelImpl.getInstance().getRegExps();
  215. for(int j = 0; j<regExps.size(); j++){
  216. RegExpImpl RegExpImpl=(RegExpImpl)regExps.get(j);
  217. %>
  218. <option value="<%=RegExpImpl.getCode() %>" <%if(RegExpImpl.getCode().equals(regxValue))out.print("selected");%>><%=RegExpImpl.getName() %></option>
  219. <%} %>
  220. </select></td>
  221. </tr>
  222. </table>
  223. </div>
  224. <div class="btmbox">
  225. <button id="save" dojoType="dijit.form.Button" onClick='console.log("clicked simple")' type="submit" iconClass="plusIcon">
  226. 保存
  227. </button>
  228. <span dojoType="dijit.Tooltip" connectId="save">保存按钮</span>&nbsp;&nbsp;
  229. <button id="re" dojoType="dijit.form.Button" onClick='console.log("clicked simple")' type="reset" iconClass="plusIcon">
  230. 重置
  231. </button>
  232. <span dojoType="dijit.Tooltip" connectId="re">重置按钮</span>&nbsp;&nbsp;
  233. <button id="clo" dojoType="dijit.form.Button" onClick='console.log("clicked simple"),window.close();' type="button" iconClass="plusIcon">
  234. 关闭
  235. </button>
  236. <span dojoType="dijit.Tooltip" connectId="clo">关闭按钮</span>&nbsp;&nbsp;
  237. </div>
  238. </div>
  239. </div>
  240. </form>
  241. <br>
  242. </body>
  243. </html>