Browse Source

fix:混合表格,公式计算结果,在点击保存后再次打开,计算结果为0

Roc 1 year ago
parent
commit
b63fdf25cd
1 changed files with 5 additions and 4 deletions
  1. 5 4
      services/data/excel/mixed_table.go

+ 5 - 4
services/data/excel/mixed_table.go

@@ -151,6 +151,10 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
 					cell.ShowValue = edbInfo.EdbName
 				}
 			case request.InsertDataDT, request.PopInsertDataDT: // 数据类型
+				// 数值先清空
+				cell.ShowValue = ``
+				//cell.Value = ``
+
 				// 日期关系配置不存在,则默认最新数据
 				if relationConf, ok := cellRelationConfMap[cell.Uid]; ok {
 					if relationConf.RelationDate.Key == `` {
@@ -164,10 +168,7 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
 						continue
 					}
 
-					// 确实是找到了这个关联日期的单元格,那么就先清空当前单元格的数据,通过日期重新获取数据值
-					cell.ShowValue = ``
-					cell.Value = ``
-
+					// 确实是找到了这个关联日期的单元格,那么通过日期重新获取数据值
 					tmpDateValMap := make(map[string]float64)
 					// 日度数据
 					if dateValMap, ok := edbDayDataListMap[cell.EdbInfoId]; ok {