xmlBytable.jsp 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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.able.SysModel,
  6. com.sysmodel.datamodel.xmlmodel.impl.MdpClassImpl"%>
  7. <%
  8. SysModel sysmodel = ModelFactory.getSysmodel();
  9. ArrayList list = sysmodel.getMdpModules();
  10. ArrayList mdpClasses = sysmodel.getMdpClasses();
  11. %>
  12. <HTML>
  13. <HEAD>
  14. <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  15. <TITLE></TITLE>
  16. <link rel="stylesheet" href="../../../../styles/css.css" type="text/css"></link>
  17. <link rel="stylesheet" href="../../../../styles/style.css" type="text/css"></link>
  18. <script type="text/javascript" src="../../../../scripts/dojo/dojo/dojo.js"
  19. djConfig="isDebug: false, parseOnLoad: true"></script>
  20. <script type="text/javascript">
  21. dojo.require("dijit.form.Form");
  22. dojo.require("dijit.form.FilteringSelect");
  23. dojo.require("dijit.form.Button");
  24. dojo.require("dijit.Tooltip");
  25. </script>
  26. <style type="text/css">
  27. @import "../../../../scripts/dojo/dojo/resources/dojo.css";
  28. @import "../../../../scripts/dojo/dijit/themes/tundra/tundra.css";
  29. @import "../../../../scripts/dojo/dijit/themes/tundra/tundra_rtl.css";
  30. @import "../../../../scripts/dojo/dijit/tests/css/dijitTests.css";
  31. </style>
  32. <script language="JavaScript">
  33. function ChooseModule(Code, selectName){
  34. var strA = "";
  35. if(Code == "root") Code = "";
  36. createXMLHttpRequest();
  37. axo = new ActiveXObject("Microsoft.XMLDOM");
  38. XMLHttpReq.open("POST","../../../sysmodel/dbmanager/table/getClassids.jsp?type="+ Code +"",false);
  39. XMLHttpReq.setRequestHeader("Content-Length",strA.length);
  40. XMLHttpReq.setRequestHeader("Content-type","application/x-www-form-urlencoded");
  41. XMLHttpReq.send(strA);
  42. axo.loadXML(XMLHttpReq.responseText);
  43. n1 = axo.selectNodes("/root/classid");
  44. n2 = axo.selectNodes("/root/description");
  45. BuildSel(unescape(XMLHttpReq.responseText),selectName, n1, n2);
  46. }
  47. </script>
  48. <!-- 为了实现模块的选择功能引入下面资源 -->
  49. <link rel="stylesheet" type="text/css" href="../../../../scripts/ext20/resources/css/ext-all.css" />
  50. <script type="text/javascript" src="../../../../scripts/ext20/adapter/ext/ext-base.js"></script>
  51. <script type="text/javascript" src="../../../../scripts/ext20/ext-all.js"></script>
  52. <link rel="stylesheet" href="../../../../scripts/ext20/examples/examples.css" type="text/css"></link>
  53. <script type="text/javascript" src="../../../../scripts/ext20/examples/examples.js"></script>
  54. <script type="text/javascript">
  55. Ext.onReady(function(){
  56. Ext.BLANK_IMAGE_URL = '../../../../scripts/ext20/resources/images/default/s.gif';
  57. var Tree = Ext.tree;
  58. var tree = new Tree.TreePanel({
  59. el:'tree-div',
  60. autoScroll:true,
  61. animate:true,//是否动画
  62. enableDD:true,// 是否支持拖放
  63. containerScroll:true,
  64. lines:true,
  65. loader:new Tree.TreeLoader({dataUrl:"../../../getModuleJson.jsp"})
  66. });
  67. var root = new Tree.AsyncTreeNode({
  68. text: '全部系统模块',
  69. draggable:false,
  70. id:'root'
  71. });
  72. tree.on('click', function(node){
  73. ChooseModule(node.id, dojo.byId('role1'))
  74. });
  75. tree.setRootNode(root);
  76. tree.render();
  77. root.expand();
  78. });
  79. </script>
  80. <script type="text/javascript" src="../select.js"></script>
  81. </HEAD>
  82. <body class="tundra">
  83. <form name="form1" method="post" action="">
  84. <div id=total>
  85. <div class="whiteborder">
  86. <div class="titback">
  87. <div class="floatleft"><img src="../../../../images/index/arrow1.gif" alt="1"
  88. width="20" height="24" /></div>
  89. <div class="dropshadow"> 检查数据库命名规范</div>
  90. <div class="clear"></div>
  91. </div>
  92. <div class="report">
  93. <table align="center" id="SortTable512_1" width="100%"
  94. cellpadding="1" cellspacing="1" class="ltab2">
  95. <tr>
  96. <td width="60%" valign="top">
  97. <table align="center" width="100%" border="0" cellpadding="1" cellspacing="1" class="ltab2">
  98. <tr class="TableBgColorAsh">
  99. <td width="30%" align="left" valign="top">
  100. <div id="tree-div" style="z-index:9999;overflow:auto; height:100%; width:100%;border:1px solid #c3daf9;">
  101. </div>
  102. </td>
  103. <td width="30%" align="center">
  104. <select name="select" size="15" multiple id="role1" style="width:80%">
  105. <%
  106. for (int i = 0; i < mdpClasses.size(); i++) {
  107. MdpClassImpl mdpClass = (MdpClassImpl) mdpClasses.get(i);
  108. %>
  109. <option value="<%=mdpClass.getClassid()%>"> <%=mdpClass.getDescription()%> </option>
  110. <%
  111. }
  112. %>
  113. </select>
  114. </td>
  115. <td width="20%" align="center"><input name="button" type="button" class="button2"
  116. style="cursor:hand" onClick="move(this.form.role1,this.form.role2);"
  117. value=" &gt;&gt; " />
  118. <br>
  119. <br>
  120. <input name="button" type="button" class="button2"
  121. style="cursor:hand" onClick="move(this.form.role2,this.form.role1);"
  122. value=" &lt;&lt; " />
  123. </td>
  124. <td width="40%" align="center" valign="middle"><select name="select" size="15" multiple class="SelectScroll" id="role2" style="width:80%">
  125. </select>
  126. </td>
  127. </tr>
  128. <tr class="TableBgColorBlack">
  129. <td colspan="3"><button id="save" dojoType="dijit.form.Button" onClick='console.log("clicked simple"),checkConfig();' type="button" iconClass="plusIcon">
  130. 生成配置
  131. </button>
  132. <span dojoType="dijit.Tooltip" connectId="save">生成配置</span>&nbsp;&nbsp;
  133. &nbsp;&nbsp; </td>
  134. </tr>
  135. </table>
  136. </td>
  137. </tr>
  138. </table>
  139. <!--验证信息放在这里 -->
  140. <div id="boxIdea" align="left" style="width:98%;height:98%;border:1px solid #999999;"></div>
  141. </div>
  142. </div>
  143. </div>
  144. </form>
  145. <script language="JavaScript">
  146. var indexOfCheck = 0;
  147. var role2=document.all.item("role2");
  148. function checkConfig() {
  149. indexOfCheck = 0
  150. var boxIdea=document.all.item("boxIdea");
  151. boxIdea.innerHTML = "";
  152. if(role2.options.length == 0){
  153. alert("请选则进行验证的表对象!");
  154. return;
  155. }
  156. var classid = role2.options[0].value;
  157. checkOneObj(classid)
  158. }
  159. function checkOneObj(classid){
  160. if(classid=="") return;
  161. createXMLHttpRequest();
  162. var strA = "";
  163. XMLHttpReq.open("POST","createExc.jsp?classid=" + classid,false);
  164. XMLHttpReq.setRequestHeader("Content-Length",strA.length);
  165. XMLHttpReq.setRequestHeader("Content-type","application/x-www-form-urlencoded");
  166. XMLHttpReq.send(strA);
  167. var boxIdea=document.all.item("boxIdea");
  168. boxIdea.innerHTML = boxIdea.innerHTML + XMLHttpReq.responseText;
  169. indexOfCheck = indexOfCheck + 1;
  170. if(indexOfCheck < role2.options.length){
  171. checkOneObj(role2.options[indexOfCheck].value);
  172. }else{
  173. return;
  174. }
  175. }
  176. // End -->
  177. </script>
  178. </BODY>
  179. </HTML>