浏览代码

fix:图表刷新时,基础指标需要过滤掉预测指标

Roc 2 年之前
父节点
当前提交
2e6b8dd30a
共有 2 个文件被更改,包括 5 次插入0 次删除
  1. 1 0
      models/data_manage/chart_info.go
  2. 4 0
      services/data/chart_info.go

+ 1 - 0
models/data_manage/chart_info.go

@@ -6,6 +6,7 @@ import (
 	"hongze/hongze_chart_lib/utils"
 )
 
+// GetChartInfoRefreshData 获取图表关联的指标信息
 func GetChartInfoRefreshData(chartInfoId int) (baseEdbInfoArr, calculateInfoArr []*EdbInfo, err error) {
 	o := orm.NewOrmUsingDB("data")
 

+ 4 - 0
services/data/chart_info.go

@@ -29,6 +29,10 @@ func ChartInfoRefreshV1(chartInfoId int) (err error) {
 	newBaseEdbInfoArr := make([]*data_manage.EdbInfo, 0)
 	baseMap := make(map[int]*data_manage.EdbInfo)
 	for _, bv := range baseEdbInfoArr {
+		// 如果不是普通指标,那么过滤
+		if bv.EdbInfoType != 0 {
+			continue
+		}
 		if _, ok := baseMap[bv.EdbInfoId]; !ok {
 			newBaseEdbInfoArr = append(newBaseEdbInfoArr, bv)
 		}