Commit 5416935f authored by cellee's avatar cellee

表单提示必填更改

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 113bb4aa
......@@ -147,7 +147,7 @@ const Bookings = (props: any) => {
message.error('User Name Should be limit 2~30!', 3);
} else if (
soltTime &&
moment(soltTime[0], 'HH:mm').format('hh') > moment(soltTime[1], 'HH:mm').format('hh')
moment(soltTime[0], 'HH:mm').format('HH') > moment(soltTime[1], 'HH:mm').format('HH')
) {
// 判断选的时间 是不是结束时间小于开始时间
message.error('Appointment time range error');
......@@ -253,7 +253,7 @@ const Bookings = (props: any) => {
name="basic"
onFinish={onFinish}
validateMessages={validateMessages}
autocomplete="off"
// autocomplete="off"
>
<div className="box2 required">
<div className={styles.box2item1}>Facility Bookings : </div>
......
/*
* @Author: your name
* @Date: 2020-11-19 16:54:53
* @LastEditTime: 2020-12-07 16:17:28
* @LastEditTime: 2020-12-08 16:20:13
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\utils\tip.ts
......@@ -14,8 +14,9 @@ const inputNumberStr = (rule: any, value: any, callback: any) => {
} else {
callback(new Error('Only numbers and letters can be entered!'));
}
} else {
callback(new Error('Required!'));
}
callback();
};
// 只能输入数字限制
......@@ -26,8 +27,9 @@ const inputNumber = (rule: any, value: any, callback: any) => {
} else {
callback(new Error('Only numbers!'));
}
} else {
callback(new Error('Required!'));
}
callback();
};
// 只能输入数字限制 电话提示
......@@ -41,8 +43,9 @@ const inputNumberTel = (rule: any, value: any, callback: any) => {
} else {
callback(new Error('Please input contact information (8-11 digits)!'));
}
} else {
callback(new Error('Required!'));
}
callback();
};
const reqMes = (msg: string) => {
......@@ -102,9 +105,9 @@ export const BookingsTip = [
[reqMes('Please input Name ')],
[{ ...reqMes('Please input contact information (8-11 digits)'), validator: inputNumberTel }],
// [{ required: true, pattern: new RegExp(/^[1-9]\d*$/, 'g'), message: 'Only numbers!')],
[{ ...reqMes('Only numbers!'), validator: inputNumber }],
[{ ...reqMes('Only numbers!'), validator: inputNumber }],
[{ ...reqMes('Only numbers and letters can be entered!'), validator: inputNumberStr }],
[{ required: true, message: 'Only numbers!', validator: inputNumber }],
[{ required: true, message: 'Only numbers!', validator: inputNumber }],
[{ required: true, message: 'Only numbers!', validator: inputNumberStr }],
[reqMes('Please Select The Date')],
];
......
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