xyxie 1 year ago
parent
commit
29dbb5bf9a
2 changed files with 12 additions and 6 deletions
  1. 6 6
      services/data/excel/mixed_table.go
  2. 6 0
      utils/common.go

+ 6 - 6
services/data/excel/mixed_table.go

@@ -205,7 +205,7 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
 					if val, ok2 := tmpDateValMap[relationDate]; ok2 {
 						//cell.ShowValue = fmt.Sprint(val)
 						cellKeyVal[cell.Uid] = val
-						cell.ShowValue = utils.FormatTableDataShowValue(val)
+						cell.ShowValue = utils.FormatMixTableDataShowValue(val)
 					}
 				} else {
 					// 如果不是取得一个关联的日期,那么就是指定日期
@@ -236,7 +236,7 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
 									}
 								}
 								cellKeyVal[cell.Uid] = finalVal
-								cell.ShowValue = utils.FormatTableDataShowValue(finalVal)
+								cell.ShowValue = utils.FormatMixTableDataShowValue(finalVal)
 							}
 						}
 					} else {
@@ -270,7 +270,7 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
 							if val, ok2 := tmpDateValMap[cell.DataTime]; ok2 {
 								//cell.ShowValue = fmt.Sprint(val)
 								cellKeyVal[cell.Uid] = val
-								cell.ShowValue = utils.FormatTableDataShowValue(val)
+								cell.ShowValue = utils.FormatMixTableDataShowValue(val)
 							}
 						}
 					}
@@ -381,7 +381,7 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
 				}
 				val := tmpDataMap[cellDateTime]
 				cellKeyVal[cell.Uid] = val
-				cell.ShowValue = utils.FormatTableDataShowValue(val)
+				cell.ShowValue = utils.FormatMixTableDataShowValue(val)
 			case request.DateCalculateDataDT: //日期计算
 				dateCalculateList = append(dateCalculateList, cell.Uid)
 				// 遍历数组,根据公式进行计算,并将得到的结果放到对应的单元格中
@@ -435,7 +435,7 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
 			}
 
 			cellKeyVal[cell.Uid] = val
-			cell.ShowValue = utils.FormatTableDataShowValue(val)
+			cell.ShowValue = utils.FormatMixTableDataShowValue(val)
 			config[cellPosition.Column][cellPosition.Row] = cell
 
 		}
@@ -1051,7 +1051,7 @@ func handlerDateCalculate(dateCalculateList []string, calculateCellMap map[strin
 				return
 			}
 
-			cell.ShowValue = utils.FormatTableDataShowValue(val)
+			cell.ShowValue = utils.FormatMixTableDataShowValue(val)
 			config[cellPosition.Column][cellPosition.Row] = cell
 		}
 	}

+ 6 - 0
utils/common.go

@@ -2093,6 +2093,12 @@ func GetPredictEdbDayListByNum(startDate time.Time, num int, frequency string) (
 	return
 }
 
+// FormatMixTableDataShowValue 格式化自定表格显示数据
+func FormatMixTableDataShowValue(x float64) (res string) {
+	res = fmt.Sprint(x)
+	return
+}
+
 // FormatTableDataShowValue 格式化自定表格显示数据
 func FormatTableDataShowValue(x float64) (res string) {
 	if x > 1 || x < -1 {