NodeContent.jsp 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <%@ page pageEncoding="UTF-8"%>
  2. <%@ page contentType="text/html; charset=UTF-8" language="java"%>
  3. <%@ page language="java" import="model.setup.constant.Collection" %>
  4. <%@ page language="java"
  5. import="com.sysmodel.datamodel.xmlmodel.ModelFactory,
  6. com.sysmodel.datamodel.xmlmodel.DataContent,
  7. com.sysmodel.datamodel.xmlmodel.able.MdpConstant,
  8. com.sysmodel.datamodel.xmlmodel.able.Property,
  9. com.sysmodel.datamodel.xmlmodel.able.Template,
  10. com.sysmodel.datamodel.xmlmodel.impl.PropertyImpl,
  11. java.util.*"%>
  12. <%
  13. String nodeID = request.getParameter("nodeID")==null?"":(String)request.getParameter("nodeID") ;
  14. String codeName = request.getParameter("codeName")==null ? "TB_BM$_CONFIGURATION" : request.getParameter("codeName");
  15. Collection cs = new Collection(nodeID,codeName,request.getContextPath());
  16. String listHtml = cs.getChildNodeHTML();
  17. MdpConstant constant = null;
  18. constant = ModelFactory.getSysmodel().getMdpConstantByName(codeName);
  19. %>
  20. <html>
  21. <head>
  22. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  23. <SCRIPT language="JavaScript" src="../../../scripts/checkinput.js"></SCRIPT>
  24. <script>
  25. <%
  26. String refreshNode = request.getParameter("refreshNode")==null ? "" : (String)request.getParameter("refreshNode");
  27. if(!refreshNode.equals("")){
  28. %>
  29. var loadTip = "<div>数据装载中,请稍候...</div>";
  30. var treeImagePath = "../../../images/tree_images/";
  31. var url = "<%=request.getContextPath()%>/admin/setup/constantinit/tree/divTreeService.jsp?codeName=<%=codeName%>";
  32. var treeCloseImg = "plus.gif";
  33. var treeOpenImg = "minus.gif";
  34. parent.frames["constantTreeFrame"].refreshNode('<%=nodeID%>');
  35. <%
  36. }
  37. %>
  38. function submitAction(codeName,nodeID,cmd){
  39. form1.action = "../editExc.jsp?codeName="+codeName+"&nodeID="+nodeID+"&cmd="+cmd ;
  40. form1.submit();
  41. }
  42. function deleteChildList(codeName,nodeID,myParentID,cmd){
  43. form1.action = "editExc.jsp?codeName="+codeName+"&nodeID="+nodeID+"&cmd="+cmd+"&myParentID="+myParentID ;
  44. form1.submit();
  45. }
  46. function newChildNode(codeName,parentID){
  47. window.document.location="newChildNode.jsp?codeName="+codeName+"&parentID="+parentID;
  48. }
  49. function turnto(url){
  50. window.document.location= url;
  51. }
  52. function checkinput(){
  53. return true;
  54. }
  55. function saveTreeButton(codeName,nodeID,cmd){
  56. $('#consTree_save').form('submit',{
  57. url: 'editExc.jsp?codeName='+codeName+'&nodeID='+nodeID+'&cmd='+cmd,
  58. onSubmit: function(){
  59. return $(this).form('validate');
  60. },
  61. success: function(result){
  62. var result = eval('('+result+')');
  63. if (!result.success){
  64. $.messager.show({
  65. title: 'Error',
  66. msg: result.success
  67. });
  68. } else {
  69. $('#consTreeList').datagrid('reload'); // reload the user data
  70. }
  71. }
  72. });
  73. }
  74. function destroyTreeButton(codeName,nodeID,cmd){
  75. $.messager.confirm('常量删除','确定要删除常量吗?',
  76. function(r){
  77. if (r){
  78. $.post('editExc.jsp',{codeName:codeName,nodeID:nodeID,cmd:cmd},function(result){
  79. if (result.success){
  80. $('#consTreeList').datagrid('reload'); // reload the user data
  81. } else {
  82. $.messager.show({ // show error message
  83. title: 'Error',
  84. msg: result.errorMsg
  85. });
  86. }
  87. },'json');
  88. }
  89. });
  90. };
  91. </script>
  92. <link rel="stylesheet" href="../../../styles/css.css" type="text/css">
  93. <link rel="stylesheet" type="text/css" href="../../../../scripts/easyui/themes/default/easyui.css">
  94. <link rel="stylesheet" type="text/css" href="../../../../scripts/easyui/themes/icon.css">
  95. <link rel="stylesheet" type="text/css" href="../../../../scripts/easyui/themes/color.css">
  96. <link rel="stylesheet" type="text/css" href="../../../../scripts/easyui/demo/demo.css">
  97. <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script>
  98. <script type="text/javascript" src="../../../../scripts/easyui/jquery.easyui.min.js"></script>
  99. <script type="text/javascript" src="../../../../scripts/easyui/locale/easyui-lang-zh_CN.js"></script>
  100. </head>
  101. <body bgcolor="#FFFFFF" topmargin="0" leftmargin="0" >
  102. <div class="easyui-panel" title="<%=constant.getDescription()%>维护">
  103. <form name="form1" method="post" action="" id="consTree_save">
  104. <div style="padding:0px 0px 0px 0px">
  105. <%=cs.createDetailHTML()%>
  106. </div>
  107. <div style="text-align:center;padding:5px">
  108. <%if(!nodeID.equals("")){%>
  109. <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveTreeButton('<%=codeName%>','<%=nodeID%>','modify')">修改</a>
  110. <input name="button2" type="button" class="button" onClick="document.form1.reset();" value="重置" >
  111. <%if(cs.isTree()){%>
  112. <input name="button2" type="button" class="button" onClick="if(checkinput())newChildNode('<%=codeName%>','<%=nodeID%>')" value="新增" >
  113. <%}%>
  114. <%}
  115. if((listHtml.length())==0&&(!nodeID.equals(""))){%>
  116. <input name="button2" type="button" class="button" onClick="if(checkinput())submitAction('<%=codeName%>','<%=nodeID%>','delete')" value="删除" >
  117. <%}%>
  118. </div>
  119. </div>
  120. </form>
  121. <br>
  122. <%
  123. //增加此处用于功能常量表的维护
  124. if(codeName.equals("BM$_Menu")){
  125. %>
  126. <div id="total">
  127. <div class="whiteborder">
  128. <div class="titback">
  129. <div class="floatleft"><img src="../../../images/index/arrow1.gif" width="20" height="24" /></div>
  130. <div class="dropshadow">&nbsp;功能设置</div>
  131. <div class="clear"></div>
  132. <div style="color:#000000" align="center">
  133. <form name="fun" action="newFunction.jsp?codeName=<%=codeName%>" method="post">
  134. <input type="hidden" name="node_id" value="<%=nodeID%>">
  135. 功能编号:<input type="text" name="fun_code" size="15"> 功能名称:<input type="text" name="fun_name" size="15"> 功能类别:<select name="fun_type"><option value="button">按钮</option><option value="link">链接</option></select>&nbsp;<input type="button" value="修改"> &nbsp;<input type="submit" value="保存">
  136. </form>
  137. </div>
  138. </div>
  139. <div class="report">
  140. <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="DefTableStyles">
  141. <tr class="TableBgColorAsh">
  142. <td height="21" align="center">没有功能属性!</td>
  143. </tr>
  144. </table>
  145. </div>
  146. </div>
  147. </div>
  148. <br>
  149. <%
  150. }
  151. %>
  152. <%-- <div class="easyui-panel" title="下级节点信息" fit = "true" fitColumns="true">
  153. <div class="report">
  154. <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="datagrid-btable">
  155. <%if(listHtml.equals("")){%>
  156. <tr class="TableBgColorAsh">
  157. <td height="21" align="center">没有下级节点!</td>
  158. </tr>
  159. <%}else{
  160. out.print(listHtml);
  161. }%>
  162. </table>
  163. </div>
  164. </div> --%>
  165. <div class="report">
  166. <%
  167. List array_elements = null;
  168. //if(constant.isTree()){
  169. array_elements = constant.getChildDataContentByNodeID(nodeID);
  170. Iterator<DataContent> it = array_elements.iterator();
  171. Template template = constant.getTemplate();
  172. ArrayList<PropertyImpl> listProperty = (ArrayList<PropertyImpl>)template.getListproperty();
  173. Iterator<PropertyImpl> itField = listProperty.iterator();
  174. %>
  175. <div style="height:500px;">
  176. <table id="consTreeList" title="常量列表" class="easyui-datagrid"
  177. data-options="singleSelect:false,url:'json_data.jsp?nodeID=<%=nodeID %>&codeName=<%=codeName %>'"
  178. pagination="true"
  179. rownumbers="true"
  180. fit = "true"
  181. fitColumns="true">
  182. <thead>
  183. <tr>
  184. <%
  185. while (itField.hasNext()) {
  186. PropertyImpl property = itField.next();
  187. %>
  188. <th field="<%=property.getName() %>" width="50"><%=property.getDescription() %></th>
  189. <%} %>
  190. <th field="delete" width="50">删除</th>
  191. </tr>
  192. </thead>
  193. </table>
  194. </div>
  195. </div>
  196. <br>
  197. </body>
  198. </html>