<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="WorkFlow.CPManager.Index" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>产品主页</title>
    <link href="../FlowPage/css/main.css" rel="stylesheet" type="text/css" />
    <link href="../FlowPage/css/ext-all.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .add
        {
            background-image: url(../images/arrow_refresh.png) !important;
        }
        .hg
        {
            height: 20px;
            padding-top: 3px;
        }
        .workflow-node
        {
            background-image: url(../FlowPage/images/workflow.gif) !important;
        }
        .workflow-folder
        {
            background-image: url(../FlowPage/images/folder.gif) !important;
        }
    </style>

    <script type="text/javascript">
        var addTab = function (tabPanel, id, url,name) {
            var tab = tabPanel.getComponent(id);
            if (!tab) {
                tab = tabPanel.add({ 
                    id       : id, 
                    tbar: [{ text: "刷新",
                        handler: function ()
                        {
                            Ext.getCmp(id).reload(true)
                        },
                        iconCls:'add'　//加载图标
                    }],
                    title    : name, 
                    closable : true,   
                                                  
                    autoLoad : {
                        showMask : true, 
                        scripts:true ,
                        url      : url,
                        mode     : "iframe",
                        maskMsg  : "<span style='font-size:12px'>加载页面中...</span>"
                    }
                 
                });

                tab.on("tabonchange", function () {
                    var item = MenuPanel1.menu.items.get(id + "_item");
                    if (item) {
                        MenuPanel1.setSelection(item);
                    } 
                    Ext.getCmp(id).reload(true);//刷新页面
                }, this);
            }            
            tabPanel.setActiveTab(tab);
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" DirectMethodNamespace="DirectMethod">
    </ext:ResourceManager>
    <ext:Viewport ID="Viewport1" runat="server" Layout="border">
        <Items>
            <ext:Panel ID="Panel6" runat="server" Collapsible="true" Layout="FitLayout" Region="West"
                Split="true" Title="导航栏" Width="165">
                <Items>
                    <ext:TreePanel ID="TreePanel1" runat="server" Title="" Lines="False">
                        <Root>
                        </Root>
                    </ext:TreePanel>
                </Items>
            </ext:Panel>
            <ext:Panel ID="PDepartment" runat="server" Layout="Fit" Region="Center" Title="">
                <Items>
                    <ext:FitLayout ID="FitLayout1" runat="server">
                        <Items>
                            <ext:TabPanel ID="TabPanel1" runat="server" BodyBorder="false" Border="false" EnableTabScroll="true"
                                AutoScroll="true">
                                <Plugins>
                                    <ext:TabCloseMenu ID="TabCloseMenu1" CloseAllTabsText="关闭全部标签" CloseOtherTabsText="关闭其他标签"
                                        CloseTabText="关闭当前标签" runat="server">
                                    </ext:TabCloseMenu>
                                </Plugins>
                            </ext:TabPanel>
                        </Items>
                    </ext:FitLayout>
                </Items>
            </ext:Panel>
        </Items>
    </ext:Viewport>
    </form>
</body>
</html>
