lixiaojun
2024-09-11 ec0d0b6f8e3ac7791c736ae8aad69c4a1587cad9
WinFrmUI/HStation.WinFrmUI.Xhs.Core/01-home/HomeXhsProjectPage.cs
@@ -1,4 +1,5 @@
using DevExpress.Utils.Svg;
using HStation.Vmo;
using HStation.WinFrmUI.Xhs.PumpProduct;
using Yw.WinFrmUI.Page;
@@ -13,7 +14,6 @@
            this.PageTitle.HeaderSvgImage = this.svgImg32[0];
            this.PageTitle.SvgImageSize = new Size(24, 24);
            this.PageTitle.AllowClose = false;
            this.repPicEdit.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Zoom;
        }
@@ -25,8 +25,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());
@@ -35,7 +34,14 @@
        /// </summary>
        public override async void InitialDataSource()
        {
            _allProjectList = await _bllProjectStd.Value.GetAll();
            SetBindingData();
            this.mapViewProjectListContainer1.LoadCompletedEvent += MapViewProjectListContainer1_LoadCompletedEvent;
            await this.mapViewProjectListContainer1.InitialContainer();
        }
        private async void SetBindingData()
        {
            _allProjectList = await BLLFactory<HStation.BLL.XhsProject>.Instance.GetAll();
            var allPump = await _bllPump.Value.GetAll();
            var vm = new CurrentViewModel()
            {
@@ -57,13 +63,16 @@
                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();
            this.mapViewProjectListContainer1.LoadCompletedEvent += MapViewProjectListContainer1_LoadCompletedEvent;
            await this.mapViewProjectListContainer1.InitialContainer();
        }
        /// <summary>
@@ -72,9 +81,10 @@
        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();
        }
        //地图加载完成
@@ -85,7 +95,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);
@@ -99,7 +109,7 @@
        }
        //跳转事件
        private async void homeXhsProjectPropertyCtrl1_JumpDirectEvent(XhsProjectStdDto obj)
        private async void homeXhsProjectPropertyCtrl1_JumpDirectEvent(XhsProjectVmo obj)
        {
            var bimfacefile = await BimfaceFileStateHelper.IsHaveBimFace(obj.ID);
            if (bimfacefile == null)
@@ -132,7 +142,10 @@
                if (!IsExistPage(guid, true))
                {
                    var page = new XhsSchemeMultiMgrPage();
                    // var page = new XhsSchemeMultiMgrPage();
                    // await page.SetBindingData(obj.ID);
                    var page = new XhsProjectSimulationMgrPage();
                    await page.SetBindingData(obj.ID);
                    //var page = new XhsProjectSimulationMgrPage();
                    CreatePage(page, guid);
@@ -185,5 +198,33 @@
                    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;
        }
    }
}