|
@@ -291,6 +291,11 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq) (newMixedTableCe
|
|
|
calculateChainList = append(calculateChainList, cell.Uid)
|
|
|
|
|
|
case request.InsertEdbCalculateDataDT: // 插入指标系统计算公式生成的值
|
|
|
+ // 处理value的值
|
|
|
+ if !strings.Contains(cell.Value, "EdbInfoId") && cell.EdbInfoId > 0 {
|
|
|
+ cell.Value, _ = fixCalculateValueConfig(cell.Value, cell.EdbInfoId)
|
|
|
+ row[i] = cell
|
|
|
+ }
|
|
|
// 日期
|
|
|
var cellDateTime string
|
|
|
// 日期关系配置不存在,则默认最新数据
|
|
@@ -559,7 +564,11 @@ func handleConfig(configList [][]request.MixedTableCellDataReq) (newConfig [][]r
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
- edbInfoIdList = append(edbInfoIdList, config.EdbInfoId)
|
|
|
+ if config.EdbInfoId == 0 && cell.EdbInfoId > 0 {
|
|
|
+ edbInfoIdList = append(edbInfoIdList, cell.EdbInfoId)
|
|
|
+ } else {
|
|
|
+ edbInfoIdList = append(edbInfoIdList, config.EdbInfoId)
|
|
|
+ }
|
|
|
dataEdbInfoIdList = append(dataEdbInfoIdList, cell.EdbInfoId)
|
|
|
|
|
|
case request.DateDT: // 日期类型
|
|
@@ -1190,7 +1199,7 @@ func handleMixCellShowStyle(showStyleList []string, calculateCellMap map[string]
|
|
|
val = changePointDecimalPlaces(val, styleConf.Pn, styleConf.Nt, isPercent)
|
|
|
cell.ShowFormatValue = val
|
|
|
} else {
|
|
|
- cell.ShowFormatValue = cell.ShowStyle
|
|
|
+ cell.ShowFormatValue = val
|
|
|
}
|
|
|
config[cellPosition.Column][cellPosition.Row] = cell
|
|
|
}
|
|
@@ -1234,3 +1243,22 @@ func changePointDecimalPlaces(str string, changeNum int, numberType string, isPe
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+func fixCalculateValueConfig(conf string, edbInfoId int) (newConf string, err error) {
|
|
|
+ newConf = conf
|
|
|
+ if edbInfoId == 0 {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var tmpConfig request.CalculateConf
|
|
|
+ err = json.Unmarshal([]byte(conf), &tmpConfig)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if tmpConfig.EdbInfoId == 0 {
|
|
|
+ tmpConfig.EdbInfoId = edbInfoId
|
|
|
+ newConfByte, _ := json.Marshal(tmpConfig)
|
|
|
+ newConf = string(newConfByte)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|