sysCodegenShow.jsp 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <%@include file="/commons/include/html_doctype.html" %>
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <title>自定义表代码生成</title>
  8. <%@include file="/commons/include/form.jsp"%>
  9. <f:link href="tree/zTreeStyle.css"></f:link>
  10. <script type="text/javascript" src="${ctx}/js/tree/jquery.ztree.js"></script>
  11. <script type="text/javascript">
  12. var tableTree;
  13. var height;
  14. $(function() {
  15. $("#layout").ligerLayout({
  16. leftWidth : 250,
  17. height : '100%',
  18. allowLeftResize : false
  19. });
  20. height = $('#layout').height();
  21. loadTree("");
  22. $("#treeReFresh").click(function() {
  23. loadTree("");
  24. $("#viewFrame").attr("src","${ctx}/platform/system/sysCodegen/detail.ht");
  25. });
  26. $("#treeExpand").click(function() {
  27. tableTree.expandAll(true);
  28. });
  29. $("#treeCollapse").click(function() {
  30. tableTree.expandAll(false);
  31. });
  32. $("#treeSearch").click(function(){
  33. var subject=$("#subject").val();
  34. loadTree(subject);
  35. });
  36. });
  37. function loadTree(subject) {
  38. var setting = {
  39. data : {
  40. key : {
  41. name : "subject"
  42. },
  43. simpleData : {
  44. enable : true,
  45. idKey : "formDefId",
  46. rootPId : 1
  47. }
  48. },
  49. view : {
  50. selectedMulti : false
  51. },
  52. check:{
  53. enable: true,
  54. chkboxType: { "Y": "", "N": "" }
  55. },
  56. callback : {
  57. onClick : zTreeOnCheck,
  58. onCheck : zTreeOnCheck
  59. }
  60. };
  61. $.post(
  62. "${ctx}/platform/system/sysCodegen/getTableData.ht?subject="+subject,
  63. function(result) {
  64. for ( var i = 0; i < result.length; i++) {
  65. var node = result[i];
  66. if (node.isRoot!= 1) {
  67. if (node.isMain== 1) {
  68. node.icon ="${ctx}/styles/default/images/icon/prodia_call_activity.png";
  69. } else {
  70. node.icon = "${ctx}/styles/default/images/icon/icon-remark15X15.gif";
  71. }
  72. }
  73. }
  74. tableTree = $.fn.zTree.init($("#tableTree"), setting,result);
  75. tableTree.expandAll(true);
  76. });
  77. }
  78. var tempwait = false;
  79. function zTreeOnCheck(event, treeId, treeNode){
  80. if(tempwait) return;
  81. var flowName = $("#viewFrame").contents().find("#flowName").val();
  82. var defKey = $("#viewFrame").contents().find("#defKey").val();
  83. var defId = $("#viewFrame").contents().find("#defId").val();
  84. var baseDir = $("#viewFrame").contents().find("#baseDir").val();
  85. var system = $("#viewFrame").contents().find("#system").val();
  86. var url="${ctx}/platform/system/sysCodegen/detail.ht?flowName="+encodeURIComponent(flowName)
  87. +"&defKey="+encodeURIComponent(defKey)
  88. +"&defId="+encodeURIComponent(defId)
  89. +"&baseDir="+encodeURIComponent(baseDir)
  90. +"&system="+encodeURIComponent(system);
  91. tempwait = true;
  92. if(!$(event.srcElement).attr("class")||$(event.srcElement).attr("class").indexOf("button")==-1){
  93. tableTree.checkNode(treeNode, '', false, true);
  94. }
  95. $("#viewFrame").attr("src",url);
  96. window.setTimeout(function(){
  97. tempwait = false;
  98. },500);
  99. }
  100. </script>
  101. <style type="text/css">
  102. html,body{ padding:0px; margin:0; width:100%;height:100%;overflow: hidden;}
  103. </style>
  104. </head>
  105. <body>
  106. <div id="layout" style="bottom: 1; top: 1">
  107. <div position="left" title="自定义表单管理" id="TreeManage"
  108. style=" height: 95%; width: 100% !important;">
  109. <div style="width: 100%;">
  110. <input type="text" name="subject" id="subject" style="width:75%;"><a class="link search" id="treeSearch">查询</a>
  111. </div>
  112. <div class="tree-toolbar" id="pToolbar">
  113. <div class="toolBar"
  114. style="text-overflow: ellipsis; white-space: nowrap">
  115. <div class="group">
  116. <a class="link reload" id="treeReFresh" ></a>
  117. </div>
  118. <div class="l-bar-separator"></div>
  119. <div class="group">
  120. <a class="link expand" id="treeExpand" ></a>
  121. </div>
  122. <div class="l-bar-separator"></div>
  123. <div class="group">
  124. <a class="link collapse" id="treeCollapse" ></a>
  125. </div>
  126. </div>
  127. </div>
  128. <ul id="tableTree" class="ztree" style="overflow-x:hidden;clear:left;height: 88%" ></ul>
  129. </div>
  130. <div position="center" id="tableView" style="height: 100%;">
  131. <div class="l-layout-header" >代码配置</div>
  132. <iframe id="viewFrame" src="${ctx}/platform/system/sysCodegen/detail.ht" frameborder="0" width="100%"
  133. height="90%"></iframe>
  134. </div>
  135. </div>
  136. </body>
  137. </html>