Browse Source

Merge branch 'bzq/6665_excel_bug' of eta_gn_server/eta_api into debug

baoziqiang 3 months ago
parent
commit
1d8eef70bf
2 changed files with 10 additions and 6 deletions
  1. 5 6
      controllers/data_manage/excel/excel_info.go
  2. 5 0
      services/data/excel/excel_info.go

+ 5 - 6
controllers/data_manage/excel/excel_info.go

@@ -3074,12 +3074,11 @@ func (c *ExcelInfoController) EditExcelRule() {
 		br.Msg = "应用选区不能为空"
 		return
 	}
-	if req.FontColor == "" {
-		br.Msg = "字体颜色不能为空"
-		return
-	}
-	if req.BackgroundColor == "" {
-		br.Msg = "背景颜色不能为空"
+
+	req.FontColor = strings.TrimSpace(req.FontColor)
+	req.BackgroundColor = strings.TrimSpace(req.BackgroundColor)
+	if req.FontColor == "" && req.BackgroundColor == "" {
+		br.Msg = "字体颜色和背景颜色不能同时为空"
 		return
 	}
 	if req.RuleType == 3 && req.RightValue == "" {

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

@@ -980,6 +980,11 @@ func GetExcelRuleList(excelInfoId int) (resp *response.ExcelRuleListResp, err er
 	if err != nil {
 		return
 	}
+	for _, v := range excelInfoList {
+		v.BackgroundColor = strings.TrimSpace(v.BackgroundColor)
+		v.FontColor = strings.TrimSpace(v.FontColor)
+		resp.List = append(resp.List, v)
+	}
 	resp.List = excelInfoList
 	return
 }