Commit eddb1a43 authored by Sixiang_Zzb's avatar Sixiang_Zzb

LIFE用户管理模块优化

parent 32a906a3
......@@ -56,6 +56,7 @@ const UsersAdd = (props: any) => {
const checkData = (rule: any, value: any, callback: any) => {
if (value) {
console.log(123);
if (/^[a-zA-Z0-9]+$/g.test(value)) {
callback();
} else {
......@@ -64,6 +65,18 @@ const UsersAdd = (props: any) => {
}
callback();
};
const checkData1 = (rule: any, value: any, callback: any) => {
if (value) {
if (/^[0-9]+$/g.test(value)) {
callback();
} else {
callback(new Error('Only numbers!'));
}
}
callback();
};
return (
<div className={styles.base}>
{/* 头部组件 */}
......@@ -94,19 +107,23 @@ const UsersAdd = (props: any) => {
<Form.Item>
<Input.Group>
<div className={styles.box2item3}>
<Form.Item name="buildingNumber" noStyle rules={[{ validator: checkData }]}>
<Input placeholder="Building" style={{ width: 94 }} />
<Form.Item name="buildingNumber" rules={[{ validator: checkData1 }]}>
<Input placeholder="BLK" style={{ width: 94 }} />
</Form.Item>
</div>
<div className={styles.box2item4}>#</div>
<div className={styles.box2item5}>
<Form.Item name="floorNumber" noStyle rules={[{ validator: checkData }]}>
<Form.Item name="floorNumber" rules={[{ validator: checkData1 }]}>
<Input placeholder="Floor" style={{ width: 80 }} />
</Form.Item>
</div>
<div className={styles.box2item6}>——</div>
<div className={styles.box2item7}>
<Form.Item name="roomNumber" noStyle rules={[{ validator: checkData }]}>
<Form.Item
name="roomNumber"
rules={[{ validator: checkData }]}
style={{ width: 260 }}
>
<Input placeholder="Room" style={{ width: 112 }} />
</Form.Item>
</div>
......
......@@ -90,7 +90,7 @@ const ServiceProviderManagement = (props: any) => {
disabled={record.enable == 'Deregistered' ? true : false}
onClick={goToEdit.bind(this, record)}
>
edit
Edit
</a>
</Space>
),
......@@ -192,7 +192,7 @@ const ServiceProviderManagement = (props: any) => {
for (let items in tmp) {
switch (tmp[items].enable) {
case 0:
tmp[items].enable = 'normal';
tmp[items].enable = 'Normal';
break;
case 1:
tmp[items].enable = 'Deregistered';
......
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