Ver código fonte

fix:ETA表格(预测值)加背景色

Roc 11 meses atrás
pai
commit
e6f7fe0325
1 arquivos alterados com 16 adições e 6 exclusões
  1. 16 6
      services/excel/lucky_sheet.go

+ 16 - 6
services/excel/lucky_sheet.go

@@ -1018,10 +1018,15 @@ func GetTableDataByCustomData(excelType int, data request.TableDataReq) (selfTab
 
 				// 数据值
 				for _, v := range data.Data {
+					background := ``
+					if v.Data[i].DataType == 5 {
+						background = "#ffefdd"
+					}
 					dataCol = append(dataCol, LuckySheetDataValue{
-						Value:     v.Data[i].Value,
-						Monitor:   v.Data[i].ShowValue,
-						MergeCell: LuckySheetDataConfigMerge{},
+						Value:      v.Data[i].Value,
+						Monitor:    v.Data[i].ShowValue,
+						MergeCell:  LuckySheetDataConfigMerge{},
+						Background: background,
 					})
 				}
 
@@ -1132,10 +1137,15 @@ func GetTableDataByCustomData(excelType int, data request.TableDataReq) (selfTab
 
 			// 指标数据列
 			for _, tmpData := range tmpEdbInfo.Data {
+				background := ``
+				if tmpData.DataType == 5 {
+					background = "#ffefdd"
+				}
 				dataCol = append(dataCol, LuckySheetDataValue{
-					Value:     tmpData.Value,
-					Monitor:   tmpData.ShowValue,
-					MergeCell: LuckySheetDataConfigMerge{},
+					Value:      tmpData.Value,
+					Monitor:    tmpData.ShowValue,
+					MergeCell:  LuckySheetDataConfigMerge{},
+					Background: background,
 				})
 			}