commit
c146cf6031
|
|
@ -258,8 +258,31 @@ namespace Luban.Job.Cfg.DataConverts
|
||||||
|
|
||||||
public int Accept(DMap data, TType type, Title x)
|
public int Accept(DMap data, TType type, Title x)
|
||||||
{
|
{
|
||||||
SetTitleValue(x, data.Apply(ToExcelStringVisitor.Ins, type.GetTag("sep")));
|
if (x.SelfMultiRows)
|
||||||
return 1;
|
{
|
||||||
|
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)
|
public int Accept(DVector2 data, TType type, Title x)
|
||||||
|
|
|
||||||
|
|
@ -443,7 +443,8 @@ namespace Luban.Job.Cfg.Defs
|
||||||
{
|
{
|
||||||
var source = new ExcelDataSource();
|
var source = new ExcelDataSource();
|
||||||
var bytes = await this.Agent.GetFromCacheOrReadAllBytesAsync(file.ActualFile, file.MD5);
|
var bytes = await this.Agent.GetFromCacheOrReadAllBytesAsync(file.ActualFile, file.MD5);
|
||||||
var records = DataLoaderUtil.LoadCfgRecords(tableRecordType, file.OriginFile, null, bytes, true);
|
(var actualFile, var sheetName) = FileUtil.SplitFileAndSheetName(FileUtil.Standardize(file.OriginFile));
|
||||||
|
var records = DataLoaderUtil.LoadCfgRecords(tableRecordType, actualFile, sheetName, bytes, true);
|
||||||
foreach (var r in records)
|
foreach (var r in records)
|
||||||
{
|
{
|
||||||
DBean data = r.Data;
|
DBean data = r.Data;
|
||||||
|
|
@ -541,7 +542,8 @@ namespace Luban.Job.Cfg.Defs
|
||||||
{
|
{
|
||||||
var source = new ExcelDataSource();
|
var source = new ExcelDataSource();
|
||||||
var bytes = await this.Agent.GetFromCacheOrReadAllBytesAsync(file.ActualFile, file.MD5);
|
var bytes = await this.Agent.GetFromCacheOrReadAllBytesAsync(file.ActualFile, file.MD5);
|
||||||
var records = DataLoaderUtil.LoadCfgRecords(tableRecordType, file.OriginFile, null, bytes, true);
|
(var actualFile, var sheetName) = FileUtil.SplitFileAndSheetName(FileUtil.Standardize(file.OriginFile));
|
||||||
|
var records = DataLoaderUtil.LoadCfgRecords(tableRecordType, actualFile, sheetName, bytes, true);
|
||||||
|
|
||||||
foreach (var r in records)
|
foreach (var r in records)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue