|
@@ -1763,12 +1763,30 @@ func GetTableDataByMixedTableData(config [][]request.MixedTableCellDataReq, hide
|
|
|
}
|
|
|
showFormatValue := fmt.Sprintf("%v", cell.ShowFormatValue)
|
|
|
tmp.Monitor = showFormatValue
|
|
|
+ // 如果没有showValue, 则使用value
|
|
|
+ if cell.ShowValue == "" {
|
|
|
+ _, err := strconv.ParseFloat(cell.Value, 64)
|
|
|
+ if err == nil {
|
|
|
+ cell.ShowValue = cell.Value
|
|
|
+ }
|
|
|
+ }
|
|
|
_, err := strconv.ParseFloat(cell.Value, 64)
|
|
|
if err == nil {
|
|
|
hasPercent := false
|
|
|
if styleConfig.Nt == "percent" {
|
|
|
hasPercent = true
|
|
|
}
|
|
|
+ // 修复历史数据
|
|
|
+ if styleConfig.Pn != 0 {
|
|
|
+ if styleConfig.Decimal == nil {
|
|
|
+ styleConfig.Decimal = new(int)
|
|
|
+ }
|
|
|
+ *styleConfig.Decimal += styleConfig.Pn
|
|
|
+ if *styleConfig.Decimal < 0 {
|
|
|
+ *styleConfig.Decimal = 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if styleConfig.Decimal != nil {
|
|
|
tmp.Monitor = utils.RoundNumber(cell.ShowValue, *styleConfig.Decimal, hasPercent)
|
|
|
} else {
|