tree.jsp 9.1 KB

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