|
@@ -153,10 +153,11 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
|
|
|
calculateCellMap := make(map[string]Cell)
|
|
|
calculateChainList := make([]string, 0)
|
|
|
dateCalculateList := make([]string, 0)
|
|
|
+ showStyleList := make([]string, 0)
|
|
|
+
|
|
|
// 处理单元格中的数据类型(除去基础计算,因为这个是依赖于其他)
|
|
|
for k, row := range config {
|
|
|
for i, cell := range row {
|
|
|
- cell.RealValue = cell.RealValue
|
|
|
switch cell.DataType {
|
|
|
case request.DateDT: // 日期类型
|
|
|
calculateCellMap[cell.Uid] = Cell{
|
|
@@ -411,7 +412,14 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
|
|
|
dateCalculateList = append(dateCalculateList, cell.Uid)
|
|
|
// 遍历数组,根据公式进行计算,并将得到的结果放到对应的单元格中
|
|
|
}
|
|
|
-
|
|
|
+ if cell.ShowValue != `` {
|
|
|
+ calculateCellMap[cell.Uid] = Cell{
|
|
|
+ Column: k,
|
|
|
+ Row: i,
|
|
|
+ CellInfo: cell,
|
|
|
+ }
|
|
|
+ showStyleList = append(showStyleList, cell.Uid)
|
|
|
+ }
|
|
|
row[i] = cell
|
|
|
}
|
|
|
config[k] = row
|
|
@@ -455,6 +463,12 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ // 格式化展示
|
|
|
+ config, err, errMsg = handleMixCellShowStyle(showStyleList, calculateCellMap, config)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
newMixedTableCellDataList = config
|
|
|
|
|
|
return
|
|
@@ -1189,7 +1203,7 @@ func handleMixCellShowStyle(showStyleList []string, calculateCellMap map[string]
|
|
|
if styleConf.NumberStyle.IsPercent == 1 {
|
|
|
val = changeToPercent(cell.ShowStyle)
|
|
|
}
|
|
|
- cell.ShowValue = val
|
|
|
+ cell.ShowFormatValue = val
|
|
|
config[cellPosition.Column][cellPosition.Row] = cell
|
|
|
}
|
|
|
}
|