From b62a2f5ad99995ec01da71b9f93be7284023171b Mon Sep 17 00:00:00 2001
From: chr <chr@chr.com>
Date: 星期二, 20 八月 2024 11:29:13 +0800
Subject: [PATCH] 优化插件;

---
 PdmSwPlugin.PDM/Model/PdmControlModel.cs |   34 +++++++++++++++++++++++++++++++++-
 1 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/PdmSwPlugin.PDM/Model/PdmControlModel.cs b/PdmSwPlugin.PDM/Model/PdmControlModel.cs
index 5f154ab..7a71c9c 100644
--- a/PdmSwPlugin.PDM/Model/PdmControlModel.cs
+++ b/PdmSwPlugin.PDM/Model/PdmControlModel.cs
@@ -13,6 +13,27 @@
 {
     public partial class PdmControlModel : NotifyBase
     {
+        private string _SelectedBomCount = "宸查�変腑 0 鏉�";
+
+        public string SelectedBomCount
+        {
+            get => _SelectedBomCount;
+            set
+            {
+                RaiseAndSetIfChanged(ref _SelectedBomCount, value);
+            }
+        }
+
+        private string _AllBomCount = "鍏� 0 鏉�";
+
+        public string AllBomCount
+        {
+            get => _AllBomCount;
+            set
+            {
+                RaiseAndSetIfChanged(ref _AllBomCount, value);
+            }
+        }
 
         public BomTreeReader bomTreeReader { get; private set; } = new BomTreeReader();
 
@@ -23,7 +44,17 @@
         public ObservableCollection<PdmBom> BomTree
         {
             get => _bomTree;
-            set => RaiseAndSetIfChanged(ref _bomTree, value);
+            set {
+                RaiseAndSetIfChanged(ref _bomTree, value);
+                int count = CacheList != null ? CacheList.Count : 0;
+                AllBomCount = $"鍏� {count} 鏉�";
+                RefreshSelectedBomCount();
+            }
+        }
+
+        public void RefreshSelectedBomCount() {
+            int count = CacheList != null ? CacheList.Where(e=>e.selected).Count() : 0;
+            SelectedBomCount = $"宸查�変腑 {count} 鏉�";
         }
 
         public List<PdmBom> CacheList => bomTreeReader?.CacheList.ToList();
@@ -167,6 +198,7 @@
                     drawInfos.Add(partModel, drawInfo);
                 }
                 bom.drawInfo = drawInfo;
+                bom.Init();
 
                 ICollection<PdmBom> children = bom.modules;
                 if (children != null && children.Count > 0)

--
Gitblit v1.9.1