From 9886bd122215ff773ca0ca7f48ca05f2682241a6 Mon Sep 17 00:00:00 2001 From: Carson <396098651@qq.com> Date: Sat, 26 Mar 2022 03:37:48 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91=E8=AE=A9Ma?= =?UTF-8?q?p=E7=B1=BB=E5=9E=8B=E6=94=AF=E6=8C=81=E7=BA=B5=E5=90=91?= =?UTF-8?q?=E5=A1=AB=E5=85=85=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Source/DataConverts/FillSheetVisitor.cs | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/Luban.Job.Cfg/Source/DataConverts/FillSheetVisitor.cs b/src/Luban.Job.Cfg/Source/DataConverts/FillSheetVisitor.cs index 007405c..6de7675 100644 --- a/src/Luban.Job.Cfg/Source/DataConverts/FillSheetVisitor.cs +++ b/src/Luban.Job.Cfg/Source/DataConverts/FillSheetVisitor.cs @@ -258,8 +258,31 @@ namespace Luban.Job.Cfg.DataConverts public int Accept(DMap data, TType type, Title x) { - SetTitleValue(x, data.Apply(ToExcelStringVisitor.Ins, type.GetTag("sep"))); - return 1; + if (x.SelfMultiRows) + { + int oldStartRow = _startRowIndex; + int totalRow = 0; + try + { + var elementType = data.Type.ElementType; + foreach (var ele in data.Datas) + { + int row = Math.Max(ele.Key.Apply(this, elementType, x), ele.Value.Apply(this, elementType, x)); + totalRow += row; + _startRowIndex = oldStartRow + totalRow; + } + return totalRow; + } + finally + { + _startRowIndex = oldStartRow; + } + } + else + { + SetTitleValue(x, data.Apply(ToExcelStringVisitor.Ins, type.GetTag("sep"))); + return 1; + } } public int Accept(DVector2 data, TType type, Title x)