Parcourir la source

Merge branch 'bzq1/fix_excel_history_data' of eta_server/eta_api into debug

baoziqiang il y a 4 mois
Parent
commit
b77b9e6eb4
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 8 0
      services/data/excel/mixed_table.go

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

@@ -1236,6 +1236,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