- {title}占位符,对应columns里面title
"retailPrice": [ { "type": "number", "required": false, "isAdd": true, "isEdit": true, "min": 0, "max": 2, "message": "【{retail_price}】值必须是数字。" }, { "type": "max", "required": false, "isAdd": true, "isEdit": true, "max": 9999999, "message": "【{retail_price}】最大值{1}元。" }, { "type": "min", "required": false, "isAdd": true, "isEdit": true, "min": 0, "message": "【{retail_price}】最小值{0}元。" } ], "settleLastDay": [ { "type": "digits", "required": false, "isAdd": true, "isEdit": true, "min": 0, "max": 0, "message": "【{settle_last_day}】值必须是整数。" }, { "type": "max", "required": false, "isAdd": true, "isEdit": true, "max": 1000, "message": "【{settle_last_day}】最大值{1}天。" }, { "type": "min", "required": false, "isAdd": true, "isEdit": true, "min": 0, "message": "【{settle_last_day}】最小值{0}天。" } ]
- 源码刨析
case RuleType.Number: if (!Regex.IsMatch(valueTemp.ToString(), RuleConst.Number.Replace("{0,2}", "{0," + (rule.Max ?? 15) + "}"))) { throw new BizException(string.Format(message, rule.Min, rule.Max, rule.Accept)); } break;
文档更新时间: 2022-01-30 21:50 作者:admin