105040 Update 独立获取项目名称的逻辑

This commit is contained in:
lihanbo 2025-01-23 09:09:29 +08:00
parent 7871cf01ff
commit 707cf928ee
1 changed files with 13 additions and 1 deletions

View File

@ -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<LectotypeLineModel> StuffData(List<LectotypeLineModel> cables)
{
List<LectotypeLineModel> datas = [];