From c2b56fc9401718620dd2a280557b8c716e4ad05a Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期一, 23 十二月 2024 17:49:41 +0800
Subject: [PATCH] 整体优化

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/08-working/XhsProjectSimulationWorkingPage.cs |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/08-working/XhsProjectSimulationWorkingPage.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/08-working/XhsProjectSimulationWorkingPage.cs
index 3604348..5188be6 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/08-working/XhsProjectSimulationWorkingPage.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/08-working/XhsProjectSimulationWorkingPage.cs
@@ -587,10 +587,30 @@
 
         #region 涓�閿樉闅�
 
+        private List<string> _allDecoratorCodes = null;
+        //鑾峰彇瑁呴グ浠禼ode鍒楄〃
+        private async Task<List<string>> GetDecoratorCodes()
+        {
+            if (_hydroInfo == null)
+            {
+                return default;
+            }
+            if (_allDecoratorCodes != null)
+            {
+                return default;
+            }
+            _allDecoratorCodes = await BLLFactory<Yw.BLL.HydroDecoratorInfo>.Instance.GetCodeListByModelID(_hydroInfo.ID, null);
+            if (_allDecoratorCodes == null)
+            {
+                _allDecoratorCodes = new List<string>();
+            }
+            return _allDecoratorCodes;
+        }
+
         //璁剧疆瑁呴グ浠跺彲瑙佹��
         private async void SetDecoratorVisible(bool isDecoratorVisible)
         {
-            var codes = _hydroInfo.Decorators?.Select(x => x.Code).Distinct().ToList();
+            var codes = await GetDecoratorCodes();
             if (isDecoratorVisible)
             {
                 await _bimfaceCtrl?.ShowComponents(codes);

--
Gitblit v1.9.3