|
@@ -412,7 +412,16 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
|
|
|
dateCalculateList = append(dateCalculateList, cell.Uid)
|
|
|
// 遍历数组,根据公式进行计算,并将得到的结果放到对应的单元格中
|
|
|
}
|
|
|
- if cell.ShowValue != `` {
|
|
|
+ row[i] = cell
|
|
|
+ }
|
|
|
+ config[k] = row
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理指定指标的日期
|
|
|
+ for k, row := range config {
|
|
|
+ for i, cell := range row {
|
|
|
+ cell.ShowFormatValue = cell.ShowValue
|
|
|
+ if cell.ShowStyle != `` {
|
|
|
calculateCellMap[cell.Uid] = Cell{
|
|
|
Column: k,
|
|
|
Row: i,
|
|
@@ -421,6 +430,7 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
|
|
|
showStyleList = append(showStyleList, cell.Uid)
|
|
|
}
|
|
|
row[i] = cell
|
|
|
+ cellDataRelationMap[cell.Uid] = cell
|
|
|
}
|
|
|
config[k] = row
|
|
|
}
|
|
@@ -1184,11 +1194,11 @@ func handleMixCellShowStyle(showStyleList []string, calculateCellMap map[string]
|
|
|
}
|
|
|
|
|
|
cell := config[cellPosition.Column][cellPosition.Row]
|
|
|
- _, e := strconv.ParseFloat(cell.ShowStyle, 64) // 将字符串转换成float类型
|
|
|
+ _, e := strconv.ParseFloat(cell.ShowValue, 64) // 将字符串转换成float类型
|
|
|
if e != nil { // 如果没有错误发生则返回true,说明该字符串是一个合法的数字
|
|
|
continue
|
|
|
}
|
|
|
- val := cell.ShowStyle
|
|
|
+ val := cell.ShowValue
|
|
|
var styleConf request.MixCellShowStyle
|
|
|
err = json.Unmarshal([]byte(cell.ShowStyle), &styleConf)
|
|
|
if err != nil {
|
|
@@ -1218,7 +1228,10 @@ func changePointDecimalPlaces(str string, changeNum int) (newStr string) {
|
|
|
}
|
|
|
dotIndex := strings.Index(str, ".") // 查找小数点的位置
|
|
|
if dotIndex == -1 {
|
|
|
- return // 没有小数点,返回0
|
|
|
+ if changeNum > 0 { // 增加小数位数
|
|
|
+ newStr += "." + strings.Repeat("0", changeNum)
|
|
|
+ }
|
|
|
+ return
|
|
|
}
|
|
|
decimalPlaces := len(str) - dotIndex - 1 // 计算小数位数
|
|
|
numbers := strings.Split(str, ".")
|