浏览代码

Merge branch 'feature/eta_2.6.9' into debug

hsun 1 天之前
父节点
当前提交
090a6ede25
共有 3 个文件被更改,包括 11 次插入4 次删除
  1. 1 0
      controllers/report_v2.go
  2. 8 3
      models/report.go
  3. 2 1
      services/report_v2.go

+ 1 - 0
controllers/report_v2.go

@@ -531,6 +531,7 @@ func (this *ReportController) Add() {
 	item.AdminRealName = sysUser.RealName
 	item.ClassifyIdThird = req.ClassifyIdThird
 	item.ClassifyNameThird = classifyMap[req.ClassifyIdThird]
+	item.FreeReportRatio = req.FreeReportRatio
 
 	// 产品要求,如果是多人协作,那么就是章节类型的报告
 	if req.CollaborateType == 2 {

+ 8 - 3
models/report.go

@@ -95,6 +95,7 @@ type Report struct {
 	RaiReportId         int       `description:"RAI报告ID"`
 	FreeLayoutConfig    string    `description:"'自由布局配置"`
 	MiniShow            int       `description:"是否在C端展示:0-否;1-是"`
+	FreeReportRatio     string    `description:"自由布局页面比例:A4; 16:9; 4:3; 10:7"`
 }
 
 func (m *Report) AfterFind(db *gorm.DB) (err error) {
@@ -175,6 +176,7 @@ type ReportList struct {
 	ClassifyEnabled     bool      `description:"分类是否禁用"`
 	RaiReportId         int       `description:"RAI报告ID"`
 	MiniShow            int       `description:"是否在C端展示:0-否;1-是"`
+	FreeReportRatio     string    `description:"自由布局页面比例:A4; 16:9; 4:3; 10:7"`
 }
 
 func (m *ReportList) AfterFind(db *gorm.DB) (err error) {
@@ -456,6 +458,7 @@ type ReportDetail struct {
 	ClassifyEnabled     bool      `description:"分类是否禁用"`
 	FreeLayoutConfig    string    `description:"'自由布局配置"`
 	MiniShow            int       `description:"是否在C端展示:0-否;1-是"`
+	FreeReportRatio     string    `description:"自由布局页面比例:A4; 16:9; 4:3; 10:7"`
 }
 
 func (m *ReportDetail) AfterFind(db *gorm.DB) (err error) {
@@ -629,6 +632,7 @@ type AddReq struct {
 	InheritReportId    int    `description:"待继承的报告ID"`
 	GrantAdminIdList   []int  `description:"授权用户id列表"`
 	MiniShow           int    `description:"是否在C端展示:0-否;1-是"`
+	FreeReportRatio    string `description:"自由布局页面比例:A4; 16:9; 4:3; 10:7"`
 }
 
 type PrePublishReq struct {
@@ -677,9 +681,10 @@ type EditReq struct {
 	EndResourceId      int    `description:"版尾资源ID"`
 	//CollaborateType    int8   `description:"协作方式,1:个人,2:多人协作。默认:1"`
 	//ReportLayout       int8   `description:"报告布局,1:常规布局,2:智能布局,3:自由布局。默认:1"`
-	IsPublicPublish  int8  `description:"是否公开发布,1:是,2:否"`
-	GrantAdminIdList []int `description:"授权用户id列表"`
-	MiniShow         int   `description:"是否在C端展示:0-否;1-是"`
+	IsPublicPublish  int8   `description:"是否公开发布,1:是,2:否"`
+	GrantAdminIdList []int  `description:"授权用户id列表"`
+	MiniShow         int    `description:"是否在C端展示:0-否;1-是"`
+	FreeReportRatio  string `description:"自由布局页面比例:A4; 16:9; 4:3; 10:7"`
 }
 
 type EditResp struct {

+ 2 - 1
services/report_v2.go

@@ -228,7 +228,7 @@ func EditReport(reportInfo *models.Report, req models.EditReq, sysUser *system.A
 	reportInfo.State = state
 
 	//updateCols := []string{"ClassifyIdFirst", "ClassifyNameFirst", "ClassifyIdSecond", "ClassifyNameSecond", "ClassifyIdThird", "ClassifyNameThird", "Title", "Abstract", "Author", "Frequency", "Stage", "CreateTime", "IsPublicPublish", "LastModifyAdminId", "LastModifyAdminName", "ModifyTime"}
-	updateCols := []string{"Title", "Abstract", "Author", "Frequency", "CreateTime", "IsPublicPublish", "LastModifyAdminId", "LastModifyAdminName", "ModifyTime", "State", "MiniShow"}
+	updateCols := []string{"Title", "Abstract", "Author", "Frequency", "CreateTime", "IsPublicPublish", "LastModifyAdminId", "LastModifyAdminName", "ModifyTime", "State", "MiniShow", "FreeReportRatio"}
 
 	if req.HeadResourceId > 0 {
 		reportInfo.HeadResourceId = req.HeadResourceId
@@ -239,6 +239,7 @@ func EditReport(reportInfo *models.Report, req models.EditReq, sysUser *system.A
 		updateCols = append(updateCols, "EndResourceId")
 	}
 	reportInfo.MiniShow = req.MiniShow
+	reportInfo.FreeReportRatio = req.FreeReportRatio
 
 	// 需要添加的报告授权数据
 	addReportAdminList := make([]*report.ReportGrant, 0)