From 707cf928ee05aa1bc0a985f9cbfee315521b5707 Mon Sep 17 00:00:00 2001 From: lihanbo Date: Thu, 23 Jan 2025 09:09:29 +0800 Subject: [PATCH] =?UTF-8?q?105040=20Update=20=E7=8B=AC=E7=AB=8B=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E9=A1=B9=E7=9B=AE=E5=90=8D=E7=A7=B0=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModel/LectotypeViewModel.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/LectotypeViewModel.cs b/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/LectotypeViewModel.cs index 60f325c..6a5d939 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/LectotypeViewModel.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/LectotypeViewModel.cs @@ -176,7 +176,7 @@ public class LectotypeViewModel(string docId) : INotifyPropertyChanged } var designer = FlexProject.CurrentProject.GetDesigners().FirstOrDefault(designer => designer.ID == docId); // 获取项目名 - DocName = designer.Name.Split('+').FirstOrDefault(); + DocName = GetDocName(designer); LectotypeManager.CURRENT_DOC_NAME = DocName; LectotypeManager.CURRENT_DOC_CREATE_TIME = new DateTimeOffset(designer.CreatedDateDateTime).ToUnixTimeMilliseconds().ToString(); @@ -256,6 +256,18 @@ public class LectotypeViewModel(string docId) : INotifyPropertyChanged } } + public string GetDocName(FlexDesigner designer) + { + var docName = designer.Name; + if(docName.Contains("+")) + { + return docName.Split('+').FirstOrDefault(); + } + else + { + return docName; + } + } public List StuffData(List cables) { List datas = [];