lixiaojun
2024-09-27 ce1cc10e518ddac71cfefd433f8a6af9fb46ed40
Desktop/HStation.Desktop.Xhs.Core/MainForm.cs
@@ -1,17 +1,16 @@
using DevExpress.CodeParser;
using DevExpress.Utils;
using DevExpress.XtraBars.Docking;
using DevExpress.XtraBars.Docking2010.Views;
using DevExpress.XtraBars.Navigation;
using DevExpress.XtraBars.Ribbon;
using DevExpress.XtraEditors;
using HStation.WinFrmUI;
using HStation.WinFrmUI.Assets;
using HStation.WinFrmUI.Auth.Core._02_User;
using HStation.WinFrmUI.Basic;
using HStation.WinFrmUI.Xhs.PumpProduct;
using System.IO;
using Yw.WinFrmUI;
using Yw.WinFrmUI.Page;
using static DevExpress.XtraPrinting.BarCode.DataBarExpandedPatternProcessor;
namespace HStation.Desktop
{
@@ -196,15 +195,18 @@
        }
        private Control _bimfaceMgrBeakCtrl = null;//bimface管理弹出界面
        private Control _SystemProductManageCtrl = null;//产品管理弹出界面
        //系统配置
        private void nbSystemConfig_ElementClick(object sender, NavElementEventArgs e)
        private Control _SystemSystemConfigCtrl = null;//系统配置弹出界面
        //产品管理
        private void nbProductManage_ElementClick(object sender, NavElementEventArgs e)
        {
            var pt = this.tileNavPane.PointToClient(MousePosition);
            var hitInfo = this.tileNavPane.CalcHitInfo(pt);
            if (hitInfo.ButtonInfo != null)
            {
                if (_SystemConfigBeakCtrl == null)
                if (_SystemProductManageCtrl == null)
                {
                    var peakItemList = new List<Yw.WinFrmUI.TilePeekItem>()
                    {
@@ -227,6 +229,136 @@
                            }
                        },
                        new TilePeekItem(){
                            Caption="阀门管理",
                            SvgImage=svgImg32Model[7],
                            SvgImageSize=new Size(24,24),
                            Click=()=>{
                                this.flyoutPanel1.HideBeakForm();
                                var guid=new PageGuid(){
                                    Modular="Asstes",
                                    MoudingType=eMoudingType.Tab,
                                    Function="ValveMgr",
                                };
                                if(!IsExistPage(guid,true))
                                {
                                    var page=new ValveManageMainPanel();
                                    CreatePage(page,guid);
                                }
                            }
                        },
                          new TilePeekItem(){
                            Caption="管道附件",
                            SvgImage=svgImg32Model[8],
                            SvgImageSize=new Size(24,24),
                            Click=()=>{
                                this.flyoutPanel1.HideBeakForm();
                                var guid=new PageGuid(){
                                    Modular="Asstes",
                                    MoudingType=eMoudingType.Tab,
                                    Function="AdaptingMgr",
                                };
                                if(!IsExistPage(guid,true))
                                {
                                    var page=new AdaptingManageMainPanel();
                                    CreatePage(page,guid);
                                }
                            }
                        },
                                new TilePeekItem(){
                            Caption="管道管理",
                            SvgImage=svgImg32Model[9],
                            SvgImageSize=new Size(24,24),
                            Click=()=>{
                                this.flyoutPanel1.HideBeakForm();
                                var guid=new PageGuid(){
                                    Modular="Asstes",
                                    MoudingType=eMoudingType.Tab,
                                    Function="PipeLineMgr",
                                };
                                if(!IsExistPage(guid,true))
                                {
                                    var page=new PipeLineManageMainPanel();
                                    CreatePage(page,guid);
                                }
                            }
                        }
                    };
                    _SystemProductManageCtrl = peakItemList.CreatePeekCtrl();
                }
                this.flyoutPanel1.Size = _SystemProductManageCtrl.Size;
                this.flyoutPanelControl1.Controls.Clear();
                this.flyoutPanelControl1.Controls.Add(_SystemProductManageCtrl);
                var rectangle = this.RectangleToScreen(hitInfo.ButtonInfo.Bounds);
                this.flyoutPanel1.ShowBeakForm(rectangle);
            }
        }
        //系统配置
        private void nbSystemConfig_ElementClick(object sender, NavElementEventArgs e)
        {
            var pt = this.tileNavPane.PointToClient(MousePosition);
            var hitInfo = this.tileNavPane.CalcHitInfo(pt);
            if (hitInfo.ButtonInfo != null)
            {
                if (_SystemSystemConfigCtrl == null)
                {
                    var peakItemList = new List<Yw.WinFrmUI.TilePeekItem>()
                    {
                        new TilePeekItem(){
                            Caption="角色管理",
                            SvgImage=svgImg32Model[3],
                            SvgImageSize=new Size(24,24),
                            Click=()=>{
                                this.flyoutPanel1.HideBeakForm();
                                var guid=new PageGuid(){
                                    Modular="Auth",
                                    MoudingType=eMoudingType.Tab,
                                    Function="UserManageMgr",
                                };
                                if(!IsExistPage(guid,true))
                                {
                                    var page=new UserMgrMainPanel();
                                    CreatePage(page,guid);
                                }
                            }
                        },
                        new TilePeekItem(){
                            Caption="用户管理",
                            SvgImage=svgImg32Model[7],
                            SvgImageSize=new Size(24,24),
                            Click=()=>{
                                this.flyoutPanel1.HideBeakForm();
                                var guid=new PageGuid(){
                                    Modular="Auth",
                                    MoudingType=eMoudingType.Tab,
                                    Function="ValveMgr",
                                };
                                if(!IsExistPage(guid,true))
                                {
                                    var page=new ValveManageMainPanel();
                                    CreatePage(page,guid);
                                }
                            }
                        },
                        new TilePeekItem(){
                            Caption="菜单管理",
                            SvgImage=svgImg32Model[2],
                            SvgImageSize=new Size(24,24),
                            Click=()=>{
                                this.flyoutPanel1.HideBeakForm();
                                var guid=new PageGuid(){
                                    Modular="Auth",
                                    MoudingType=eMoudingType.Tab,
                                    Function="TypeMgr",
                                };
                                if(!IsExistPage(guid,true))
                                {
                                    var page=new SysTypeManageMainPanel();
                                    CreatePage(page,guid);
                                }
                            }
                        },
                             new TilePeekItem(){
                            Caption="类型管理",
                            SvgImage=svgImg32Model[4],
                            SvgImageSize=new Size(24,24),
@@ -278,19 +410,35 @@
                                    CreatePage(page,guid);
                                }
                            }
                         }
                    };
                    _SystemConfigBeakCtrl = peakItemList.CreatePeekCtrl();
                         },
                        new TilePeekItem(){
                            Caption="字典类型",
                            SvgImage=svgImg32Model[1],
                            SvgImageSize=new Size(24,24),
                            Click=()=>{
                                this.flyoutPanel1.HideBeakForm();
                                var guid=new PageGuid(){
                                    Modular="Dict",
                                    MoudingType=eMoudingType.Tab,
                                    Function="DictMgr",
                                };
                                if(!IsExistPage(guid,true))
                                {
                                    var page=new HStation.WinFrmUI.Dict.DictManageMainPanel();
                                    CreatePage(page,guid);
                                }
                            }
                        },
                     };
                    _SystemSystemConfigCtrl = peakItemList.CreatePeekCtrl();
                }
                this.flyoutPanel1.Size = _SystemConfigBeakCtrl.Size;
                this.flyoutPanel1.Size = _SystemSystemConfigCtrl.Size;
                this.flyoutPanelControl1.Controls.Clear();
                this.flyoutPanelControl1.Controls.Add(_SystemConfigBeakCtrl);
                this.flyoutPanelControl1.Controls.Add(_SystemSystemConfigCtrl);
                var rectangle = this.RectangleToScreen(hitInfo.ButtonInfo.Bounds);
                this.flyoutPanel1.ShowBeakForm(rectangle);
            }
        }
        private Control _SystemConfigBeakCtrl = null;//系统配置弹出界面
        #endregion TileNavPane 相关处理
@@ -365,6 +513,11 @@
        //添加
        private void tabbedView1_DocumentAdded(object sender, DocumentEventArgs e)
        {
            if (this.tabbedView1.Documents.Count > 1)
            {
                this.navBtnPrevious.Visible = true;
                this.navBtnNext.Visible = true;
            }
        }
        //激活
@@ -373,6 +526,8 @@
            var page = e.Document.Control as DocumentPage;
            if (page == null)
                return;
            this.navBtnCurrent.ImageOptions.SvgImage = page.PageTitle.HeaderSvgImage;
            this.navBtnCurrent.Caption = page.PageTitle.Caption;
        }
        //关闭 此时控件已经为空
@@ -653,7 +808,7 @@
            //    }
            //}
            //this.docPnlFuncList.Text = modular.ToString();
            //this.funcTreeListCtrl1.SetBindingData(modular, surfaceGuid);
            //this.funcTreeListCtrl1.SetMatching(modular, surfaceGuid);
            //if (surfaceGuid == null)
            //{
            //    var func = this.funcTreeListCtrl1.SetDefault();
@@ -663,5 +818,15 @@
        }
        #endregion Modular
        private void navBtnPrevious_ElementClick(object sender, NavElementEventArgs e)
        {
            this.tabbedView1.Controller.SelectNextTab(false);
        }
        private void navBtnNext_ElementClick(object sender, NavElementEventArgs e)
        {
            this.tabbedView1.Controller.SelectNextTab(true);
        }
    }
}