Browse Source

fix:管理规则编辑

zqbao 4 months ago
parent
commit
28f6a80fe7
1 changed files with 5 additions and 6 deletions
  1. 5 6
      controllers/data_manage/excel/excel_info.go

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

@@ -3207,12 +3207,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 == "" {