Commit 9290e40c authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

🐞 fix(平台营销活动管理): 修复BUG

parent b37a6aee
......@@ -248,7 +248,7 @@ const AddedMarketing = (props: any) => {
roleType: item.roleId,
roleTypeName: item.roleName,
level: item.level,
levelTyp: item.levelType,
levelType: item.levelType,
levelTypeName: item.levelTypeName,
levelTag: item.levelTag,
}
......
......@@ -324,15 +324,23 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => {
required: true, validator: (_rule, value) => {
const pattern1 = /^-?[1-9]\d*(\.\d{1,1})?$/;
const pattern2 = /^-?[1-9]\d*(\.\d{1,2})?$/;
const pattern3 = /^(\d|[1-9]\d|99.999)(\.\d{1,1})?$/;
const pattern4 = /^(\d|[1-9]\d|99.999)(\.\d{1,2})?$/;
if (!value) {
return Promise.reject(new Error('请输入'));
}
if (!pattern1.test(value) && (int === 4 || int === 7)) {
return Promise.reject(new Error(`必须大于0最多保留1位小数`));
}
if (!pattern3.test(value) && (int === 4 || int === 7) && type === 2) {
return Promise.reject(new Error(`必须大于0且小于100最多保留1位小数`));
}
if (!pattern2.test(value) && int === 5 ) {
return Promise.reject(new Error(`必须大于0最多保留2位小数`));
}
if (!pattern4.test(value) && int === 5 && type === 2 ) {
return Promise.reject(new Error(`必须大于0且小于100最多保留2位小数`));
}
return Promise.resolve();
}
}]}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment