setup.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="renderer" content="webkit|ie-comp|ie-stand">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  8. <meta http-equiv="Cache-Control" content="no-siteapp" />
  9. <script type="text/ecmascript" src="${ctx}/assets/lib/jquery/1.9.1/jquery.js"></script>
  10. <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/easyui/themes/gray/easyui.css" />
  11. <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/easyui/themes/icon.css" />
  12. <script type="text/ecmascript" src="${ctx}/assets/lib/easyui/jquery.easyui.min.js"></script>
  13. <script type="text/ecmascript" src="${ctx}/assets/lib/easyui/locale/easyui-lang-zh_CN.js"></script>
  14. <style type="text/css">
  15. .panel-header, .panel-body{border-color:#FCFCFC}
  16. .layout-split-west{border-right:none}
  17. </style>
  18. <script type="text/javascript">
  19. var $easy = $.noConflict(true);
  20. $easy(function(){
  21. $easy('#pageright').panel({
  22. onResize:function(width, height){
  23. // $("#jqGrid").setGridWidth(width-4); 
  24. }
  25. });
  26. })
  27. </script>
  28. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" >
  29. <script type="text/ecmascript" src="${ctx}/assets/lib/jquery/1.9.1/jquery.js"></script>
  30. <script type="text/javascript" src="${ctx}/assets/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
  31. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqueryui/jquery-ui.css" />
  32. <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqgrid/css/ui.jqgrid.css" />
  33. <script type="text/ecmascript" src="${ctx}/assets/lib/jqueryui/jquery-ui.js"></script>
  34. <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/i18n/grid.locale-cn.js"></script>
  35. <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/jquery.jqGrid.min.js"></script>
  36. <script type="text/javascript" src="${ctx}/assets/js/base.js"></script>
  37. <script type="text/javascript">
  38. //var currentOrgID = '${currentOrgID!}';
  39. var OrgTree = '${selfReport!}';
  40. var setting = {
  41. view: {
  42. dblClickExpand: false,
  43. showLine: false,
  44. selectedMulti: false
  45. },
  46. data: {
  47. simpleData: {
  48. enable:true,
  49. idKey: "id",
  50. pIdKey: "pId",
  51. rootPId: "-1"
  52. }
  53. },
  54. callback: {
  55. onClick: zTreeClick,
  56. beforeCollapse: function (treeId, treeNode) {return (treeNode.collapse !== false);},//禁止折叠,节点上需要“open:true,collapse:false”属性支持
  57. beforeExpand: function (treeId, treeNode) {return (treeNode.expand !== false);}//禁止展开,节点上需要“open:false,expand:false”属性支持
  58. }
  59. };
  60. //创建树型菜单
  61. function createTree(OrgTree){
  62. var zNodes = [{id:"0",pId:"-1",name:"自定义报表",url:'${ctx}/myconsole/complaint/report/setupTableAdd?TID=0',target:'contentFrame',open:true}];
  63. if(OrgTree == ""){
  64. return false;
  65. }
  66. var jsonorgtree = JSON.parse(OrgTree);
  67. jsonorgtree.forEach(function(item,index){
  68. var strTType = item.ttype;
  69. var strURL="";
  70. strUpperID = item.upperid;
  71. if (strTType=="table") {
  72. //输出此表的“维度、指标”分类
  73. strURL="${ctx}/myconsole/complaint/report/setfieldAdd?TID="+item.tid;
  74. var ttid=item.tid+"_field";
  75. zNodes.push({id:ttid,pId:item.tid,name:"维度数据",url:strURL,target:'contentFrame'});
  76. //输出此表的“指标”分类
  77. strURL="${ctx}/myconsole/complaint/report/settargetAdd?TID="+item.tid;
  78. ttid=item.tid+"_target";
  79. zNodes.push({id:ttid,pId:item.tid,name:"指标数据",url:strURL,target:'contentFrame'});
  80. strURL="${ctx}/myconsole/complaint/report/setupTableUpdate?TID="+item.tid;
  81. } else if (strTType=="target") {
  82. strURL="${ctx}/myconsole/complaint/report/settargetUpdate?TID="+item.tid;
  83. //strIcon=",icon:'../../ztree/style/charts.png'";
  84. strUpperID = item.upperid + "_target";
  85. } else {
  86. strURL="${ctx}/myconsole/complaint/report/setfieldUpdate?TID="+item.tid;
  87. //strIcon=",icon:'../../ztree/style/field.gif'";
  88. strUpperID = item.upperid + "_field";
  89. }
  90. zNodes.push({id:item.tid,pId:strUpperID,name:item.tname,url:strURL,target:'contentFrame'});
  91. })
  92. return zNodes;
  93. }
  94. //ztree的点击回调函数
  95. function zTreeClick(event, treeId, treeNode) {
  96. $('#contentFrame').attr('src','${ctx}/myconsole/'+treeNode.url);
  97. }
  98. $(document).ready(function(){
  99. var ztreeNode = $.fn.zTree.init($("#treeDemo"), setting,createTree(OrgTree));
  100. //DOM加载完成后,加载jqgrid
  101. })
  102. </script>
  103. <title>我的桌面</title>
  104. </head>
  105. <body>
  106. <div class="easyui-layout" data-options="fit:true">
  107. <div region="west" split="true" style="width:250px;height:100%;background-color:#f5f5f5">
  108. <ul id="treeDemo" class="ztree">
  109. </ul>
  110. </div>
  111. <div region="center" id="pageright">
  112. <div class="page-container">
  113. <iframe id="contentFrame" name="contentFrame" scrolling="no" frameborder="0" style="width:100%; height:750px;" src=""></iframe>
  114. </div>
  115. </div>
  116. </div>
  117. </body>
  118. </html>
  119. <script>
  120. function setGrid(OrgID,OrgName) {
  121. $("#jqGrid").jqGrid('setGridParam', {
  122. datatype : 'json',
  123. postData : {OrgID:currentOrgID}
  124. }).jqGrid('setCaption', OrgName).trigger("reloadGrid");
  125. }
  126. </script>