【新增】让Map类型支持纵向填充。

main
Carson 2022-03-26 03:37:48 +08:00
parent 71185c4f3d
commit 9886bd1222
1 changed files with 25 additions and 2 deletions

View File

@ -257,10 +257,33 @@ namespace Luban.Job.Cfg.DataConverts
} }
public int Accept(DMap data, TType type, Title x) public int Accept(DMap data, TType type, Title x)
{
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"))); SetTitleValue(x, data.Apply(ToExcelStringVisitor.Ins, type.GetTag("sep")));
return 1; return 1;
} }
}
public int Accept(DVector2 data, TType type, Title x) public int Accept(DVector2 data, TType type, Title x)
{ {