<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true"
    EnableViewState="false" CodeBehind="RolePermissionListView.aspx.cs" Inherits="PowerEasy.Module.General.WebSite.Admin.User.RolePermissionListView"
    Title="角色权限一览表" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CphNavigation" runat="server">
    <pe:ExtendedSiteMapPath ID="SmpNavigator" SiteMapProvider="AdminMapProvider" runat="server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CphContent" runat="server">
    <style type="text/css">
        .mouseover
        {
            background-color: #B0D0F3;
        }
    </style>
    <table width="100%" cellpadding="2" cellspacing="1" class="border">
        <tr align="center">
            <td colspan="2" class="spacingtitle">
                <b>角色权限一览表</b>
            </td>
        </tr>
    </table>
    <table id="PurView" width="100%" border="0" cellpadding="0" cellspacing="1" class="border tdbg">
        <pe:ExtendedLabel HtmlEncode="false" ID="lblPurview" Text="" runat="server">
        </pe:ExtendedLabel>
    </table>
    <script type="text/javascript">
        $(function () {
            var obj = null;
            //鼠标移上去后变色
            $("#PurView").find("tr").hover(function () {
                $(this).addClass("mouseover");
                obj = this;
            }, function () {
                $(this).removeClass("mouseover");
            });
            //点击前面的图标展开或缩进
            $("img").click(function () {
                var folder4 = '<%= BasePath%>admin/images/Node/tree_folder4.gif';
                var folder3 = '<%= BasePath%>admin/images/Node/tree_folder3.gif';
                var src = $(this).attr("src");
                if (src == folder3) {
                    $(this).attr("src", '<%= BasePath%>admin/images/Node/tree_folder4.gif');
                    $(this).attr("title", "Expand");
                }
                else {
                    $(this).attr("src", '<%= BasePath%>admin/images/Node/tree_folder3.gif');
                    $(this).attr("title", "Close");
                }
                var id = $(obj).attr("id");
                var expand = $(this).attr("title");
                var childId = id.split("_");
                var trs = $("tr");
                if (childId.length == 1) {
                    var idsArray = new Array();
                    var idsSplit = new Array();
                    for (var i = 0; i < trs.length; i++) {
                        idsArray = $(trs[i]).attr("id");
                        idsSplit = idsArray.split("_");
                        if (idsSplit.length > 1 && idsSplit[0] == childId[0]) {
                            var idCss = $("#" + idsArray).css('display');
                            if (idCss == 'table-row') {
                                $("#" + idsArray).css('display', 'none');
                                $("#" + idsArray).find("img").attr("src", '<%= BasePath%>admin/images/Node/tree_folder4.gif');
                            }
                            else {
                                if (expand == "Close") {
                                    $("#" + idsArray).css('display', 'table-row');
                                    $("#" + idsArray).find("img").attr("src", '<%= BasePath%>admin/images/Node/tree_folder3.gif');
                                }
                            }
                        }
                    }
                }
                if (childId.length == 2) {
                    var idsArray1 = new Array();
                    var idsSplit1 = new Array();
                    for (var j = 0; j < trs.length; j++) {
                        idsArray1 = $(trs[j]).attr("id");
                        idsSplit1 = idsArray1.split("_");
                        if (idsSplit1.length > 2 && idsSplit1[0] + "_" + idsSplit1[1] == id) {
                            var idCss3 = $("#" + idsArray1).css('display');
                            if (idCss3 == 'table-row') {
                                $("#" + idsArray1).css('display', 'none');
                                $("#" + idsArray1).find("img").attr("src", '<%= BasePath%>admin/images/Node/tree_folder4.gif');
                            }
                            else {
                                if (expand == "Close") {
                                    $("#" + idsArray1).css('display', 'table-row');
                                    $("#" + idsArray1).find("img").attr("src", '<%= BasePath%>admin/images/Node/tree_folder3.gif');
                                }
                            }
                        }
                    }
                }
                if (childId.length == 3) {
                    var idsArray2 = new Array();
                    var idsSplit2 = new Array();
                    for (var h = 0; h < trs.length; h++) {
                        idsArray2 = $(trs[h]).attr("id");
                        idsSplit2 = idsArray2.split("_");
                        if (idsSplit2.length > 3 && idsSplit2[0] + "_" + idsSplit2[1] + "_" + idsSplit2[2] == id) {
                            var idCss5 = $("#" + idsArray2).css('display');
                            if (idCss5 == 'table-row') {
                                $("#" + idsArray2).css('display', 'none');
                            }
                            else {
                                $("#" + idsArray2).css('display', 'table-row');
                            }
                        }
                    }
                }
            });
        })
       
    </script>
</asp:Content>
