Explorar o código

Merge remote-tracking branch 'origin/master' into pool/xy_login

Roc hai 11 meses
pai
achega
c47d4d16fc
Modificáronse 2 ficheiros con 12 adicións e 7 borrados
  1. 11 6
      services/excel/lucky_sheet.go
  2. 1 1
      utils/common.go

+ 11 - 6
services/excel/lucky_sheet.go

@@ -903,10 +903,10 @@ var LuckyFontFamilyMap = map[int]string{
 	2:  "Tahoma",
 	3:  "Verdana",
 	4:  "微软雅黑",
-	5:  "宋体",   //宋体(Song)、
-	6:  "黑体",   // 黑体(ST Heiti)
-	7:  "楷体",   //楷体(ST Kaiti),
-	8:  "仿宋",   //仿宋(ST FangSong),
+	5:  "宋体",  //宋体(Song)、
+	6:  "黑体",  // 黑体(ST Heiti)
+	7:  "楷体",  //楷体(ST Kaiti),
+	8:  "仿宋",  //仿宋(ST FangSong),
 	9:  "新宋体", //新宋体(ST Song),
 	10: "华文新魏",
 	11: "华文行楷",
@@ -1684,11 +1684,16 @@ func GetTableDataByMixedTableData(config [][]request.MixedTableCellDataReq) (sel
 		for _, row := range config {
 			dataCol := make([]LuckySheetDataValue, 0)
 			for _, cell := range row {
-				dataCol = append(dataCol, LuckySheetDataValue{
+				tmp := LuckySheetDataValue{
 					Value:     cell.Value,
 					Monitor:   cell.ShowValue,
 					MergeCell: LuckySheetDataConfigMerge{},
-				})
+				}
+				if cell.ShowStyle != "" {
+					showFormatValue := fmt.Sprintf("%v", cell.ShowFormatValue)
+					tmp.Monitor = showFormatValue
+				}
+				dataCol = append(dataCol, tmp)
 			}
 			tableDataList = append(tableDataList, dataCol)
 		}

+ 1 - 1
utils/common.go

@@ -2095,7 +2095,7 @@ func GetPredictEdbDayListByNum(startDate time.Time, num int, frequency string) (
 
 // FormatMixTableDataShowValue 格式化自定表格显示数据
 func FormatMixTableDataShowValue(x float64) (res string) {
-	res = fmt.Sprint(x)
+	res = strconv.FormatFloat(x, 'f', -1, 64)
 	return
 }