我的新博客

杂记

/// <reference path="../../custom/jquery.common.functions.js" />

$(document).ready(function () {
    WaferTreeHelper.Load();
});

var WaferTreeHelper = {
    Load: function () {
        /// <summary>加载页面函数</summary>
        WaferTreeHelper.Event.GetWaferSource();
        WaferTreeHelper.Event.InitalAssyDetailDialog();
        WaferTreeHelper.Event.InitalRDLBumpDetailDialog();
        WaferTreeHelper.Event.InitalWaferDetailDialog();


    },
    InitPage: {
        /// <summary>初始化页面</summary>
        InitWaferqtip: function (treeId) {
            /// <summary>初始化信息层</summary>

            var treeObj = $.fn.zTree.getZTreeObj(treeId);
            var nodes = treeObj.getNodes();
            for (var i = 0; i < nodes.length; i++) {
                id = nodes[i].tId;
                alert(id);
                if (Number(nodes[i].leval) == 0) {
                    $("#" + id).qtip({
                        content: $('#divWaferDetail'),
                        position: {
                            corner: {
                                target: 'topLeft',
                                tooltip: 'bottomLeft'
                            }
                        }
                    });
                }
                else if (Number(nodes[i].leval) == 1) {
                    alert(id);
                    $("#" + id).qtip({
                        content: $('#RDLBumpDetail'),
                        position: {
                            corner: {
                                target: 'topLeft',
                                tooltip: 'bottomLeft'
                            }
                        }
                    });
                }
                else {
                    $("#" + id).qtip({
                        content: $('#AssyDetail'),
                        position: {
                            corner: {
                                target: 'topLeft',
                                tooltip: 'bottomLeft'
                            }
                        }
                    });
                }
            }


        },
        InitRDLBumpqtip: function () {
            /// <summary>RDLBump的信息层</summary>
            //            $("#treeDemo").each(function () {//如何选择元素?????
            //                this.qtip({
            //                    content: $('#RDLBumpDetail'),
            //                    style: {
            //                        width: "300px",
            //                        height: "600px",
            //                        background: "black"
            //                    },
            //                    position: {
            //                        corner: {
            //                            target: 'topLeft',
            //                            tooltip: 'bottomLeft'
            //                        }
            //                    }
            //                });
            //            });
        },
        InitAssyqtip: function () {
            /// <summary>初始化Assy的信息层</summary>
        }


    },

    Event: {
        /// <summary>页面事件</summary>
        GetDeitailInfo: function (treeNode) {
            /// <summary>获取Wafer/RDLBump/Assy的详细信息</summary>

            var data = { Id: treeNode.id, oper: "" };
            var leval = treeNode.level; //获取节点所在层级
            if (Number(leval) == 0) {
                data.oper = "GetWaferDetail";
                WaferTreeHelper.Event.GetWaferInfo(data);


                //$("#divWaferDetail").dialog("open");

            }
            else if (Number(leval) == 1) {
                data.oper = "GetRDLBumpDetail";
                WaferTreeHelper.Event.GetRDLBumpInfo(data);
                WaferTreeHelper.InitPage.InitRDLBumpqtip();
                //$("#RDLBumpDetail").dialog("open");
            }
            else if (Number(leval) == 2) {
                data.oper = "GetAssyDetail";
                WaferTreeHelper.Event.GetAssyInfo(data);
                WaferTreeHelper.InitPage.InitAssyqtip();
                // $("#AssyDetail").dialog("open");
            }
            else {
                alert("No more Data!");
            }

        },
        GetWaferInfo: function (data) {
            /// <summary>获取Wafer的详细信息</summary>
            CommonHelper.Ajax.GetAjaxJson("/Handlers/Wafer/zTreeTestHandler.ashx", data, function (obj) {
                $('#labWaferName').text(obj.WaferName);
                $('#labWaferCode').text(obj.WaferCode);
                $('#labFoundry').text(obj.Foundry);
                $('#labFab').text(obj.Fab);
                $('#labPolyMetal').text(obj.PolyMetal);
                $('#labPolyGateMaterial').text(obj.PolyGateMaterial);
                $('#SPRDVersion').text(obj.SPRDVersion);
                $('#labGDPW').text(obj.GDPW);
                $('#labCreatedTime').text(obj.CreatedTime);
                $('#labTODate').text(obj.TODate);
                $('#labSubstrateType').text(obj.SubstrateType);

            });
        },
        GetRDLBumpInfo: function (data) {
            /// <summary>获取RDLBump的详细信息</summary>
            CommonHelper.Ajax.GetAjaxJson("/Handlers/Wafer/zTreeTestHandler.ashx", data, function (obj) {
                $('#labName').text(obj.Name);
                $('#WaferName').text(obj.WaferName);
                $('#labProject').text(obj.ProjectName);
                $('#labSPRDVersion').text(obj.SPRDVersion);
                $('#labRBFoundry').text(obj.Foundry);
                $('#labRBFab').text(obj.Fab);
                $('#labRBRDlSite').text(obj.RDlSite);
                $('#labRBBumpSite').text(obj.BumpSite);
                $('#labPIOption').text(obj.PIOption);
                $('#labRBCreatedTime').text(obj.CreatedTime);
            });
        },
        GetAssyInfo: function (data) {
            /// <summary>获取Assyd 的详细信息</summary>
            CommonHelper.Ajax.GetAjaxJson("/Handlers/Wafer/zTreeTestHandler.ashx", data, function (obj) {
                $('#labAssyName').text(obj.Name);
                $('#labDeviceName').text(obj.DeviceName);
                $('#labSubcon').text(obj.Subcon);
                $('#labCteateTime').text(obj.CteateTime);

            });
        },
        GetWaferSource: function () {
            /// <summary>获取Wafer/RDLBump数据源</summary>
            param = {
                oper: "getTree"
            };
            CommonHelper.Ajax.GetAjaxJson("/Handlers/Wafer/zTreeTestHandler.ashx", param, function (obj) {
                var setting = {  //配置
                    callback: {
                        onClick: function (event, treeId, treeNode, clickFlag) {

                            WaferTreeHelper.Event.GetDeitailInfo(treeNode);
                            WaferTreeHelper.InitPage.InitWaferqtip(treeId);

                        },
                        beforeClick: function (treeId, treeNode, clickFlag) {//点击节点前发生的事情
                            return true;
                        }
                    }
                };
                var zNodes = eval(obj); //数据源 
                $.fn.zTree.init($("#treeDemo"), setting, zNodes);
            });
        },

        GetEmployeeSource: function () {
            /// <summary>获取员工的数据源</summary>
            param = {
                oper: "getdata"
            };
            CommonHelper.Ajax.GetAjaxJson("/Handlers/Wafer/zTreeTestHandler.ashx", param, function (obj) {
                var setting = {  //配置
                    callback: {
                        onClick: function (event, treeId, treeNode, clickFlag) {//点击节点发生的事情
                            alert(treeNode.id);
                        },
                        beforeClick: function (treeId, treeNode, clickFlag) {//点击节点前发生的事情

                            return true;
                        }
                    }
                };
                var zNodes = eval(obj); //数据源 
                $.fn.zTree.init($("#treeDemo"), setting, zNodes);
            });
        },
        DateTimeChange: function (str) {
            /// <summary>时间格式转换</summary>
            var d = eval('new ' + str.substr(1, str.length - 2));
            var ar_date = [d.getFullYear(), d.getMonth() + 1, d.getDate()];
            for (var i = 0; i < ar_date.length; i++) ar_date[i] = dFormat(ar_date[i]);
            return ar_date.join('-');
            function dFormat(i) { return i < 10 ? "0" + i.toString() : i; }
        },
        InitalWaferDetailDialog: function () {
            /// <summary>初始化Wafer的详细信息的对话框</summary>
            $("#divWaferDetail").dialog({
                autoOpen: false,
                heigth: 300,
                width: 600,
                modal: true,
                buttons: {
                    "Close": function () {
                        $("#divWaferDetail").dialog("close");
                    }
                }
            });
        },
        InitalRDLBumpDetailDialog: function () {
            /// <summary>初始化RDLBump详细信息的对话框</summary>
            $("#RDLBumpDetail").dialog({
                autoOpen: false,
                heigth: 300,
                width: 600,
                modal: true,
                buttons: {
                    "Close": function () {
                        $("#RDLBumpDetail").dialog("close");
                    }
                }
            });
        },
        InitalAssyDetailDialog: function () {
            /// <summary>初始化Assy详细信息的对话框</summary>
            $("#AssyDetail").dialog({
                autoOpen: false,
                heigth: 300,
                width: 600,
                modal: true,
                buttons: {
                    "Close": function () {
                        $("#AssyDetail").dialog("close");
                    }
                }
            });

        }

    }
}

 

posted on 2016-05-23 10:11  无双2013abc  阅读(140)  评论(0编辑  收藏  举报