Bladeren bron

fix:修复excel异常数据

zqbao 4 maanden geleden
bovenliggende
commit
9122210e5e
1 gewijzigde bestanden met toevoegingen van 8 en 0 verwijderingen
  1. 8 0
      services/data/excel/mixed_table.go

+ 8 - 0
services/data/excel/mixed_table.go

@@ -1192,6 +1192,14 @@ func handleMixCellShowStyle(showStyleList []string, calculateCellMap map[string]
 			// 	isPercent = true
 			// 	val = strings.Trim(val, "%")
 			// }
+			// 如果没有showValue, 则使用value
+			if cell.ShowValue == "" {
+				_, err := strconv.ParseFloat(cell.Value, 64)
+				if err == nil {
+					val = cell.Value
+					cell.ShowValue = cell.Value
+				}
+			}
 			_, e := strconv.ParseFloat(val, 64) // 将字符串转换成float类型
 			if e != nil {                       // 如果没有错误发生则返回true,说明该字符串是一个合法的数字
 				var styleConf request.MixCellShowStyle