Browse Source

fix:新增来源字段返回

Roc 1 year ago
parent
commit
f725e350d2
2 changed files with 15 additions and 1 deletions
  1. 14 0
      controllers/data_manage/chart_info.go
  2. 1 1
      services/data/edb_info.go

+ 14 - 0
controllers/data_manage/chart_info.go

@@ -910,6 +910,11 @@ func (this *ChartInfoController) ChartInfoDetail() {
 			}
 		}
 	}
+	
+	// 图表的指标来源
+	sourceNameList, sourceNameEnList := data.GetEdbSourceByEdbInfoIdList(edbList)
+	chartInfo.ChartSource = strings.Join(sourceNameList, ",")
+	chartInfo.ChartSourceEn = strings.Join(sourceNameEnList, ",")
 
 	//图表操作权限
 	chartInfo.IsEdit = data.CheckOpChartPermission(sysUser, chartInfo.SysUserId)
@@ -2683,6 +2688,10 @@ func (this *ChartInfoController) PreviewBarChartInfo() {
 	if len(warnEdbList) > 0 {
 		chartInfo.WarnMsg = `图表引用指标异常,异常指标:` + strings.Join(warnEdbList, ",")
 	}
+	// 图表的指标来源
+	sourceNameList, sourceNameEnList := data.GetEdbSourceByEdbInfoIdList(edbList)
+	chartInfo.ChartSource = strings.Join(sourceNameList, ",")
+	chartInfo.ChartSourceEn = strings.Join(sourceNameEnList, ",")
 
 	//图表操作权限
 	chartInfo.IsEdit = data.CheckOpChartPermission(sysUser, chartInfo.SysUserId)
@@ -2769,6 +2778,11 @@ func (this *ChartInfoController) PreviewSectionScatterChartInfo() {
 		chartInfo.WarnMsg = `图表引用指标异常,异常指标:` + strings.Join(warnEdbList, ",")
 	}
 
+	// 图表的指标来源
+	sourceNameList, sourceNameEnList := data.GetEdbSourceByEdbInfoIdList(edbList)
+	chartInfo.ChartSource = strings.Join(sourceNameList, ",")
+	chartInfo.ChartSourceEn = strings.Join(sourceNameEnList, ",")
+
 	//图表操作权限
 	chartInfo.IsEdit = data.CheckOpChartPermission(sysUser, chartInfo.SysUserId)
 	//判断是否需要展示英文标识

+ 1 - 1
services/data/edb_info.go

@@ -2907,7 +2907,7 @@ func GetBaseIndexTableName(source int) (tableName string) {
 	return
 }
 
-// EdbInfoAdd 添加指标到指标库
+// EdbInfoWsdAdd 添加指标到指标库
 func EdbInfoWsdAdd(item *data_manage.EdbInfo) (edbInfo *data_manage.EdbInfo, err error, errMsg string, isSendEmail bool) {
 	isSendEmail = true
 	//判断指标名称是否存在