|
@@ -4,6 +4,7 @@ import (
|
|
|
"encoding/json"
|
|
|
"errors"
|
|
|
"fmt"
|
|
|
+ "github.com/PuerkitoBio/goquery"
|
|
|
"hongze/hongze_yb/global"
|
|
|
"hongze/hongze_yb/models/tables/yb_poster_resource"
|
|
|
"hongze/hongze_yb/models/tables/yb_suncode_pars"
|
|
@@ -355,9 +356,15 @@ func fillContent2Html(source, pars, sunCodeUrl string, height int) (contentStr s
|
|
|
contentStr = strings.Replace(contentStr, "{{CHART_NAME}}", params.ChartName, 1)
|
|
|
contentStr = strings.Replace(contentStr, "{{CHART_IMAGE}}", params.ChartImage, 1)
|
|
|
case "report_detail":
|
|
|
+ doc, tmpErr := goquery.NewDocumentFromReader(strings.NewReader(params.ReportAbstract))
|
|
|
+ if tmpErr != nil {
|
|
|
+ err = tmpErr
|
|
|
+ return
|
|
|
+ }
|
|
|
+ abstract := doc.Text()
|
|
|
contentStr = strings.Replace(contentStr, "{{REPORT_TYPE}}", params.ReportType, 1)
|
|
|
contentStr = strings.Replace(contentStr, "{{REPORT_TITLE}}", params.ReportTitle, 1)
|
|
|
- contentStr = strings.Replace(contentStr, "{{REPORT_ABSTRACT}}", params.ReportAbstract, 1)
|
|
|
+ contentStr = strings.Replace(contentStr, "{{REPORT_ABSTRACT}}", abstract, 1)
|
|
|
case "special_column_list":
|
|
|
contentStr = strings.Replace(contentStr, "{{LIST_TITLE}}", params.ListTitle, 1)
|
|
|
contentStr = strings.Replace(contentStr, "{{STAGE_1}}", "第" + params.Stage1 + "期", 1)
|