LingxinMeng před 1 rokem
rodič
revize
3c7f73577f
1 změnil soubory, kde provedl 63 přidání a 4 odebrání
  1. 63 4
      amd64/web_server/handler/h_exam.go

+ 63 - 4
amd64/web_server/handler/h_exam.go

@@ -438,7 +438,7 @@ func Report(c *gin.Context) {
 		//		_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "1. 总体情况 ............................... 1", alignOptionText)
 		//	}
 		//}
-		// ------- 详情页 ------- todo 详情页暂时不分页,因为内容可能很长
+		// ------- 详情页 第一页 -------
 		{
 			pdf.AddPage()
 			currentLine := 0.0
@@ -522,6 +522,11 @@ func Report(c *gin.Context) {
 				}
 
 			}
+		}
+		// ------- 详情页 第二页 -------
+		{
+			pdf.AddPage()
+			currentLine := 0.0
 			// 3. 线上扣分详情
 			{
 				columnNumber := 3.0                         // 列数
@@ -531,7 +536,61 @@ func Report(c *gin.Context) {
 					_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "3. 线上扣分详情", alignOptionText)
 					currentLine++
 				}
-				for i := 0; i < 10; i++ {
+				for i := 0; i < 5; i++ {
+					// 场景1
+					{
+						{
+							pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
+							_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "("+util.ToString(i+1)+")xxxx场景", alignOptionText)
+							currentLine++
+						}
+						// 场景1 表格
+						{
+							{
+								pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
+								_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "序号", alignOptionTable)
+							}
+							{
+								pdf.SetXY(leftMargin+1.0*tableCellWidth, topMargin+currentLine*lineHeight)
+								_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "扣分点", alignOptionTable)
+							}
+							{
+								pdf.SetXY(leftMargin+2.0*tableCellWidth, topMargin+currentLine*lineHeight)
+								_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "扣分说明", alignOptionTable)
+							}
+							currentLine++
+						}
+						for j := 0; j < 2; j++ {
+							{
+								{
+									pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
+									_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, util.ToString(j+1), alignOptionTable)
+								}
+								{
+									pdf.SetXY(leftMargin+1.0*tableCellWidth, topMargin+currentLine*lineHeight)
+									_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "xxx", alignOptionTable)
+								}
+								{
+									pdf.SetXY(leftMargin+2.0*tableCellWidth, topMargin+currentLine*lineHeight)
+									_ = pdf.CellWithOption(&gopdf.Rect{W: tableCellWidth, H: lineHeight}, "xxx", alignOptionTable)
+								}
+								currentLine++
+							}
+						}
+					}
+				}
+			}
+		}
+		// ------- 详情页 第三页 -------
+		size := 10
+		if size > 5 {
+			pdf.AddPage()
+			currentLine := 0.0
+			// 3. 线上扣分详情
+			{
+				columnNumber := 3.0                         // 列数
+				tableCellWidth := tableWidth / columnNumber // 单元格宽度
+				for i := 5; i < 10; i++ {
 					// 场景1
 					{
 						{
@@ -555,7 +614,7 @@ func Report(c *gin.Context) {
 							}
 							currentLine++
 						}
-						for j := 0; j < 4; j++ {
+						for j := 0; j < 2; j++ {
 							{
 								{
 									pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
@@ -578,8 +637,8 @@ func Report(c *gin.Context) {
 			// 4 作品优化建议
 			{
 				pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
+				_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "4. 作品优化建议", alignOptionText)
 				currentLine++
-				err = pdf.Cell(nil, "4. 作品优化建议")
 			}
 		}
 		// ------- 附录页 -------