Bladeren bron

fix:管理规则编辑

zqbao 3 maanden geleden
bovenliggende
commit
0bad955c48
1 gewijzigde bestanden met toevoegingen van 4 en 6 verwijderingen
  1. 4 6
      controllers/data_manage/excel/excel_info.go

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

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