enhance(meter):调整输出的表计档案模板中的单元格内容格式。
This commit is contained in:
parent
23e9e2ec4d
commit
7c6f211931
|
@ -96,6 +96,26 @@ func (g *MeterArchiveExcelTemplateGenerator) WriteTemplateData(buildings []*mode
|
||||||
return fmt.Errorf("未能设定标题行高度,%w", err)
|
return fmt.Errorf("未能设定标题行高度,%w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dateTimeExp := "yyyy-mm-dd hh:mm;@"
|
||||||
|
dateTimeColStyle, err := g.file.NewStyle(&excelize.Style{
|
||||||
|
CustomNumFmt: &dateTimeExp,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
g.log.Error("未能创建日期时间格式。", zap.Error(err))
|
||||||
|
return fmt.Errorf("未能创建日期时间格式,%w", err)
|
||||||
|
}
|
||||||
|
g.file.SetCellStyle(defaultSheet, "I2", "I1048576", dateTimeColStyle)
|
||||||
|
|
||||||
|
numExp := "0.0000;@"
|
||||||
|
numColStyle, err := g.file.NewStyle(&excelize.Style{
|
||||||
|
CustomNumFmt: &numExp,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
g.log.Error("未能创建抄表数字格式。", zap.Error(err))
|
||||||
|
return fmt.Errorf("未能创建抄表数字格式,%w", err)
|
||||||
|
}
|
||||||
|
g.file.SetCellStyle(defaultSheet, "J2", "N1048576", numColStyle)
|
||||||
|
|
||||||
meterInstallationTypeValidation := excelize.NewDataValidation(false)
|
meterInstallationTypeValidation := excelize.NewDataValidation(false)
|
||||||
meterInstallationTypeValidation.SetDropList([]string{"商户表", "公共表", "楼道表"})
|
meterInstallationTypeValidation.SetDropList([]string{"商户表", "公共表", "楼道表"})
|
||||||
meterInstallationTypeValidation.Sqref = "D2:D1048576"
|
meterInstallationTypeValidation.Sqref = "D2:D1048576"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user