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 = [];