Bläddra i källkod

新增报告自由布局比例

hsun 4 dagar sedan
förälder
incheckning
6b6e0156f4
3 ändrade filer med 10 tillägg och 3 borttagningar
  1. 1 0
      controllers/report_v2.go
  2. 7 2
      models/report.go
  3. 2 1
      services/report_v2.go

+ 1 - 0
controllers/report_v2.go

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

+ 7 - 2
models/report.go

@@ -92,6 +92,7 @@ type Report struct {
 	InheritReportId     int       `description:"待继承的报告ID"`
 	VoiceGenerateType   int       `description:"音频生成方式,0:系统生成,1:人工上传"`
 	RaiReportId         int       `description:"RAI报告ID"`
+	FreeReportRatio     string    `description:"自由布局页面比例:A4; 16:9; 4:3; 10:7"`
 }
 
 type ReportList struct {
@@ -158,6 +159,7 @@ type ReportList struct {
 	InheritReportId     int       `description:"待继承的报告ID"`
 	IsCollect           int       `description:"是否收藏"`
 	RaiReportId         int       `description:"RAI报告ID"`
+	FreeReportRatio     string    `description:"自由布局页面比例:A4; 16:9; 4:3; 10:7"`
 }
 
 type ReportListResp struct {
@@ -382,6 +384,7 @@ type ReportDetail struct {
 	ReportCreateTime    time.Time `description:"报告时间创建时间"`
 	FreeLayoutConfig    string    `description:"自由布局配置"`
 	RaiReportId         int       `description:"RAI报告ID"`
+	FreeReportRatio     string    `description:"自由布局页面比例:A4; 16:9; 4:3; 10:7"`
 }
 
 func GetReportById(reportId int) (item *ReportDetail, err error) {
@@ -526,6 +529,7 @@ type AddReq struct {
 	IsPublicPublish    int8   `description:"是否公开发布,1:是,2:否"`
 	InheritReportId    int    `description:"待继承的报告ID"`
 	GrantAdminIdList   []int  `description:"授权用户id列表"`
+	FreeReportRatio    string `description:"自由布局页面比例:A4; 16:9; 4:3; 10:7"`
 }
 
 type PrePublishReq struct {
@@ -570,8 +574,9 @@ type EditReq struct {
 	EndResourceId      int    `description:"版尾资源ID"`
 	//CollaborateType    int8   `description:"协作方式,1:个人,2:多人协作。默认:1"`
 	//ReportLayout       int8   `description:"报告布局,1:常规布局,2:智能布局。默认:1"`
-	IsPublicPublish  int8  `description:"是否公开发布,1:是,2:否"`
-	GrantAdminIdList []int `description:"授权用户id列表"`
+	IsPublicPublish  int8   `description:"是否公开发布,1:是,2:否"`
+	GrantAdminIdList []int  `description:"授权用户id列表"`
+	FreeReportRatio  string `description:"自由布局页面比例:A4; 16:9; 4:3; 10:7"`
 }
 
 type EditResp struct {

+ 2 - 1
services/report_v2.go

@@ -217,7 +217,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"}
+	updateCols := []string{"Title", "Abstract", "Author", "Frequency", "CreateTime", "IsPublicPublish", "LastModifyAdminId", "LastModifyAdminName", "ModifyTime", "State", "FreeReportRatio"}
 
 	if req.HeadResourceId > 0 {
 		reportInfo.HeadResourceId = req.HeadResourceId
@@ -227,6 +227,7 @@ func EditReport(reportInfo *models.Report, req models.EditReq, sysUser *system.A
 		reportInfo.EndResourceId = req.EndResourceId
 		updateCols = append(updateCols, "EndResourceId")
 	}
+	reportInfo.FreeReportRatio = req.FreeReportRatio
 
 	// 需要添加的报告授权数据
 	addReportAdminList := make([]*report.ReportGrant, 0)