design.jsp 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. <%@ page pageEncoding="UTF-8"%>
  2. <%@ page contentType="text/html; charset=UTF-8" language="java" %>
  3. <%@ page
  4. import ="java.util.*"%>
  5. <%@ page language="java"
  6. import="com.sysmodel.XFormFactory,
  7. com.sysmodel.listmodel.xmlmodel.impl.FormListImpl,
  8. com.sysmodel.listmodel.xmlmodel.able.QueryList,
  9. com.sysmodel.listmodel.xmlmodel.impl.ListFieldImpl,
  10. com.sysmodel.listmodel.xmlmodel.impl.QueryFieldImpl"%>
  11. <%!
  12. private String produceControl(QueryFieldImpl field) {
  13. return field.getControl().produceHtml(field.getDataName(), "","",field.getValidate());
  14. }
  15. %>
  16. <%
  17. String listid = request.getParameter("listid") == null ? "" : request.getParameter("listid");
  18. String sessionReload = request.getParameter("sessionReload") == null ? "false" : request.getParameter("sessionReload");
  19. FormListImpl FormList = null;
  20. if(session.getAttribute("FormList"+listid) == null || sessionReload.equals("true")){
  21. if(!listid.equals("")){
  22. FormListImpl FormListold =(FormListImpl)XFormFactory.getXFormModel().getFormList(listid);
  23. FormList = (FormListImpl)FormListold.clone();
  24. session.setAttribute("FormList"+listid,FormListold.clone());
  25. } else{
  26. return;
  27. }
  28. } else {
  29. FormList = (FormListImpl)session.getAttribute("FormList"+listid);
  30. }
  31. %>
  32. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  33. <html>
  34. <HEAD>
  35. <script type="text/javascript">
  36. function openDesiner(ulr,width,height){
  37. window.open(ulr+"?listid=<%=listid%>",'',"'width="+width+",height="+height+"'");
  38. }
  39. </script>
  40. <TITLE></TITLE>
  41. <META http-equiv="Content-Type" content="text/html; charset=utf-8">
  42. <link rel="stylesheet" href="../../../styles/css.css" type="text/css">
  43. <link rel="stylesheet" href="../../../styles/contextMenu.css" type="text/css"></link>
  44. <script type="text/javascript" src="../../../scripts/contextMenu.js"></script>
  45. <script type="text/javascript" src="../../../scripts/dojo/dojo/dojo.js"
  46. djConfig="isDebug: false, parseOnLoad: true"></script>
  47. <script type="text/javascript">
  48. dojo.require("dijit.form.Form");
  49. dojo.require("dijit.form.FilteringSelect");
  50. dojo.require("dijit.form.Button");
  51. dojo.require("dijit.Tooltip");
  52. </script>
  53. <style type="text/css">
  54. @import "../../../scripts/dojo/dojo/resources/dojo.css";
  55. @import "../../../scripts/dojo/dijit/themes/tundra/tundra.css";
  56. @import "../../../scripts/dojo/dijit/themes/tundra/tundra_rtl.css";
  57. @import "../../../scripts/dojo/dijit/tests/css/dijitTests.css";
  58. </style>
  59. <script type="text/javascript">
  60. var selectTdObj;
  61. function makeMenu(){
  62. var myMenu, item;
  63. myMenu = new contextMenu();
  64. item = new contextItem("修改", "../../../images/button/edit.gif", "editObj();", "menu");
  65. myMenu.addItem(item);
  66. item = new contextItem("删除", "../../../images/button/delete.gif", "deleteObj();", "menu");
  67. myMenu.addItem(item);
  68. item = new contextItem("", "", "", "separator");
  69. myMenu.addItem(item);
  70. item = new contextItem("刷新", "../../../images/button/refresh.gif", "window.location.reload();", "menu");
  71. myMenu.addItem(item);
  72. myMenu.show(this.document);
  73. delete item;
  74. delete myMenu;
  75. }
  76. function deleteObj(){
  77. if(confirm("确定要删除吗?")){
  78. var type = selectTdObj.type;
  79. if(type == "pagesize"){
  80. location.href="designExc.jsp?listid=<%=listid%>&deltype=" + type;
  81. }
  82. else if(type == "pageorder"){
  83. location.href="designExc.jsp?listid=<%=listid%>&deltype=" + type;
  84. }
  85. else if(type == "queryfield"){
  86. location.href="designExc.jsp?listid=<%=listid%>&deltype=" + type
  87. +"&classid="+selectTdObj.classid
  88. +"&fieldname="+selectTdObj.fieldname
  89. +"&operator="+selectTdObj.operator;
  90. }
  91. else if(type == "pagetier"){
  92. location.href="designExc.jsp?listid=<%=listid%>&deltype=" + type
  93. +"&classid="+selectTdObj.classid
  94. +"&fieldname="+selectTdObj.fieldname
  95. +"&fieldlabel="+selectTdObj.fieldlabel;
  96. }
  97. }
  98. }
  99. function editObj(){
  100. var type = selectTdObj.type;
  101. var dataName = selectTdObj.fieldname;
  102. var classid = selectTdObj.classid;
  103. var controltype = selectTdObj.controltype;
  104. var fieldlabel = selectTdObj.fieldlabel;
  105. var url = "listid=<%=listid%>&dataName="+dataName+"&classid="+classid+"&label="+fieldlabel+"&controltype="+controltype;
  106. if(type == "pagesize"){
  107. openDesiner('../design/TableAtt.jsp','200','400');
  108. }
  109. else if(type == "pageorder"){
  110. openDesiner('../design/TableAtt.jsp','200','400');
  111. }
  112. else if(type == "queryfield"){
  113. var controltype = selectTdObj.controltype;
  114. if(controltype == "text"){
  115. window.open("../design/text.jsp?"+url,'',"'width=400,height=500'");
  116. } else if(controltype == "date"){
  117. window.open("../design/date.jsp?"+url,'',"'width=400,height=500'");
  118. } else if(controltype == "tree"){
  119. window.open("../design/tree.jsp?"+url,'',"'width=400,height=500'");
  120. } else if(controltype == "select"){
  121. window.open("../design/select.jsp?"+url,'',"'width=400,height=500'");
  122. }
  123. }
  124. else if(type == "pagetier"){
  125. var dataName = selectTdObj.fieldname;
  126. var classid = selectTdObj.classid;
  127. var fieldlabel = selectTdObj.fieldlabel;
  128. var showType = selectTdObj.showType
  129. url = "listid=<%=listid%>&dataName="+dataName+"&classid="+classid+"&label="+fieldlabel+"&showType="+showType;
  130. window.open("../design/tier.jsp?"+url,'',"'width=400,height=500'");
  131. }
  132. }
  133. makeMenu();
  134. document.onclick = hideMenu;
  135. function saveConfig(){
  136. if(confirm("确定要发布应用吗?")){
  137. location.href="designExc.jsp?listid=<%=listid%>&doaction=save";
  138. }
  139. }
  140. function reloadConfig(){
  141. if(confirm("确定要恢复原来的配置吗?")){
  142. location.href="designExc.jsp?listid=<%=listid%>&doaction=reload";
  143. }
  144. }
  145. //-->
  146. </script>
  147. <script type="text/javascript" src="../../../scripts/calendar/calendar.js"></script>
  148. <link rel="stylesheet" href="../../../scripts/calendar/calendar-blue.css" type="text/css"></link>
  149. <script type="text/javascript" src="../../../scripts/calendar/calendar-zh.js"></script>
  150. </HEAD>
  151. <body class="tundra" oncontextmenu="if(!event.ctrlKey){return false} else {return true}">
  152. <form action="">
  153. <div style="position: absolute; width:8%; height:65%;top:8px; left:10; border: 1px solid #999999; overflow:auto;" id="layer1">
  154. <table align="center">
  155. <tr>
  156. <td width="20">
  157. <img src="../../../images/tool/save.gif" id="tsave" onclick="saveConfig();"></img>
  158. <span dojoType="dijit.Tooltip" connectId="tsave">发布到客户端</span>
  159. </td>
  160. <td width="20">
  161. <img src="../../../images/tool/undo.gif" id="tundo" onclick="reloadConfig();"></img>
  162. <span dojoType="dijit.Tooltip" connectId="tundo">撤销到系统在用的设计</span>
  163. </td>
  164. </tr>
  165. <tr>
  166. <td>
  167. <img src="../../../images/tool/htmltab.gif" id="htmltab" onclick="openDesiner('../design/TableAtt.jsp','200','400');"></img>
  168. <span dojoType="dijit.Tooltip" connectId="htmltab">列表表单属性</span>
  169. </td>
  170. <td></td>
  171. </tr>
  172. <tr><td colspan="2">&nbsp;</td></tr>
  173. <tr>
  174. <td>
  175. <img src="../../../images/tool/select.gif" id="select" onclick="openDesiner('../design/select.jsp','400','500');"></img>
  176. <span dojoType="dijit.Tooltip" connectId="select">定义选择查询构件</span>
  177. </td>
  178. <td></td>
  179. </tr>
  180. <tr>
  181. <td>
  182. <img src="../../../images/tool/date.gif" id="date" onclick="openDesiner('../design/date.jsp','400','500');"></img>
  183. <span dojoType="dijit.Tooltip" connectId="date">定义日期查询构件</span>
  184. </td>
  185. <td></td>
  186. </tr>
  187. <tr>
  188. <td>
  189. <img src="../../../images/tool/text.gif" id="text" onclick="openDesiner('../design/text.jsp','400','500');"></img>
  190. <span dojoType="dijit.Tooltip" connectId="text">定义文本框查询构件</span>
  191. </td>
  192. <td></td>
  193. </tr>
  194. <tr>
  195. <td>
  196. <img src="../../../images/tool/tree.gif" id="tree" onclick="openDesiner('../design/tree.jsp','400','500');"></img>
  197. <span dojoType="dijit.Tooltip" connectId="tree">定义树形查询构件</span>
  198. </td>
  199. <td></td>
  200. </tr>
  201. <tr>
  202. <td>
  203. <img src="../../../images/tool/sort.gif" id="sortqf" onclick="openDesiner('../design/SerchOutSort.jsp','400','500');"></img>
  204. <span dojoType="dijit.Tooltip" connectId="sortqf">排序查询构件</span>
  205. </td>
  206. <td></td>
  207. </tr>
  208. <tr><td colspan="2">&nbsp;</td></tr>
  209. <tr>
  210. <td>
  211. <img src="../../../images/tool/dataset.gif" id="dataset" onclick="openDesiner('../design/tier.jsp','400','500');"></img>
  212. <span dojoType="dijit.Tooltip" connectId="dataset">定义列表字段</span>
  213. </td>
  214. <td></td>
  215. </tr>
  216. <tr>
  217. <td>
  218. <img src="../../../images/tool/sort.gif" id="sortqlf" onclick="openDesiner('../design/OutSort.jsp','400','500');"></img>
  219. <span dojoType="dijit.Tooltip" connectId="sortqlf">排序列表字段</span>
  220. </td>
  221. <td></td>
  222. </tr>
  223. </table>
  224. </div>
  225. <div style="position: absolute; width:90%; height:auto;top:10; left:90; border: 1px solid #999999; overflow:auto;" align="center" id="layer1">
  226. <br><br>
  227. <div id=total>
  228. <div class="whiteborder">
  229. <div class="titback">
  230. <div class="floatleft"><img src="../../../images/index/arrow1.gif" width="20" height="24" /></div>
  231. <div class="dropshadow">
  232. <%
  233. if(FormList.getListHead() != null)
  234. out.print(FormList.getListHead().getTitle());
  235. %></div>
  236. <div class="clear"></div>
  237. </div>
  238. </div>
  239. <div class="report">
  240. <%
  241. try{
  242. String LineCssA = XFormFactory.getXFormModel().getCSSValue("LineCssA");
  243. String LineCssB = XFormFactory.getXFormModel().getCSSValue("LineCssB");
  244. ArrayList queryFields = FormList.getQueryFields();
  245. if(queryFields.size() > 0){
  246. %>
  247. <table align="center" id="SortTable" width="<%=FormList.getListWidth()%>" cellpadding="1" cellspacing="1" class="<%=XFormFactory.getXFormModel().getCSSValue("TableCss") %>">
  248. <%
  249. int iRowField = 2;
  250. for (int i = 0; i < queryFields.size(); i++) {
  251. QueryFieldImpl field = (QueryFieldImpl)queryFields.get(i);
  252. if(i%iRowField == 0){
  253. if(i != 0) out.print("</tr>");
  254. %><tr>
  255. <%}
  256. %>
  257. <td width="15%" align="right"
  258. type="queryfield" classid="<%=field.getClassid() %>" fieldname="<%=field.getDataName() %>"
  259. operator="<%=field.getOperator()%>" controltype="<%=field.getControlType()%>"
  260. classid="<%=field.getClassid()%>" fieldlabel = "<%=field.getLabel()%>"
  261. onMouseUp="rightUp(this);"
  262. onmouseover="tdchangeStyle(this, 'on');"
  263. onmouseout="tdchangeStyle(this, 'out');"><%=field.getLabel() %></td>
  264. <td width="35%" align="left" nowrap>
  265. <%=produceControl(field) %>
  266. </td>
  267. <%}
  268. int imod = queryFields.size() % iRowField;
  269. if(imod !=0){
  270. out.print("<td colspan="+ (imod * 2) +" ></td>");
  271. out.print("</tr>");
  272. }
  273. %>
  274. <tr class="<%=XFormFactory.getXFormModel().getCSSValue("ActionRowCss")%>">
  275. <td colspan="4" align="right">&nbsp;&nbsp;
  276. <input type="button" style='CURSOR:hand' class="button" value="查询"/>&nbsp;&nbsp;
  277. <input type="button" style='CURSOR:hand' class="button" value="重置" onClick="document.form1.reset();"/>
  278. &nbsp;&nbsp;&nbsp;
  279. </td>
  280. </tr>
  281. </table>
  282. <%
  283. }
  284. QueryList QueryList = FormList.getQueryList();
  285. if(QueryList != null){
  286. %>
  287. <table align="center" id="SortTable" width="<%=FormList.getListWidth()%>" cellpadding="1" cellspacing="1" class="<%=XFormFactory.getXFormModel().getCSSValue("TableCss") %>">
  288. <thead>
  289. <tr class="<%=XFormFactory.getXFormModel().getCSSValue("ListTableHeadCss")%>">
  290. <%
  291. if(QueryList.isHaveOrder()){
  292. %>
  293. <td width="35" type="pageorder"
  294. onMouseUp="rightUp(this);" onmouseover="tdchangeStyle(this, 'on');"
  295. onmouseout="tdchangeStyle(this, 'out');">序号</td>
  296. <%
  297. }
  298. ArrayList list = QueryList.getlistFields();
  299. for(int i = 0; i < list.size(); i ++){
  300. ListFieldImpl ListField = (ListFieldImpl)list.get(i);
  301. %>
  302. <td width="<%=ListField.getWidth() %>" type="pagetier"
  303. classid="<%=ListField.getClassid() %>"
  304. fieldname="<%=ListField.getDataName() %>" showType="<%=ListField.getShowType() %>" fieldlabel="<%=ListField.getLabel()%>"
  305. onMouseUp="rightUp(this);" onmouseover="tdchangeStyle(this, 'on');"
  306. onmouseout="tdchangeStyle(this, 'out');"><%=ListField.getLabel() %></td>
  307. <%
  308. }
  309. %>
  310. </tr>
  311. </thead>
  312. <tbody>
  313. <%
  314. for(int i = 0; i <= 5 ; i ++){
  315. %>
  316. <tr height="26" class="<%if(i%2 ==0) out.print(LineCssA);else out.print(LineCssB); %>">
  317. <%
  318. if(QueryList.isHaveOrder()){
  319. %><td><%=i+1 %></td><%
  320. }
  321. for(int j = 0; j < list.size(); j ++){
  322. ListFieldImpl ListField = (ListFieldImpl)list.get(j);
  323. String showTire = "&nbsp;";
  324. if(ListField.getShowType().equals("1")){
  325. showTire="<a href=\"" +request.getContextPath() + ListField.getUrl() + "\" class=\"WLink\" target=\"\">"+
  326. "<img src=\""+ ListField.getImage() +"\" border=\"0\"/></a>";
  327. }
  328. if(ListField.getShowType().equals("2")){
  329. showTire="<a href=\"" + request.getContextPath() + ListField.getUrl() + "\" target=\"\">"+ ListField.getShowTxt() +"</a>";
  330. }
  331. %><td><%=showTire %></td><%
  332. }
  333. %>
  334. </tr>
  335. <%}%>
  336. </tbody>
  337. </table>
  338. <%if(QueryList.getPageSize() > 0){ %>
  339. <DIV class=Paginator>
  340. <table width="100%" border="0" cellpadding="0" cellspacing="0" class="ltab2">
  341. <tr>
  342. <td height="28" align="center"
  343. valign="middle" nowrap class="DefTxtCss"
  344. onmouseover="tdchangeStyle(this, 'on');" onmouseout="tdchangeStyle(this, 'out');"
  345. type="pagesize"
  346. onMouseUp="rightUp(this);"> 共 *** 条 | 1/13 页 | 每页显示
  347. <input type="text" name="PageNum" id="PageNum" value="<%=QueryList.getPageSize() %>" style="width: 40px"> 条 | 跳转至第
  348. <input type="text" name="PageCurr" id="PageCurr" value="1" style="width: 40px"> 页
  349. <a href='#' onClick="javascript:void(0);">1</a>
  350. <a href='#' onClick="javascript:void(0);">2</a>
  351. <a href='#' onClick="javascript:void(0);">3</a>
  352. <a href='#' onClick="javascript:void(0);">4</a>
  353. <a href='#' onClick="javascript:void(0);">&gt;</a>
  354. <a href='#' onClick="javascript:void(0);">&gt;&gt;</a></td>
  355. </tr>
  356. </table>
  357. </DIV>
  358. <%
  359. }
  360. }
  361. } catch(Exception e ){
  362. }
  363. %>
  364. </div>
  365. </div>
  366. <br>
  367. </div>
  368. </form>
  369. </body>
  370. </html>