parent
042c525f2e
commit
4308db1a83
|
|
@ -99,7 +99,7 @@ luban相较于常规的excel导表工具有以下核心优势:
|
|||
- 其他所有支持js的引擎和平台
|
||||
- 扩展工具
|
||||
- Excel2TextDiff。将excel转成文本后再diff,清晰对比excel版本之间内容变化。
|
||||
- **[开发中,马上...]LubanAssistant**,Luban的Excel插件。支持把json、lua、xml等文本格式的配置数据加载到excel中,批量编辑处理,最后再保存回原文件,较好地解决大型项目中多人合作数据编辑冲突合并的问题,较好解决在编辑器中制作的配置难以在excel中批量修改的问题。
|
||||
- **LubanAssistant**,Luban的Excel插件。支持把json、lua、xml等文本格式的配置数据加载到excel中,批量编辑处理,最后再保存回原文件,较好地解决大型项目中多人合作数据编辑冲突合并的问题,较好解决在编辑器中制作的配置难以在excel中批量修改的问题。
|
||||
|
||||
|
||||
## 增强的excel格式
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ namespace Luban.Job.Cfg.DataCreators
|
|||
{
|
||||
return null;
|
||||
}
|
||||
if (CheckIsDefault(type.IsNullable, d) && field?.DefalutDtypeValue != null)
|
||||
if (CheckIsDefault(x.NamedMode, d) && field?.DefalutDtypeValue != null)
|
||||
{
|
||||
return field?.DefalutDtypeValue;
|
||||
}
|
||||
|
|
@ -346,7 +346,12 @@ namespace Luban.Job.Cfg.DataCreators
|
|||
{
|
||||
throw new InvalidExcelDataException("excel string类型在标题头对应模式下必须正好占据一个单元格");
|
||||
}
|
||||
var s = ParseString(x.Read(x.NamedMode));
|
||||
var d = x.Read(x.NamedMode);
|
||||
if (CheckIsDefault(x.NamedMode, d) && field?.DefalutDtypeValue != null)
|
||||
{
|
||||
return field.DefalutDtypeValue;
|
||||
}
|
||||
var s = ParseString(d);
|
||||
if (s == null)
|
||||
{
|
||||
if (type.IsNullable)
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ namespace Luban.Job.Cfg.DataCreators
|
|||
}
|
||||
else
|
||||
{
|
||||
list.Add(f.CType.Apply(ExcelDataCreator.Ins, null, row.GetMultiRowStream(f.Name, sep, f.IsRowOrient), (DefAssembly)bean.AssemblyBase));
|
||||
list.Add(f.CType.Apply(ExcelDataCreator.Ins, f, row.GetMultiRowStream(f.Name, sep, f.IsRowOrient), (DefAssembly)bean.AssemblyBase));
|
||||
}
|
||||
}
|
||||
catch (DataCreateException dce)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,19 @@ namespace Luban.Job.Cfg.DataSources.Excel
|
|||
|
||||
private System.Text.Encoding DetectCsvEncoding(Stream fs)
|
||||
{
|
||||
return System.Text.Encoding.Default;
|
||||
Ude.CharsetDetector cdet = new Ude.CharsetDetector();
|
||||
cdet.Feed(fs);
|
||||
cdet.DataEnd();
|
||||
fs.Seek(0, SeekOrigin.Begin);
|
||||
if (cdet.Charset != null)
|
||||
{
|
||||
s_logger.Debug("Charset: {}, confidence: {}", cdet.Charset, cdet.Confidence);
|
||||
return System.Text.Encoding.GetEncoding(cdet.Charset) ?? System.Text.Encoding.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
return System.Text.Encoding.Default;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Load(string rawUrl, string sheetName, Stream stream)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.8.0" />
|
||||
<PackageReference Include="Scriban" Version="4.0.1" />
|
||||
<PackageReference Include="Scriban" Version="4.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -158,6 +158,9 @@
|
|||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Ude.NetStandard, Version=1.0.2.0, Culture=neutral, PublicKeyToken=103cb45fc06c90e4, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Ude.NetStandard.1.2.0\lib\net45\Ude.NetStandard.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\YamlDotNet.11.2.1\lib\net45\YamlDotNet.dll</HintPath>
|
||||
</Reference>
|
||||
|
|
|
|||
|
|
@ -13,5 +13,6 @@
|
|||
<package id="System.Text.Json" version="5.0.2" targetFramework="net472" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
|
||||
<package id="Ude.NetStandard" version="1.2.0" targetFramework="net472" />
|
||||
<package id="YamlDotNet" version="11.2.1" targetFramework="net472" />
|
||||
</packages>
|
||||
Loading…
Reference in New Issue