|
@@ -108,6 +108,8 @@ func (this *SmartReportController) Add() {
|
|
|
item.HeadImg = req.HeadImg
|
|
|
item.EndImg = req.EndImg
|
|
|
item.CanvasColor = req.CanvasColor
|
|
|
+ item.HeadResourceId = req.HeadResourceId
|
|
|
+ item.EndResourceId = req.EndResourceId
|
|
|
|
|
|
// 继承报告
|
|
|
if req.AddType == 2 {
|
|
@@ -244,7 +246,7 @@ func (this *SmartReportController) Edit() {
|
|
|
contentModify = true
|
|
|
}
|
|
|
cols := []string{"ClassifyIdFirst", "ClassifyNameFirst", "ClassifyIdSecond", "ClassifyNameSecond", "Title", "Abstract", "Author",
|
|
|
- "Frequency", "Content", "ContentSub", "ContentStruct", "ModifyTime", "HeadImg", "EndImg", "CanvasColor"}
|
|
|
+ "Frequency", "Content", "ContentSub", "ContentStruct", "ModifyTime", "HeadImg", "EndImg", "CanvasColor","HeadResourceId", "EndResourceId"}
|
|
|
item.ClassifyIdFirst = req.ClassifyIdFirst
|
|
|
item.ClassifyNameFirst = req.ClassifyNameFirst
|
|
|
item.ClassifyIdSecond = req.ClassifyIdSecond
|
|
@@ -260,6 +262,8 @@ func (this *SmartReportController) Edit() {
|
|
|
item.HeadImg = req.HeadImg
|
|
|
item.EndImg = req.EndImg
|
|
|
item.CanvasColor = req.CanvasColor
|
|
|
+ item.HeadResourceId = req.HeadResourceId
|
|
|
+ item.EndResourceId = req.EndResourceId
|
|
|
if contentModify {
|
|
|
item.LastModifyAdminId = sysUser.AdminId
|
|
|
item.LastModifyAdminName = sysUser.RealName
|
|
@@ -384,7 +388,27 @@ func (this *SmartReportController) Detail() {
|
|
|
return
|
|
|
}
|
|
|
resp := smart_report.FormatSmartReport2Item(item)
|
|
|
+ if resp.HeadResourceId > 0 {
|
|
|
+ headResource, err := smart_report.GetResourceItemById(resp.HeadResourceId)
|
|
|
+ if err == nil {
|
|
|
+ br.Msg = "操作失败"
|
|
|
+ br.ErrMsg = "获取资源库版头失败, Err: " + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp.HeadImg = headResource.ImgUrl
|
|
|
+ resp.HeadStyle = headResource.Style
|
|
|
+ }
|
|
|
|
|
|
+ if resp.EndResourceId > 0 {
|
|
|
+ endResource, err := smart_report.GetResourceItemById(resp.EndResourceId)
|
|
|
+ if err == nil {
|
|
|
+ br.Msg = "操作失败"
|
|
|
+ br.ErrMsg = "获取资源库版头失败, Err: " + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp.EndImg = endResource.ImgUrl
|
|
|
+ resp.EndStyle = endResource.Style
|
|
|
+ }
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "获取成功"
|