فهرست منبع

add:表格对齐

zqbao 4 ماه پیش
والد
کامیت
7d989e8052
2فایلهای تغییر یافته به همراه12 افزوده شده و 0 حذف شده
  1. 1 0
      models/data_manage/excel/request/mixed_table.go
  2. 11 0
      services/excel/lucky_sheet.go

+ 1 - 0
models/data_manage/excel/request/mixed_table.go

@@ -140,6 +140,7 @@ type MixCellShowStyle struct {
 	Last            string      `description:"起始操作:nt|decimal" json:"last"`
 	Color           string      `description:"颜色值,#RRG" json:"color"`
 	BackgroundColor string      `description:"背景颜色值,#RRG" json:"background-color"`
+	Align           string      `description:"对齐方式:left|center|right" json:"align"`
 }
 
 type DateDataBeforeAfterReq struct {

+ 11 - 0
services/excel/lucky_sheet.go

@@ -1756,6 +1756,17 @@ func GetTableDataByMixedTableData(config [][]request.MixedTableCellDataReq, hide
 					if styleConfig.Color != "" {
 						tmp.FontColor = styleConfig.Color
 					}
+					switch styleConfig.Align {
+					case "center":
+						tmp.HorizontalType = 0
+						tmp.Ht = 0
+					case "left":
+						tmp.HorizontalType = 1
+						tmp.Ht = 1
+					case "right":
+						tmp.HorizontalType = 2
+						tmp.Ht = 2
+					}
 					tmp.Monitor = showFormatValue
 					// 如果没有showValue, 则使用value
 					if cell.ShowValue == "" {