|
@@ -438,7 +438,7 @@ func Report(c *gin.Context) {
|
|
// _ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "1. 总体情况 ............................... 1", alignOptionText)
|
|
// _ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "1. 总体情况 ............................... 1", alignOptionText)
|
|
// }
|
|
// }
|
|
//}
|
|
//}
|
|
- // ------- 详情页 ------- todo 详情页暂时不分页,因为内容可能很长
|
|
|
|
|
|
+ // ------- 详情页 第一页 -------
|
|
{
|
|
{
|
|
pdf.AddPage()
|
|
pdf.AddPage()
|
|
currentLine := 0.0
|
|
currentLine := 0.0
|
|
@@ -522,6 +522,11 @@ func Report(c *gin.Context) {
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
+ // ------- 详情页 第二页 -------
|
|
|
|
+ {
|
|
|
|
+ pdf.AddPage()
|
|
|
|
+ currentLine := 0.0
|
|
// 3. 线上扣分详情
|
|
// 3. 线上扣分详情
|
|
{
|
|
{
|
|
columnNumber := 3.0 // 列数
|
|
columnNumber := 3.0 // 列数
|
|
@@ -531,7 +536,61 @@ func Report(c *gin.Context) {
|
|
_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "3. 线上扣分详情", alignOptionText)
|
|
_ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "3. 线上扣分详情", alignOptionText)
|
|
currentLine++
|
|
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
|
|
// 场景1
|
|
{
|
|
{
|
|
{
|
|
{
|
|
@@ -555,7 +614,7 @@ func Report(c *gin.Context) {
|
|
}
|
|
}
|
|
currentLine++
|
|
currentLine++
|
|
}
|
|
}
|
|
- for j := 0; j < 4; j++ {
|
|
|
|
|
|
+ for j := 0; j < 2; j++ {
|
|
{
|
|
{
|
|
{
|
|
{
|
|
pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
|
|
pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
|
|
@@ -578,8 +637,8 @@ func Report(c *gin.Context) {
|
|
// 4 作品优化建议
|
|
// 4 作品优化建议
|
|
{
|
|
{
|
|
pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
|
|
pdf.SetXY(leftMargin, topMargin+currentLine*lineHeight)
|
|
|
|
+ _ = pdf.CellWithOption(&gopdf.Rect{W: tableWidth, H: lineHeight}, "4. 作品优化建议", alignOptionText)
|
|
currentLine++
|
|
currentLine++
|
|
- err = pdf.Cell(nil, "4. 作品优化建议")
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// ------- 附录页 -------
|
|
// ------- 附录页 -------
|