zwxi 9 months ago
parent
commit
11c34159ae

+ 5 - 22
controllers/data_manage/chart_info.go

@@ -1014,13 +1014,8 @@ func (this *ChartInfoController) ChartInfoDetail() {
 			br.ErrMsg = "获取主题信息失败,Err:" + err.Error()
 			br.ErrMsg = "获取主题信息失败,Err:" + err.Error()
 			return
 			return
 		}
 		}
-		// 兼容历史数据,加入新字段LineOptionList
-		newConfig, e := data.ConvertOldChartOptions(chartTheme.Config)
-		if e != nil {
-			chartInfo.ChartThemeStyle = chartTheme.Config
-		} else {
-			chartInfo.ChartThemeStyle = newConfig
-		}
+
+		chartInfo.ChartThemeStyle = chartTheme.Config
 		chartInfo.ChartThemeId = chartTheme.ChartThemeId
 		chartInfo.ChartThemeId = chartTheme.ChartThemeId
 
 
 		// 图表数据权限
 		// 图表数据权限
@@ -1509,14 +1504,8 @@ func (this *ChartInfoController) ChartInfoDetailV2() {
 		br.ErrMsg = "获取主题信息失败,Err:" + err.Error()
 		br.ErrMsg = "获取主题信息失败,Err:" + err.Error()
 		return
 		return
 	}
 	}
-	// 兼容历史数据,加入新字段LineOptionList
-	newConfig, e := data.ConvertOldChartOptions(chartTheme.Config)
-	if e != nil {
-		chartInfo.ChartThemeStyle = chartTheme.Config
-	} else {
-		chartInfo.ChartThemeStyle = newConfig
-	}
 
 
+	chartInfo.ChartThemeStyle = chartTheme.Config
 	chartInfo.ChartThemeId = chartTheme.ChartThemeId
 	chartInfo.ChartThemeId = chartTheme.ChartThemeId
 
 
 	dateType := chartInfo.DateType
 	dateType := chartInfo.DateType
@@ -2669,14 +2658,7 @@ func GetChartInfoDetailFromUniqueCode(chartInfo *data_manage.ChartInfoView, isCa
 		return
 		return
 	}
 	}
 
 
-	// 兼容历史数据,加入新字段LineOptionList
-	newConfig, e := data.ConvertOldChartOptions(chartTheme.Config)
-	if e != nil {
-		chartInfo.ChartThemeStyle = chartTheme.Config
-	} else {
-		chartInfo.ChartThemeStyle = newConfig
-	}
-
+	chartInfo.ChartThemeStyle = chartTheme.Config
 	chartInfo.ChartThemeId = chartTheme.ChartThemeId
 	chartInfo.ChartThemeId = chartTheme.ChartThemeId
 
 
 	chartInfoId := chartInfo.ChartInfoId
 	chartInfoId := chartInfo.ChartInfoId
@@ -3951,6 +3933,7 @@ func (this *ChartInfoController) ChartInfoConvertDetail() {
 			br.ErrMsg = "获取主题信息失败,Err:" + err.Error()
 			br.ErrMsg = "获取主题信息失败,Err:" + err.Error()
 			return
 			return
 		}
 		}
+
 		chartInfo.ChartThemeStyle = chartTheme.Config
 		chartInfo.ChartThemeStyle = chartTheme.Config
 		chartInfo.ChartThemeId = chartTheme.ChartThemeId
 		chartInfo.ChartThemeId = chartTheme.ChartThemeId
 
 

+ 22 - 0
controllers/data_manage/excel/excel_info.go

@@ -1811,12 +1811,23 @@ func (c *ExcelInfoController) GetFirstEdbData() {
 		}
 		}
 	}
 	}
 
 
+	sourceNameList, sourceNameEnList, err := excel2.GetEdbSourceByEdbInfoIdList([]int{edbInfoId})
+	if err != nil {
+		br.Msg = "自定义表格数据获取失败"
+		br.ErrMsg = "自定义表格数据获取失败,Err:" + err.Error()
+		return
+	}
+	excelSource := strings.Join(sourceNameList, ",")
+	excelSourceEn := strings.Join(sourceNameEnList, ",")
+
 	br.Ret = 200
 	br.Ret = 200
 	br.Success = true
 	br.Success = true
 	br.Msg = "获取成功"
 	br.Msg = "获取成功"
 	br.Data = response.TableDataItem{
 	br.Data = response.TableDataItem{
 		EdbInfoId: edbInfoId,
 		EdbInfoId: edbInfoId,
 		Data:      dataList,
 		Data:      dataList,
+		ExcelSource: excelSource,
+		ExcelSourceEn: excelSourceEn,
 	}
 	}
 }
 }
 
 
@@ -1879,12 +1890,23 @@ func (c *ExcelInfoController) GetOtherEdbData() {
 		}
 		}
 	}
 	}
 
 
+	sourceNameList, sourceNameEnList, err := excel2.GetEdbSourceByEdbInfoIdList([]int{req.EdbInfoId})
+	if err != nil {
+		br.Msg = "自定义表格数据获取失败"
+		br.ErrMsg = "自定义表格数据获取失败,Err:" + err.Error()
+		return
+	}
+	excelSource := strings.Join(sourceNameList, ",")
+	excelSourceEn := strings.Join(sourceNameEnList, ",")
+
 	br.Ret = 200
 	br.Ret = 200
 	br.Success = true
 	br.Success = true
 	br.Msg = "获取成功"
 	br.Msg = "获取成功"
 	br.Data = response.TableDataItem{
 	br.Data = response.TableDataItem{
 		EdbInfoId: req.EdbInfoId,
 		EdbInfoId: req.EdbInfoId,
 		Data:      dataList,
 		Data:      dataList,
+		ExcelSource: excelSource,
+		ExcelSourceEn: excelSourceEn,
 	}
 	}
 }
 }
 
 

+ 2 - 0
models/data_manage/excel/response/excel_info.go

@@ -47,6 +47,8 @@ type TableCellResp struct {
 type TableDataItem struct {
 type TableDataItem struct {
 	EdbInfoId int                     `description:"指标id"`
 	EdbInfoId int                     `description:"指标id"`
 	Data      []request.ManualDataReq `description:"数据列表"`
 	Data      []request.ManualDataReq `description:"数据列表"`
+	ExcelSource        string                       `description:"表格来源str"`
+	ExcelSourceEn      string                       `description:"表格来源(英文)"`
 }
 }
 
 
 // TableDetailResp  excel表格详情
 // TableDetailResp  excel表格详情

+ 6 - 0
services/data/chart_theme.go

@@ -608,6 +608,12 @@ func GetChartThemeConfig(chartThemeId, source, chartType int) (chartTheme *chart
 	// 如果还是没找到,那就系统的主题id
 	// 如果还是没找到,那就系统的主题id
 	chartTheme, err = chart_theme.GetSystemChartTheme(chartThemeType.ChartThemeTypeId)
 	chartTheme, err = chart_theme.GetSystemChartTheme(chartThemeType.ChartThemeTypeId)
 
 
+	// 兼容历史数据,加入新字段LineOptionList
+	newConfig, e := ConvertOldChartOptions(chartTheme.Config)
+	if e == nil {
+		chartTheme.Config = newConfig
+	}
+
 	return
 	return
 }
 }