|
@@ -1433,18 +1433,7 @@ func (this *ChartInfoController) PreviewChartInfoDetail() {
|
|
|
return
|
|
|
}
|
|
|
for i := range markerLines {
|
|
|
- if markerLines[i].MarkLineType == 1 {
|
|
|
-
|
|
|
- if edbList[0].IsAxis == 1 {
|
|
|
- value, err := data.MarkerLineCalculate(markerLines[i], edbList[0].DataList, chartInfo)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "标识线配置异常"
|
|
|
- br.ErrMsg = "标识线配置异常" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- markerLines[i].Value = value
|
|
|
- }
|
|
|
- } else {
|
|
|
+ if markerLines[i].EdbType == 1 {
|
|
|
|
|
|
edbInfo, err := data_manage.GetEdbInfoById(markerLines[i].EdbInfoId)
|
|
|
if err != nil {
|
|
@@ -1465,6 +1454,18 @@ func (this *ChartInfoController) PreviewChartInfoDetail() {
|
|
|
return
|
|
|
}
|
|
|
markerLines[i].Value = value
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ if edbList[0].IsAxis == 1 {
|
|
|
+ value, err := data.MarkerLineCalculate(markerLines[i], edbList[0].DataList, chartInfo)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "标识线配置异常"
|
|
|
+ br.ErrMsg = "标识线配置异常" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ markerLines[i].Value = value
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -4428,3 +4429,62 @@ func (this *ChartInfoController) PreviewSeasonChartInfo() {
|
|
|
br.Msg = "获取成功"
|
|
|
br.Data = resp
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+func (this *ChartInfoController) ChartInfoImgSetBySvg() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ imgData := this.GetString("Img")
|
|
|
+ if imgData == "" {
|
|
|
+ br.Msg = "图片参数错误"
|
|
|
+ br.ErrMsg = "图片参数错误,Img Is Empty"
|
|
|
+ return
|
|
|
+ }
|
|
|
+ chartInfoId, _ := this.GetInt("ChartInfoId", 0)
|
|
|
+ if chartInfoId <= 0 {
|
|
|
+ br.Msg = "图片参数错误"
|
|
|
+ br.ErrMsg = "图片参数错误,ChartInfoId Is Empty"
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp := new(models.ResourceResp)
|
|
|
+
|
|
|
+
|
|
|
+ resourceUrl, err, errMsg := services.GetResourceUrlBySvgImg(imgData)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = errMsg
|
|
|
+ br.ErrMsg = err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if chartInfoId > 0 && resourceUrl != "" {
|
|
|
+ err = data_manage.EditChartInfoImageV2(chartInfoId, resourceUrl)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "保存失败"
|
|
|
+ br.ErrMsg = "保存失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ go data.EsAddOrEditChartInfo(chartInfoId)
|
|
|
+
|
|
|
+ go data.EsAddOrEditMyChartInfoByChartInfoId(chartInfoId)
|
|
|
+ }
|
|
|
+
|
|
|
+ resp.ResourceUrl = resourceUrl
|
|
|
+ resp.Source = "convert"
|
|
|
+
|
|
|
+ br.Msg = "上传成功"
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Data = resp
|
|
|
+ return
|
|
|
+}
|