duheng
2025-03-27 d2ccacb3317aa6310f1b1bb5eb19fbdecba39ff9
WinFrmUI/HStation.WinFrmUI.Xhs.Core/01-home/02-map/MapViewProjectListContainer.cs
@@ -1,4 +1,6 @@
namespace HStation.WinFrmUI
using DevExpress.Mvvm.Native;
namespace HStation.WinFrmUI
{
    public partial class MapViewProjectListContainer : UserControl, IMapViewProjectListContainer
    {
@@ -8,8 +10,14 @@
        }
        public event Action LoadCompletedEvent;
        public event Action LoadFailedEvent;
        public event Action<HandingError> HandingErrorEvent;
        public event Action<string> JumpSimulationEvent;
        public event Action<long> JumpDirectEvent;
        /// <summary>
        /// 交互对象
@@ -25,6 +33,7 @@
                return _callBackObj;
            }
        }
        private MapViewProjectListCallBackObj _callBackObj;
        /// <summary>
@@ -37,13 +46,8 @@
                return _isInitialized;
            }
        }
        private bool _isInitialized;
        /// <summary>
        /// 显示边框
        /// </summary>
        [Browsable(true)]
        public bool ShowBoder { get; set; }
        private bool _isInitialized;
        /// <summary>
        /// 初始话容器
@@ -54,7 +58,17 @@
            callBackObj.LoadCompletedEvent += CallBackObj_LoadCompletedEvent;
            callBackObj.LoadFailedEvent += CallBackObj_LoadFailedEvent;
            callBackObj.HandingErrorEvent += CallBackObj_HandingErrorEvent;
            callBackObj.JumpSimulationEvent += CallBackObj_JumpSimulationEvent;
            await this.webViewControl1.InitialWebBrower(MapViewProjectListUrlHelper.GetUrl(), callBackObj, true);
        }
        //跳转方案
        private void CallBackObj_JumpSimulationEvent(string obj)
        {
            if (long.TryParse(obj, out long PrjID))
            {
                JumpDirectEvent.Invoke(PrjID);
            }
        }
        //加载完成
@@ -79,14 +93,14 @@
        /// <summary>
        /// 设置项目列表
        /// </summary>
        public async Task<bool> SetProjectList(List<XhsProjectStdDto> allProjectList)
        public async Task<bool> SetProjectList(List<XhsProjectVmo> allProjectList)
        {
            if (!_isInitialized)
            {
                return false;
            }
            var allProjectIds = allProjectList?.Select(x => x.ID).Distinct().ToList();
            var allMapInfoList = await new Yw.BLL.MapInfoStd().GetByObjectTypeAndObjectIdsOfKindPurpose
            var allMapInfoList = await new Yw.BLL.MapInfo().GetByObjectTypeAndObjectIdsOfKindPurpose
                (HStation.Xhs.DataType.XhsProject, allProjectIds, Yw.Map.Kind.Gaodei, Yw.Map.Purpose.Location);
            var vmList = new List<MapProjectViewModel>();
            if (allMapInfoList != null && allMapInfoList.Count > 0)
@@ -117,15 +131,5 @@
        {
            return await this.webViewControl1.EvaluateScriptAsync<bool>("cancelSelectProject()");
        }
        //绘制边框
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            if (this.ShowBoder)
            {
                this.DrawBorder(e, Color.LightGray);
            }
        }
    }
}
}