update.jsp 7.7 KB

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