diff --git a/src/Luban.Job.Cfg/Source/DataConverts/TitleCreator.cs b/src/Luban.Job.Cfg/Source/DataConverts/TitleCreator.cs index 58b71a9..751ca78 100644 --- a/src/Luban.Job.Cfg/Source/DataConverts/TitleCreator.cs +++ b/src/Luban.Job.Cfg/Source/DataConverts/TitleCreator.cs @@ -247,26 +247,17 @@ namespace Luban.Job.Cfg.DataConverts public void Accept(TArray type, Title title, int column) { - if (!type.ElementType.Apply(IsNotSepTypeVisitor.Ins)) - { - title.Tags.TryAdd("sep", "|"); - } + title.Tags.TryAdd("sep", "|"); } public void Accept(TList type, Title title, int column) { - if (!type.ElementType.Apply(IsNotSepTypeVisitor.Ins)) - { - title.Tags.TryAdd("sep", "|"); - } + title.Tags.TryAdd("sep", "|"); } public void Accept(TSet type, Title title, int column) { - if (!type.ElementType.Apply(IsNotSepTypeVisitor.Ins)) - { - title.Tags.TryAdd("sep", "|"); - } + title.Tags.TryAdd("sep", "|"); } public void Accept(TMap type, Title title, int column) diff --git a/src/Luban.Job.Cfg/Source/DataConverts/ToExcelStringVisitor.cs b/src/Luban.Job.Cfg/Source/DataConverts/ToExcelStringVisitor.cs index 006dd25..7d10ef5 100644 --- a/src/Luban.Job.Cfg/Source/DataConverts/ToExcelStringVisitor.cs +++ b/src/Luban.Job.Cfg/Source/DataConverts/ToExcelStringVisitor.cs @@ -139,7 +139,7 @@ namespace Luban.Job.Cfg.DataConverts { if (string.IsNullOrEmpty(sep)) { - sep = type.Type.ElementType.Apply(IsNotSepTypeVisitor.Ins) ? ";" : "|"; + sep = "|"; } return string.Join(sep, type.Datas.Select(d => d.Apply(this, sep))); } @@ -148,7 +148,7 @@ namespace Luban.Job.Cfg.DataConverts { if (string.IsNullOrEmpty(sep)) { - sep = type.Type.ElementType.Apply(IsNotSepTypeVisitor.Ins) ? ";" : "|"; + sep = "|"; } return string.Join(sep, type.Datas.Select(d => d.Apply(this, sep))); } @@ -157,7 +157,7 @@ namespace Luban.Job.Cfg.DataConverts { if (string.IsNullOrEmpty(sep)) { - sep = type.Type.ElementType.Apply(IsNotSepTypeVisitor.Ins) ? ";" : "|"; + sep = "|"; } return string.Join(sep, type.Datas.Select(d => d.Apply(this, sep))); } diff --git a/src/Luban.Job.Cfg/Source/DataCreators/ExcelStreamDataCreator.cs b/src/Luban.Job.Cfg/Source/DataCreators/ExcelStreamDataCreator.cs index 543e819..8adaa78 100644 --- a/src/Luban.Job.Cfg/Source/DataCreators/ExcelStreamDataCreator.cs +++ b/src/Luban.Job.Cfg/Source/DataCreators/ExcelStreamDataCreator.cs @@ -360,19 +360,6 @@ namespace Luban.Job.Cfg.DataCreators return list; } - //public static ExcelStream SepIfNeed(TType type, ExcelStream stream) - //{ - // string sep = DataUtil.GetSep(type); - // if (!string.IsNullOrEmpty(sep)) - // { - // return new ExcelStream(stream.ReadCell(), sep); - // } - // else - // { - // return stream; - // } - //} - public DType Accept(TBean type, ExcelStream x) { var originBean = (DefBean)type.Bean; @@ -420,11 +407,6 @@ namespace Luban.Job.Cfg.DataCreators private static ExcelStream TrySep(TType type, ExcelStream stream) { string sep = type.GetTag("sep"); - if (string.IsNullOrEmpty(sep) && type.ElementType != null && type.ElementType.Apply(IsNotSepTypeVisitor.Ins)) - { - // 如果是array,list,set,并且它们的elementType不包含',;|',则自动添加sep分割。这是一个方便策划的优化 - return stream.CreateAutoSepStream(DataUtil.SimpleContainerSep); - } if (!string.IsNullOrEmpty(sep) && !stream.TryReadEOF()) { diff --git a/src/Luban.Job.Cfg/Source/TypeVisitors/IsNotSepTypeVisitor.cs b/src/Luban.Job.Cfg/Source/TypeVisitors/IsNotSepTypeVisitor.cs index 9c17dcd..0e16d60 100644 --- a/src/Luban.Job.Cfg/Source/TypeVisitors/IsNotSepTypeVisitor.cs +++ b/src/Luban.Job.Cfg/Source/TypeVisitors/IsNotSepTypeVisitor.cs @@ -5,8 +5,7 @@ namespace Luban.Job.Cfg.TypeVisitors { class IsNotSepTypeVisitor : AllTrueVisitor { - public static IsNotSepTypeVisitor Ins { get; } = new IsNotSepTypeVisitor(); - + //public static IsNotSepTypeVisitor Ins { get; } = new IsNotSepTypeVisitor(); public override bool Accept(TString type) { diff --git a/src/Luban.Job.Cfg/Source/Utils/DataUtil.cs b/src/Luban.Job.Cfg/Source/Utils/DataUtil.cs index 8df212f..af15d54 100644 --- a/src/Luban.Job.Cfg/Source/Utils/DataUtil.cs +++ b/src/Luban.Job.Cfg/Source/Utils/DataUtil.cs @@ -146,7 +146,7 @@ namespace Luban.Job.Cfg.Utils return rec.Tags != null && rec.Tags.Count > 0 && rec.Tags.Contains(TAG_UNCHECKED); } - public const string SimpleContainerSep = ",;|"; + //public const string SimpleContainerSep = ",;|"; public static string GetBeanSep(TBean type) { @@ -157,17 +157,6 @@ namespace Luban.Job.Cfg.Utils return ((DefBean)type.Bean).Sep; } - public static string GetCollectionElementTypeSep(TType type) - { - if (type.Tags != null && type.Tags.TryGetValue("sep", out var s) && !string.IsNullOrWhiteSpace(s)) - { - return s; - } - - return type.Apply(IsNotSepTypeVisitor.Ins) ? SimpleContainerSep : ""; - - } - public static bool IsCollectionEqual(List a, List b) { if (a.Count == b.Count)