duheng
2024-09-27 0e54c48e8190937f5b483c79e3cc9d17ec7c9af0
WinFrmUI/HStation.WinFrmUI.Xhs.Core/01-home/HomeXhsProjectPage.cs
@@ -1,4 +1,6 @@
using DevExpress.Utils.Svg;
using HStation.Vmo;
using HStation.WinFrmUI.Assets;
using HStation.WinFrmUI.Xhs.PumpProduct;
using Yw.WinFrmUI.Page;
@@ -24,8 +26,7 @@
            public SvgImage Image { get; set; }
        }
        private Lazy<BLL.XhsProjectStd> _bllProjectStd = new(() => new BLL.XhsProjectStd());
        private List<XhsProjectStdDto> _allProjectList = null;
        private List<XhsProjectVmo> _allProjectList = null;
        private Lazy<BLL.PumpMain> _bllPump = new(() => new BLL.PumpMain());
@@ -41,8 +42,9 @@
        private async void SetBindingData()
        {
            _allProjectList = await _bllProjectStd.Value.GetAll();
            _allProjectList = await BLLFactory<HStation.BLL.XhsProject>.Instance.GetAll();
            var allPump = await _bllPump.Value.GetAll();
            var allValveList = await new BLL.ValveMain().GetAll();
            var vm = new CurrentViewModel()
            {
                Name = "项目数量",
@@ -60,11 +62,17 @@
            var vm3 = new CurrentViewModel()
            {
                Name = "阀门型号数量",
                Count = 0,
                Count = allValveList?.Count ?? 0,
                Image = ImageLib.Valve
            };
            var vm4 = new CurrentViewModel()
            {
                Name = "冷却塔数量",
                Count = 0,
                Image = ImageLib.CoolingTower
            };
            var list = new List<CurrentViewModel>() { vm, vm2, vm3 };
            var list = new List<CurrentViewModel>() { vm, vm2, vm3, vm4 };
            this.gridControl1.DataSource = list;
            this.gridControl1.RefreshDataSource();
        }
@@ -75,7 +83,7 @@
        public override async void RefreshData()
        {
            base.RefreshData();
            _allProjectList = await _bllProjectStd.Value.GetAll();
            _allProjectList = await BLLFactory<HStation.BLL.XhsProject>.Instance.GetAll();
            await this.mapViewProjectListContainer1.SetProjectList(_allProjectList);
            this.homeXhsProjectTreeListCtrl1.SetBindingData(_allProjectList);
            SetBindingData();
@@ -89,7 +97,7 @@
        }
        //选择项目事件
        private async void homeXhsProjectTreeListCtrl1_SelectProjectEvent(XhsProjectStdDto obj)
        private async void homeXhsProjectTreeListCtrl1_SelectProjectEvent(XhsProjectVmo obj)
        {
            await this.mapViewProjectListContainer1.SelectProject(obj.ID);
            var vm = new HomeXhsProjectPropertyViewModel(obj);
@@ -103,9 +111,9 @@
        }
        //跳转事件
        private async void homeXhsProjectPropertyCtrl1_JumpDirectEvent(XhsProjectStdDto obj)
        private async void homeXhsProjectPropertyCtrl1_JumpDirectEvent(long PrjID)
        {
            var bimfacefile = await BimfaceFileStateHelper.IsHaveBimFace(obj.ID);
            var bimfacefile = await BimfaceFileStateHelper.IsHaveBimFace(PrjID);
            if (bimfacefile == null)
            {
                if (!MessageBoxHelper.IsClickOk("当前项目未上传文件,是否前去上传模型文件?"))
@@ -131,13 +139,16 @@
                    Modular = Yw.WinFrmUI.PageModular.Bimface,
                    MoudingType = Yw.WinFrmUI.Page.eMoudingType.Tab,
                    Function = Yw.WinFrmUI.PageFunction.ViewBimface3d,
                    TagName = $"{obj.ID}"
                    TagName = $"{PrjID}"
                };
                if (!IsExistPage(guid, true))
                {
                    var page = new XhsSchemeMultiMgrPage();
                    await page.SetBindingData(obj.ID);
                    // var page = new XhsSchemeMultiMgrPage();
                    // await page.SetMatching(obj.ID);
                    var page = new XhsProjectSimulationMgrPage();
                    await page.SetBindingData(PrjID);
                    //var page = new XhsProjectSimulationMgrPage();
                    CreatePage(page, guid);
                }
@@ -176,7 +187,7 @@
                    {
                        Modular = "Xhs",
                        MoudingType = eMoudingType.Tab,
                        Function = "PumpMgr",
                        Function = "pumpMgr",
                    };
                    if (!IsExistPage(pumpGuid, true))
                    {
@@ -186,8 +197,47 @@
                    break;
                case "阀门型号数量":
                    var valveGuid = new PageGuid()
                    {
                        Modular = "Xhs",
                        MoudingType = eMoudingType.Tab,
                        Function = "ValveMgr",
                    };
                    if (!IsExistPage(valveGuid, true))
                    {
                        var page = new ValveManageMainPanel();
                        CreatePage(page, valveGuid);
                    }
                    break;
            }
        }
        private void layoutView1_MouseMove(object sender, MouseEventArgs e)
        {
            var info = layoutView1.CalcHitInfo(e.X, e.Y);
            if (info.Column == null)
                return;
            if (info.Column.Caption == "名称")
            {
                Cursor.Current = Cursors.Help;
            }
            else
            {
            }
        }
        private void layoutView1_MouseEnter(object sender, EventArgs e)
        {
            var info = layoutView1.CalcHitInfo(Cursor.Position.X, Cursor.Position.Y);
            if (info.Column != null && info.Column.Caption == "名称")
            {
                Cursor.Current = Cursors.Help;
            }
        }
        private void layoutView1_MouseLeave(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.Default;
        }
    }
}