|
@@ -160,12 +160,6 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
|
|
|
for k, row := range config {
|
|
|
for i, cell := range row {
|
|
|
switch cell.DataType {
|
|
|
- case request.DateDT: // 日期类型
|
|
|
- calculateCellMap[cell.Uid] = Cell{
|
|
|
- Column: k,
|
|
|
- Row: i,
|
|
|
- CellInfo: cell,
|
|
|
- }
|
|
|
case request.EdbDT: // 指标类型
|
|
|
if cell.Value == `` {
|
|
|
if edbInfo, ok := edbInfoMap[cell.EdbInfoId]; ok {
|
|
@@ -243,7 +237,7 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
|
|
|
}
|
|
|
}
|
|
|
cellKeyVal[cell.Uid] = finalVal
|
|
|
- cell.ShowValue = utils.FormatTableDataShowValue(dateValList[tmpLenData-1].Value)
|
|
|
+ cell.ShowValue = utils.FormatTableDataShowValue(finalVal)
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -282,12 +276,6 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- calculateCellMap[cell.Uid] = Cell{
|
|
|
- Column: k,
|
|
|
- Row: i,
|
|
|
- CellInfo: cell,
|
|
|
- }
|
|
|
case request.CustomTextDT: //自定义文本
|
|
|
if cell.Value == `` {
|
|
|
continue
|
|
@@ -297,21 +285,9 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
|
|
|
if tmpErr == nil {
|
|
|
tmpVal, _ := tmpDeci.Float64()
|
|
|
cellKeyVal[cell.Uid] = tmpVal
|
|
|
-
|
|
|
- calculateCellMap[cell.Uid] = Cell{
|
|
|
- Column: k,
|
|
|
- Row: i,
|
|
|
- CellInfo: cell,
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
case request.FormulateCalculateDataDT: // 公式计算(A+B这种)
|
|
|
- calculateCellMap[cell.Uid] = Cell{
|
|
|
- Column: k,
|
|
|
- Row: i,
|
|
|
- CellInfo: cell,
|
|
|
- }
|
|
|
-
|
|
|
calculateChainList = append(calculateChainList, cell.Uid)
|
|
|
|
|
|
case request.InsertEdbCalculateDataDT: // 插入指标系统计算公式生成的值
|
|
@@ -408,12 +384,6 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
|
|
|
cellKeyVal[cell.Uid] = val
|
|
|
cell.ShowValue = utils.FormatTableDataShowValue(val)
|
|
|
case request.DateCalculateDataDT: //日期计算
|
|
|
- // 把关联的单元格存在数组里
|
|
|
- calculateCellMap[cell.Uid] = Cell{
|
|
|
- Column: k,
|
|
|
- Row: i,
|
|
|
- CellInfo: cell,
|
|
|
- }
|
|
|
dateCalculateList = append(dateCalculateList, cell.Uid)
|
|
|
// 遍历数组,根据公式进行计算,并将得到的结果放到对应的单元格中
|
|
|
}
|
|
@@ -425,13 +395,13 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
|
|
|
// 处理指定指标的日期
|
|
|
for k, row := range config {
|
|
|
for i, cell := range row {
|
|
|
+ calculateCellMap[cell.Uid] = Cell{
|
|
|
+ Column: k,
|
|
|
+ Row: i,
|
|
|
+ CellInfo: cell,
|
|
|
+ }
|
|
|
cell.ShowFormatValue = cell.ShowValue
|
|
|
if cell.ShowStyle != `` {
|
|
|
- calculateCellMap[cell.Uid] = Cell{
|
|
|
- Column: k,
|
|
|
- Row: i,
|
|
|
- CellInfo: cell,
|
|
|
- }
|
|
|
showStyleList = append(showStyleList, cell.Uid)
|
|
|
}
|
|
|
row[i] = cell
|