<%@ Page Language="C#" AutoEventWireup="true" CodeFile="XReport.aspx.cs" Inherits="System_XReport_XReport" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="../../Scripts/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../../Scripts/asyncbox/asyncbox.v1.5.beta.min.js"></script>
    <script type="text/javascript" src="../../Scripts/WebSite.js"></script>
    <link href="../../Styles/WebSite.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        html, body {
            width:100%;
            height:100%;
        }

    </style>
</head>
<body onload="search()">
    <script type="text/javascript">
        var category = "";
        function search() {
            var fb = document.getElementById("frame_box");
            var url = "XReport_Box.aspx?module_code=" + category;
            fb.src = url;
        }
        function select_all_auth() {
            var fb = document.getElementById("frame_box");
            var cw = fb.contentWindow;
            cw.select_all_checkbox();
        }
        function save() {
            if (category == "") {
                AlertNO("请先选择模块!");return;
            }
            var fb = document.getElementById("frame_box");
            var cw = fb.contentWindow;
            var s = cw.document.getElementsByName("chk");
            var val="";
            for(var i=0;i<s.length;i++){
                if (s[i].checked) {
                    val += s[i].value + ",";
                }
            }
            if(val != ""){
                val = val.substring(0,val.length-1);
            }
            
            ShowLoadingMask(); //显示遮罩
            $.ajax({
                type: "POST",
                contentType: "application/json",
                url: "../XReport/XReport_Service.asmx/Save",
                data: "{type:'" + type + "',module:'" + category + "',id:" + id + ",val:'" + val + "'}",
                dataType: 'json',
                success: function (result) {
                    var r = result.d;
                    if (r == "success") {
                        AlertOK('保存成功!');
                        //search();
                    } else {
                        AlertNO(r);
                    }
                    HideLoadingMask(); //关闭遮罩
                }
            });
        }
    </script>
    <div style="width:1000px;height:100%">
        <iframe id="frame_tree" frameborder="0" style="width:180px;height:97%" src="XReport_Tree.aspx"></iframe>
        <iframe id="frame_box" frameborder="0" style="width:810px;height:97%"></iframe>
    </div>
</body>
</html>
