Quellcode durchsuchen

fix:去除前端传过来的globj

zqbao vor 6 Monaten
Ursprung
Commit
2f716d551f

+ 5 - 4
models/data_manage/excel/request/mixed_table.go

@@ -133,10 +133,11 @@ type MixDateCalculateTagReq struct {
 
 // MixCellShowStyle 混合表格 单元格样式展示计算
 type MixCellShowStyle struct {
-	Pn              int    `description:"小数点位数增加或减少,正数表述增加,负数表示减少" json:"pn"`
-	Nt              string `description:"变换类型:number 小数点位数改变,percent百分比," json:"nt"`
-	Color           string `description:"颜色值,#RRG" json:"color"`
-	BackgroundColor string `description:"背景颜色值,#RRG" json:"background-color"`
+	Pn              int         `description:"小数点位数增加或减少,正数表述增加,负数表示减少" json:"pn"`
+	Nt              string      `description:"变换类型:number 小数点位数改变,percent百分比," json:"nt"`
+	GlObj           interface{} `description:"公式对象:1:数值,2:百分比,3:文本" json:"glObj"`
+	Color           string      `description:"颜色值,#RRG" json:"color"`
+	BackgroundColor string      `description:"背景颜色值,#RRG" json:"background-color"`
 }
 
 type DateDataBeforeAfterReq struct {

+ 8 - 0
services/data/excel/mixed_table.go

@@ -1207,6 +1207,14 @@ func handleMixCellShowStyle(showStyleList []string, calculateCellMap map[string]
 			} else {
 				cell.ShowFormatValue = cell.ShowValue
 			}
+			// 前端传过来的json中有可能有glObj,需要去掉
+			if styleConf.GlObj != nil {
+				styleConf.GlObj = nil
+				tmpStyleConf, err := json.Marshal(styleConf)
+				if err == nil {
+					cell.ShowStyle = string(tmpStyleConf)
+				}
+			}
 			config[cellPosition.Column][cellPosition.Row] = cell
 		}
 	}