Browse Source

fix: 单因子图例回显

hsun 8 months ago
parent
commit
3eebbe8b94

+ 9 - 5
controllers/data_manage/multiple_graph_config.go

@@ -1520,12 +1520,16 @@ func (this *ChartInfoController) GetMultipleGraphConfig() {
 			return
 		}
 		for _, v := range chartList {
+			var mapping response.MultipleGraphConfigChartMapping
 			if tmpInfo, ok := chartMappingMap[v.ChartInfoId]; ok {
-				multipleGraphConfigChartMappingList = append(multipleGraphConfigChartMappingList, response.MultipleGraphConfigChartMapping{
-					ChartInfoId:            tmpInfo.ChartInfoId,
-					Source:                 tmpInfo.Source,
-					MultipleLocationSource: tmpInfo.Source,
-				})
+				mapping.ChartInfoId = tmpInfo.ChartInfoId
+				mapping.Source = tmpInfo.Source
+				mapping.MultipleLocationSource = tmpInfo.Source
+				if v.ChartInfoId == chartInfo.ChartInfoId {
+					mapping.CorrelationExtraConfig = chartInfo.ExtraConfig
+					mapping.SourcesFrom = chartInfo.SourcesFrom
+				}
+				multipleGraphConfigChartMappingList = append(multipleGraphConfigChartMappingList, mapping)
 			}
 		}
 	}

+ 7 - 3
models/data_manage/response/multiple_graph_config.go

@@ -37,11 +37,15 @@ type MultipleGraphConfigDetailResp struct {
 	ChartMappingList    []MultipleGraphConfigChartMapping `description:"关联图表"`
 	EdbMappingList      []MultipleGraphConfigEdbMapping   `description:"关联指标"`
 }
+
 type MultipleGraphConfigChartMapping struct {
-	ChartInfoId            int `description:"图表id"`
-	Source                 int `description:"来源,1:曲线图,2:相关性图;3:滚动相关性图1;4:滚动相关性图2;"`
-	MultipleLocationSource int `description:"来源,1:曲线图,2:相关性图;3:滚动相关性图1;4:滚动相关性图2;"`
+	ChartInfoId            int    `description:"图表id"`
+	Source                 int    `description:"来源,1:曲线图,2:相关性图;3:滚动相关性图1;4:滚动相关性图2;"`
+	MultipleLocationSource int    `description:"来源,1:曲线图,2:相关性图;3:滚动相关性图1;4:滚动相关性图2;"`
+	CorrelationExtraConfig string `description:"普通相关性图表额外设置(含图例)-JSON字符串"`
+	SourcesFrom            string `description:"图表来源-JSON字符串"`
 }
+
 type MultipleGraphConfigEdbMapping struct {
 	EdbInfoId              int `description:"图表id"`
 	Source                 int `description:"来源,1:曲线图,2:相关性图;3:滚动相关性图1;4:滚动相关性图2;"`