This commit is contained in:
2026-06-12 14:20:55 +08:00
parent 39788bf6d4
commit 0511c19f5f
8 changed files with 2053 additions and 443 deletions

View File

@@ -22,7 +22,7 @@ import (
)
// QYGLReportHandler 企业全景报告页面渲染处理器
// 使用 QYGLJ1U9 聚合接口生成企业报告数据,并通过模板引擎渲染 qiye.html
// 使用 QYGL7HBN 聚合接口生成企业报告数据,并通过模板引擎渲染 qiye.html
type QYGLReportHandler struct {
apiRequestService *api_services.ApiRequestService
logger *zap.Logger
@@ -95,7 +95,6 @@ func (h *QYGLReportHandler) GetQYGLReportPage(c *gin.Context) {
return
}
// 使用 template.JS 避免在脚本中被转义,直接作为 JS 对象字面量注入
reportJSON := template.JS(reportJSONBytes)
c.HTML(http.StatusOK, "qiye.html", gin.H{
@@ -116,9 +115,8 @@ func (h *QYGLReportHandler) GetQYGLReportPageByID(c *gin.Context) {
if h.reportRepo != nil {
if entity, err := h.reportRepo.FindByReportID(c.Request.Context(), id); err == nil && entity != nil {
h.maybeScheduleQYGLPDFPregen(c.Request.Context(), id)
reportJSON := template.JS(entity.ReportData)
c.HTML(http.StatusOK, "qiye.html", gin.H{
"ReportJSON": reportJSON,
"ReportJSON": template.JS(entity.ReportData),
})
return
}
@@ -138,10 +136,10 @@ func (h *QYGLReportHandler) GetQYGLReportPageByID(c *gin.Context) {
return
}
reportJSON := template.JS(reportJSONBytes)
h.maybeScheduleQYGLPDFPregen(c.Request.Context(), id)
reportJSON := template.JS(reportJSONBytes)
c.HTML(http.StatusOK, "qiye.html", gin.H{
"ReportJSON": reportJSON,
})

View File

@@ -23,6 +23,9 @@ func NewQYGLReportRoutes(
func (r *QYGLReportRoutes) Register(router *sharedhttp.GinRouter) {
engine := router.GetEngine()
// 报告头图/页脚qiye.html 样式引用)
engine.Static("/reports/qygl/media", "resources/qygl-media")
// 企业全景报告页面(实时生成)
engine.GET("/reports/qygl", r.handler.GetQYGLReportPage)