Browse Source

fix:修复表格异常数据

zqbao 5 tháng trước cách đây
mục cha
commit
0d63451172
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      services/excel/lucky_sheet.go

+ 7 - 0
services/excel/lucky_sheet.go

@@ -1224,6 +1224,13 @@ func GetTableDataByMixedTableData(config [][]request.MixedTableCellDataReq, hide
 						tmp.FontColor = styleConfig.Color
 					}
 					tmp.Monitor = cell.ShowFormatValue
+					// 如果没有showValue, 则使用value
+					if cell.ShowValue == "" {
+						_, err := strconv.ParseFloat(cell.Value, 64)
+						if err == nil {
+							cell.ShowValue = cell.Value
+						}
+					}
 					_, err := strconv.ParseFloat(cell.ShowValue, 64)
 					if err == nil {
 						hasPercent := false