choose.jsp 7.0 KB

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