liuxiaolong
2019-05-09 0d1d88cdb668e75ea8609417ac18ae19947e9525
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
    <title>机构管理</title>
    <meta name="decorator" content="default"/>
    <%@include file="/webpage/include/treeview.jsp" %>
    <style type="text/css">
        .ztree {overflow:auto;margin:0;_margin-top:10px;padding:10px 0 0 10px;}
    </style>
    <script type="text/javascript">
        function refresh(){//刷新
            
            window.location="${ctx}/sys/office/";
        }
    </script>
</head>
<body class="gray-bg">
    
    <div class="wrapper wrapper-content">
    <div class="ibox">
    <div class="ibox-content">
    <sys:message content="${message}"/>
    <div id="content" class="row">
        <div id="left" style="background-color:#e7eaec" class="col-sm-1">
            <a onclick="refresh()" class="pull-right">
                <i class="fa fa-refresh"></i>
            </a>
            <div id="ztree" class="ztree"></div>
        </div>
        <div id="right"  class="col-sm-11  animated fadeInRight">
            <iframe id="officeContent" name="officeContent" src="${ctx}/sys/office/list?id=&parentIds=" width="100%" height="91%" frameborder="0"></iframe>
        </div>
    </div>
    </div>
    </div>
    </div>
    <script type="text/javascript">
        var setting = {data:{simpleData:{enable:true,idKey:"id",pIdKey:"pId",rootPId:'0'}},
            callback:{onClick:function(event, treeId, treeNode){
                    var id = treeNode.pId == '0' ? '' :treeNode.pId;
                    $('#officeContent').attr("src","${ctx}/sys/office/list?id="+id+"&parentIds="+treeNode.pIds);
                }
            }
        };
        
        function refreshTree(){
            $.getJSON("${ctx}/sys/office/treeData",function(data){
                $.fn.zTree.init($("#ztree"), setting, data).expandAll(true);
            });
        }
        refreshTree();
         
        var leftWidth = 180; // 左侧窗口大小
        var htmlObj = $("html"), mainObj = $("#main");
        var frameObj = $("#left, #openClose, #right, #right iframe");
        function wSize(){
            var strs = getWindowSize().toString().split(",");
            htmlObj.css({"overflow-x":"hidden", "overflow-y":"hidden"});
            mainObj.css("width","auto");
            frameObj.height(strs[0] - 120);
            var leftWidth = ($("#left").width() < 0 ? 0 : $("#left").width());
            $("#right").width($("#content").width()- leftWidth - $("#openClose").width() -60);
            $(".ztree").width(leftWidth - 10).height(frameObj.height() - 46);
        }
    </script>
    <script src="${ctxStatic}/common/wsize.min.js" type="text/javascript"></script>
</body>
</html>