Explorar o código

Merge branch 'bzq1/excel_rule_master' of eta_server/eta_api into debug

鲍自强 hai 7 meses
pai
achega
76d36d1f41

+ 2 - 2
models/data_manage/excel/excel_info_rule_mapping.go

@@ -31,10 +31,10 @@ type ExcelInfoRuleMappingView struct {
 	ExcelInfoId            int    `description:"Excel信息ID"`
 	RuleType               int    `description:"规则类型"`
 	LeftValue              string `description:"左值"`
-	LeftValueBack          string `description:"左值后端存储"`
+	LeftValueBack          string `description:"左值后端存储" json:"-"`
 	LeftValueType          int    `description:"左值类型"`
 	RightValue             string `description:"右值"`
-	RightValueBack         string `description:"右值后端存储"`
+	RightValueBack         string `description:"右值后端存储" json:"-"`
 	RightValueType         int    `description:"右值类型"`
 	FontColor              string `description:"字体颜色"`
 	BackgroundColor        string `description:"背景颜色"`

+ 2 - 0
services/data/excel/excel_info.go

@@ -719,8 +719,10 @@ func ExcelRuleFormat(req *request.ExcelRuleMappingReq, lang string) (res *excel.
 		if err != nil {
 			return nil, err
 		}
+		res.LeftValue = req.LeftValue
 		res.LeftValueBack = fmt.Sprintf("%d,%d", x, y)
 	default:
+		res.LeftValue = req.LeftValue
 		res.LeftValueBack = req.LeftValue
 	}
 	switch req.RightValueType {

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

@@ -1207,6 +1207,21 @@ func handleMixCellShowStyle(showStyleList []string, calculateCellMap map[string]
 			}
 			_, e := strconv.ParseFloat(val, 64) // 将字符串转换成float类型
 			if e != nil {                       // 如果没有错误发生则返回true,说明该字符串是一个合法的数字
+				var styleConf request.MixCellShowStyle
+				err = json.Unmarshal([]byte(cell.ShowStyle), &styleConf)
+				if err != nil {
+					err = fmt.Errorf("日期计算配置json解析失败失败: %s, Err:%s", config, err.Error())
+					return
+				}
+				// 前端传过来的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
 				continue
 			}
 			var styleConf request.MixCellShowStyle