create.jsp 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <%@ page contentType="text/html; charset=UTF-8" language="java"%>
  2. <%@ page import="java.util.*"%>
  3. <%@ page
  4. import="com.sysmodel.datamodel.xmlmodel.ModelFactory,
  5. com.sysmodel.datamodel.xmlmodel.impl.MdpModuleImpl,
  6. com.sysmodel.datamodel.xmlmodel.able.SysModel,
  7. com.sysmodel.datamodel.xmlmodel.impl.MdpClassImpl"%>
  8. <%
  9. SysModel sysmodel = ModelFactory.getSysmodel();
  10. ArrayList list = sysmodel.getMdpModules();
  11. ArrayList mdpClasses = sysmodel.getMdpClasses();
  12. %>
  13. <HTML>
  14. <HEAD>
  15. <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  16. <TITLE></TITLE>
  17. <link rel="stylesheet" href="../../../../styles/style.css"
  18. type="text/css"></link>
  19. <link rel="stylesheet" href="../../../../styles/css.css"
  20. type="text/css"></link>
  21. <script type="text/javascript" src="../../../../scripts/dojo/dojo/dojo.js"
  22. djConfig="isDebug: false, parseOnLoad: true"></script>
  23. <script type="text/javascript">
  24. dojo.require("dijit.form.Form");
  25. dojo.require("dijit.form.FilteringSelect");
  26. dojo.require("dijit.form.Button");
  27. dojo.require("dijit.Tooltip");
  28. </script>
  29. <style type="text/css">
  30. @import "../../../../scripts/dojo/dojo/resources/dojo.css";
  31. @import "../../../../scripts/dojo/dijit/themes/tundra/tundra.css";
  32. @import "../../../../scripts/dojo/dijit/themes/tundra/tundra_rtl.css";
  33. @import "../../../../scripts/dojo/dijit/tests/css/dijitTests.css";
  34. </style>
  35. <script language="JavaScript">
  36. function getTable(obj, selectName){
  37. var strA = "";
  38. createXMLHttpRequest();
  39. axo = new ActiveXObject("Microsoft.XMLDOM");
  40. XMLHttpReq.open("POST","../table/getClassids.jsp?type="+obj.getValue()+"",false);
  41. XMLHttpReq.setRequestHeader("Content-Length",strA.length);
  42. XMLHttpReq.setRequestHeader("Content-type","application/x-www-form-urlencoded");
  43. XMLHttpReq.send(strA);
  44. axo.loadXML(XMLHttpReq.responseText);
  45. n1 = axo.selectNodes("/root/classid");
  46. n2 = axo.selectNodes("/root/description");
  47. BuildSel(unescape(XMLHttpReq.responseText),selectName, n1, n2);
  48. }
  49. </script>
  50. <script type="text/javascript" src="../select.js"></script></HEAD>
  51. <body class="tundra">
  52. <form dojoType="dijit.form.Form" name="form1" method="post" action="">
  53. <div id=total>
  54. <div class="whiteborder">
  55. <div class="titback">
  56. <div class="floatleft"><img src="../../../../images/index/arrow1.gif" alt="1"
  57. width="20" height="24" /></div>
  58. <div class="dropshadow"> 批量生成JAVA对象</div>
  59. <div class="clear"></div>
  60. </div>
  61. <div class="report">
  62. <table align="center" id="SortTable512_1" width="100%"
  63. cellpadding="1" cellspacing="1" class="ltab2">
  64. <tr>
  65. <td width="60%" valign="top"><table align="center" width="100%" border="0" cellpadding="1"
  66. cellspacing="1" class="ltab2">
  67. <tr align="left" class="TableBgColorBlack">
  68. <td colspan="4" height="31"> 请选择模块&nbsp;&nbsp;&nbsp;
  69. <select name="module" onChange="getTable(this, dojo.byId('role1'))"
  70. dojoType="dijit.form.FilteringSelect"
  71. id="module" autocomplete="true">
  72. <option value="">全部数据表</option>
  73. <%
  74. for (int i = 0; i < list.size(); i++) {
  75. MdpModuleImpl Mdpmod = (MdpModuleImpl) list.get(i);
  76. %>
  77. <option value="<%=Mdpmod.getCode()%>"> <%=Mdpmod.getName()%> </option>
  78. <%
  79. }
  80. %>
  81. </select>
  82. </td>
  83. </tr>
  84. <tr class="TableBgColorAsh">
  85. <td width="40%" align="center">
  86. <select name="select" size="15" multiple id="role1" style="width:80%">
  87. <%
  88. for (int i = 0; i < mdpClasses.size(); i++) {
  89. MdpClassImpl mdpClass = (MdpClassImpl) mdpClasses.get(i);
  90. %>
  91. <option value="<%=mdpClass.getClassid()%>"> <%=mdpClass.getDescription()%> </option>
  92. <%
  93. }
  94. %>
  95. </select>
  96. </td>
  97. <td width="20%" align="center"><input name="button" type="button" class="button2"
  98. style="cursor:hand" onClick="move(this.form.role1,this.form.role2);"
  99. value=" &gt;&gt; " />
  100. <br>
  101. <br>
  102. <input name="button" type="button" class="button2"
  103. style="cursor:hand" onClick="move(this.form.role2,this.form.role1);"
  104. value=" &lt;&lt; " />
  105. </td>
  106. <td width="40%" align="center" valign="middle"><select name="select" size="15" multiple class="SelectScroll" id="role2" style="width:80%">
  107. </select>
  108. </td>
  109. </tr>
  110. <tr class="TableBgColorBlack">
  111. <td colspan="3">
  112. <button id="save" dojoType="dijit.form.Button" onClick='checkConfig();' type="button" iconClass="plusIcon">
  113. 生成java</button>&nbsp;&nbsp;
  114. </td>
  115. </table></td>
  116. <td width="40%" height="100%" valign="top">
  117. 生成JAVA文件路径:<% String javapath = sysmodel.getFileLoadFolder();
  118. out.print(javapath.replace("WEB-INF","java"));%>
  119. <div id="boxIdea" align="left" style="width:98%;height:98%;border:1px solid #999999;">
  120. </div>
  121. </td>
  122. </tr>
  123. </table>
  124. </div>
  125. </div>
  126. </div>
  127. </form>
  128. <script language="JavaScript">
  129. var indexOfCheck = 0;
  130. var role2=document.all.item("role2");
  131. function checkConfig() {
  132. indexOfCheck = 0
  133. var boxIdea=document.all.item("boxIdea");
  134. boxIdea.innerHTML = "";
  135. if(role2.options.length == 0){
  136. alert("请选则进行验证的表对象!");
  137. return;
  138. }
  139. var classid = role2.options[0].value;
  140. checkOneObj(classid)
  141. }
  142. function checkOneObj(classid){
  143. if(classid=="") return;
  144. createXMLHttpRequest();
  145. var strA = "";
  146. XMLHttpReq.open("POST","createExc.jsp?classid=" + classid,false);
  147. XMLHttpReq.setRequestHeader("Content-Length",strA.length);
  148. XMLHttpReq.setRequestHeader("Content-type","application/x-www-form-urlencoded");
  149. XMLHttpReq.send(strA);
  150. var boxIdea=document.all.item("boxIdea");
  151. boxIdea.innerHTML = boxIdea.innerHTML + XMLHttpReq.responseText;
  152. indexOfCheck = indexOfCheck + 1;
  153. if(indexOfCheck < role2.options.length){
  154. checkOneObj(role2.options[indexOfCheck].value);
  155. }else{
  156. return;
  157. }
  158. }
  159. // End -->
  160. </script>
  161. </BODY>
  162. </HTML>