Commit feb9d58f authored by Sixiang_Zzb's avatar Sixiang_Zzb

LIFE用户管理模块,服务商模块,物业费模块bug处理

parent d411c48b
...@@ -331,7 +331,7 @@ class SelectOptions extends React.Component { ...@@ -331,7 +331,7 @@ class SelectOptions extends React.Component {
{this.props.single != null ? null : ( {this.props.single != null ? null : (
<> <>
<Checkbox <Checkbox
style={{ position: 'absolute', right: 100 }} style={{ position: 'absolute', right: 120 }}
indeterminate={this.state.indeterminate} indeterminate={this.state.indeterminate}
onChange={this.onCheckAllChange} onChange={this.onCheckAllChange}
checked={this.state.checkAll} checked={this.state.checkAll}
......
...@@ -9,6 +9,7 @@ export default { ...@@ -9,6 +9,7 @@ export default {
Data: null, Data: null,
CurDataFollow: null, CurDataFollow: null,
SaveChooseData: null, SaveChooseData: null,
CurData: null,
}, },
reducers: { reducers: {
...@@ -28,6 +29,10 @@ export default { ...@@ -28,6 +29,10 @@ export default {
returnSaveChooseData(state, { SaveChooseData }) { returnSaveChooseData(state, { SaveChooseData }) {
return { ...state, SaveChooseData }; return { ...state, SaveChooseData };
}, },
returnCurData(state, CurData) {
console.log(CurData);
return { ...state, CurData };
},
}, },
effects: { effects: {
...@@ -51,10 +56,16 @@ export default { ...@@ -51,10 +56,16 @@ export default {
const resp = yield call(service.TosTosServiceProviderSave, playload); const resp = yield call(service.TosTosServiceProviderSave, playload);
console.log(resp); console.log(resp);
if (resp.code == 500) { if (resp.code == 500) {
window.location.href = '/500'; let CurData = false;
yield put({ type: 'returnCurData' }, CurData);
message.error('Creation failed. Please try again!');
// window.location.href = '/500';
} else { } else {
message.success('operator success!', 2); let CurData = true;
window.location.href = '/UserManagement/ServiceProviderManagement'; yield put({ type: 'returnCurData' }, CurData);
message.success('operator success!', 1.5, () => {
window.location.href = '/UserManagement/ServiceProviderManagement';
});
} }
}, },
......
...@@ -10,7 +10,7 @@ import { render } from 'react-dom'; ...@@ -10,7 +10,7 @@ import { render } from 'react-dom';
import { Document } from 'react-pdf/dist/entry.webpack'; import { Document } from 'react-pdf/dist/entry.webpack';
import { stringSplit } from '../../utils/string'; import { stringSplit } from '../../utils/string';
import { timestampToTime2 } from '../../utils/time'; import { timestampToTime } from '../../utils/time';
import TitleBack from '../../components/TitleBack/TitleBack'; import TitleBack from '../../components/TitleBack/TitleBack';
...@@ -49,13 +49,13 @@ const ChargeDetail = (props: any) => { ...@@ -49,13 +49,13 @@ const ChargeDetail = (props: any) => {
{CurData ? ( {CurData ? (
<> <>
<TitleBack <TitleBack
title="Payment Settings" title="Payment Record Details"
sublist={['Upload Time ' + timestampToTime2(CurData.updateTime.time)]} sublist={['Upload Time ' + timestampToTime(CurData.createTime.time)]}
/> />
<div className={styles.box2}> <div className={styles.box2}>
<div className={styles.time1}>uploadTime : </div> <div className={styles.time1}>UploadTime : </div>
<div className={styles.time2}>01-01-2020</div> <div className={styles.time2}>{timestampToTime(CurData.createTime.time)}</div>
<div className={styles.item21}>Project (community)</div> <div className={styles.item21}>Project (community)</div>
<div className={styles.item22}>{CurData.communityName}</div> <div className={styles.item22}>{CurData.communityName}</div>
<div className={styles.item23}>Street name</div> <div className={styles.item23}>Street name</div>
......
...@@ -8,7 +8,7 @@ import { Link, useIntl, connect, Dispatch, history } from 'umi'; ...@@ -8,7 +8,7 @@ import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { timestampToTime } from '../../utils/time'; import { timestampToTime } from '../../utils/time';
import { values } from 'lodash'; import { values } from 'lodash';
import { filterObj, urlEncode } from '@/utils/method'; import { filterObj, urlEncode, filterObjbyTg } from '@/utils/method';
import TitleSearch from '../../components/TitleSearch/TitleSearch'; import TitleSearch from '../../components/TitleSearch/TitleSearch';
...@@ -44,6 +44,7 @@ const ChargeManager = (props: any) => { ...@@ -44,6 +44,7 @@ const ChargeManager = (props: any) => {
}; };
useEffect(() => { useEffect(() => {
console.log(location.query);
if (location.query) { if (location.query) {
readyData = { readyData = {
...readyData, ...readyData,
...@@ -64,15 +65,11 @@ const ChargeManager = (props: any) => { ...@@ -64,15 +65,11 @@ const ChargeManager = (props: any) => {
}, [Data]); }, [Data]);
const TitleSearchContent = (comment: any) => { const TitleSearchContent = (comment: any) => {
history.push( console.log(comment);
location.pathname + readyData.communityName = comment.communityName;
urlEncode( let tmp = filterObjbyTg(comment, ['communityName', 'tosOwnerName']);
filterObj({ tmp['pageNum'] = 1;
...comment, history.push(location.pathname + urlEncode(tmp));
pageNum: 1,
}),
),
);
}; };
const changePage = (values: any) => { const changePage = (values: any) => {
...@@ -86,7 +83,13 @@ const ChargeManager = (props: any) => { ...@@ -86,7 +83,13 @@ const ChargeManager = (props: any) => {
const columns = [ const columns = [
{ title: username, dataIndex: 'tosOwnerName' }, { title: username, dataIndex: 'tosOwnerName' },
{ title: project, dataIndex: 'communityName' }, { title: project, dataIndex: 'communityName' },
{ title: unit, dataIndex: 'buildingNumber' }, {
title: unit,
dataIndex: 'buildingNumber',
render: (text: any, record: any) => (
<div>{record.buildingNumber + '#' + record.floorNumber + '-' + record.roomNumber}</div>
),
},
{ {
title: submissionTime, title: submissionTime,
render: (text: any, record: any) => ( render: (text: any, record: any) => (
...@@ -112,8 +115,9 @@ const ChargeManager = (props: any) => { ...@@ -112,8 +115,9 @@ const ChargeManager = (props: any) => {
return ( return (
<div className={styles.base}> <div className={styles.base}>
<TitleSearch <TitleSearch
listkey={['tosOwnerName', 'communityName']} listkey={['tosOwnerName']}
list={['tosOwnerName', 'communityName']} list={['TosOwnerName']}
communitySelect={true}
onSubmit={TitleSearchContent} onSubmit={TitleSearchContent}
defaultValue={{ ...readyData }} defaultValue={{ ...readyData }}
/> />
......
...@@ -2,173 +2,174 @@ ...@@ -2,173 +2,174 @@
//基石 //基石
.base { .base {
width: 100%; width: 100%;
background-color: #ffffff; background-color: #ffffff;
padding: 34px; padding: 34px;
min-width: 1020px; min-width: 1020px;
} }
//头部组件 //头部组件
.box{ .box {
width: 100%; width: 100%;
height: 64px; height: 64px;
position: relative; position: relative;
} }
.item1{ .item1 {
position: absolute; position: absolute;
width: 400px; width: 400px;
text-indent: 15px; text-indent: 15px;
border-left: 5px solid rgba(24,144,255,1); border-left: 5px solid rgba(24, 144, 255, 1);
font-family:'Source Han Sans CN'; font-family: 'Source Han Sans CN';
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
color: #000000; color: #000000;
}
.item3 {
width: 80px;
height: 32px;
position: absolute;
right: 0;
outline: none;
background: none;
cursor: pointer;
border: 1px solid rgba(217, 217, 217, 1);
border-radius: 2px;
}
.bigbox {
position: relative;
}
.box0 {
position: absolute;
right: 0;
}
.box0item1 {
width: 108px;
height: 108px;
background-color: #e7e7e7;
}
.box0item2 {
width: 108px;
text-align: center;
}
.box1 {
width: 100%;
height: 34px;
position: relative;
line-height: 34px;
margin-bottom: 28px;
}
.box1item1 {
position: absolute;
}
.box1item2 {
position: absolute;
left: 196px;
} }
.item3{
width:80px;
height: 32px;
position: absolute;
right: 0;
outline: none;
background:none;
cursor: pointer;
border:1px solid rgba(217,217,217,1); // 线栏
border-radius:2px; .line {
width: 100%;
height: 1px;
border-top: 1px solid rgba(217, 217, 217, 1);
margin-top: 28px;
margin-bottom: 28px;
} }
.bigbox{ .box2 {
position: relative; width: 100%;
} height: 34px;
.box0{ position: relative;
position: absolute; line-height: 34px;
right: 0; margin-bottom: 28px;
}
.box0item1{
width:108px;
height:108px;
background-color: #e7e7e7;
}
.box0item2{
width:108px;
text-align: center;
}
.box1{
width: 100%;
height: 34px;
position: relative;
line-height: 34px;
margin-bottom: 28px;
} }
.box1item1{ .box2item1 {
position: absolute; position: absolute;
} }
.box1item2{ .box2item2 {
position: absolute; position: absolute;
left: 196px; left: 196px;
} }
.box3 {
// 线栏 width: 100%;
.line{ height: 34px;
width: 100%; position: relative;
height: 1px; line-height: 34px;
border-top: 1px solid rgba(217,217,217,1); margin-bottom: 28px;
margin-top: 28px;
margin-bottom: 28px;
} }
.box3item1 {
position: absolute;
.box2{
width: 100%;
height: 34px;
position: relative;
line-height: 34px;
margin-bottom: 28px;
} }
.box2item1{ .box3item2 {
position: absolute; position: absolute;
} left: 196px;
.box2item2{
position: absolute;
left: 196px;
} }
.box3{ .box4 {
width: 100%; width: 100%;
height: 34px; height: 34px;
position: relative; position: relative;
line-height: 34px; line-height: 34px;
margin-bottom: 28px; margin-bottom: 28px;
} }
.box3item1{ .box4item1 {
position: absolute; position: absolute;
} }
.box3item2{ .box4item2 {
position: absolute; position: absolute;
left: 196px; left: 196px;
} }
.box5 {
.box4{ width: 100%;
width: 100%; height: 34px;
height: 34px; position: relative;
position: relative; line-height: 34px;
line-height: 34px; margin-bottom: 28px;
margin-bottom: 28px;
} }
.box4item1{ .box5item1 {
position: absolute; position: absolute;
} }
.box4item2{ .box5item2 {
position: absolute; position: absolute;
left: 196px; left: 196px;
} }
.box5{ .box6 {
width: 100%; width: 100%;
height: 34px; height: 34px;
position: relative; position: relative;
line-height: 34px; line-height: 34px;
margin-bottom: 28px; margin-bottom: 28px;
} }
.box5item1{ .box6item1 {
position: absolute; position: absolute;
} }
.box5item2{ .box6item2 {
position: absolute; position: absolute;
left: 196px; left: 196px;
} }
.box7 {
.box6{ width: 100%;
width: 100%; height: 34px;
height: 34px; position: relative;
position: relative; line-height: 34px;
line-height: 34px; margin-bottom: 28px;
margin-bottom: 28px;
} }
.box6item1{ .box7item1 {
position: absolute; position: absolute;
} }
.box6item2{ .box7item2 {
position: absolute; position: absolute;
left: 196px; left: 196px;
} }
.box7{ .writeOff {
width: 100%; position: absolute;
height: 34px; top: 100px;
position: relative; right: 200px;
line-height: 34px;
margin-bottom: 28px;
}
.box7item1{
position: absolute;
}
.box7item2{
position: absolute;
left: 196px;
} }
...@@ -36,10 +36,6 @@ const Detail = (props: any) => { ...@@ -36,10 +36,6 @@ const Detail = (props: any) => {
total: CurDataFollow != null ? CurDataFollow.length : CurDataFollow, total: CurDataFollow != null ? CurDataFollow.length : CurDataFollow,
}; };
const printContent = (comment: any) => {
console.log(comment);
};
const columns = [ const columns = [
{ title: 'User Name', dataIndex: 'saferName' }, { title: 'User Name', dataIndex: 'saferName' },
{ title: 'Service Community', dataIndex: 'projectName' }, { title: 'Service Community', dataIndex: 'projectName' },
...@@ -59,11 +55,15 @@ const Detail = (props: any) => { ...@@ -59,11 +55,15 @@ const Detail = (props: any) => {
return ( return (
<div className={styles.base}> <div className={styles.base}>
<TitleBack title="Service Provider Details" /> <TitleBack title="Service Provider Details" />
<div className={styles.writeOff}>
<Button type="primary" danger>
Write Off
</Button>
</div>
<div className={styles.bigbox}> <div className={styles.bigbox}>
<div className={styles.box0}> <div className={styles.box0}>
<div className={styles.box0item1}></div> <div className={styles.box0item1}></div>
<div className={styles.box0item2}>{SaveChooseData.serviceCommunityList}</div> {/* <div className={styles.box0item2}>{SaveChooseData.serviceCommunityList}</div> */}
</div> </div>
<div className={styles.box1}> <div className={styles.box1}>
<div className={styles.box1item1}>Company Name</div> <div className={styles.box1item1}>Company Name</div>
...@@ -83,7 +83,7 @@ const Detail = (props: any) => { ...@@ -83,7 +83,7 @@ const Detail = (props: any) => {
<div className={styles.box4}> <div className={styles.box4}>
<div className={styles.box4item1}>Contact Details</div> <div className={styles.box4item1}>Contact Details</div>
<div className={styles.box4item2}> <div className={styles.box4item2}>
{SaveChooseData.contactPhone} {SaveChooseData.contactEmail} {SaveChooseData.contactPhone} &nbsp;&nbsp;&nbsp;&nbsp; {SaveChooseData.contactEmail}
</div> </div>
</div> </div>
...@@ -96,11 +96,7 @@ const Detail = (props: any) => { ...@@ -96,11 +96,7 @@ const Detail = (props: any) => {
<div className={styles.box1item1}>Service Community</div> <div className={styles.box1item1}>Service Community</div>
</div> </div>
{SaveChooseData.serviceCommunityList != null ? ( {SaveChooseData.serviceCommunityList != null ? (
<ShowOptions <ShowOptions list={SaveChooseData.serviceCommunityList} defaultValue={'Put It Away'} />
list={SaveChooseData.serviceCommunityList}
defaultValue={'Put It Away'}
onSubmit={printContent}
/>
) : ( ) : (
<></> <></>
)} )}
......
...@@ -2,176 +2,172 @@ ...@@ -2,176 +2,172 @@
//基石 //基石
.base { .base {
width: 100%; width: 100%;
background-color: #ffffff; background-color: #ffffff;
padding: 34px; padding: 34px;
min-width: 1020px; min-width: 1020px;
} }
//头部组件 //头部组件
.box{ .box {
width: 100%; width: 100%;
height: 64px; height: 64px;
position: relative; position: relative;
} }
.item1{ .item1 {
position: absolute; position: absolute;
width: 400px; width: 400px;
text-indent: 8px; text-indent: 8px;
border-left: 5px solid rgba(24,144,255,1); border-left: 5px solid rgba(24, 144, 255, 1);
font-family:'Source Han Sans CN'; font-family: 'Source Han Sans CN';
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
color: #000000; color: #000000;
} }
.item3{ .item3 {
width:80px; width: 80px;
height: 32px; height: 32px;
position: absolute; position: absolute;
right: 0; right: 0;
outline: none; outline: none;
background:none; background: none;
cursor: pointer; cursor: pointer;
border:1px solid rgba(217,217,217,1); border: 1px solid rgba(217, 217, 217, 1);
border-radius:2px; border-radius: 2px;
} }
.box1 {
.box1{ width: 100%;
width: 100%; height: 34px;
height: 34px; position: relative;
position: relative; line-height: 34px;
line-height: 34px;
} }
.box1item1{ .box1item1 {
position: absolute; position: absolute;
} }
.box1item2{ .box1item2 {
position: absolute; position: absolute;
left: 154px; left: 154px;
} }
.box1item3{ .box1item3 {
position: absolute; position: absolute;
left: 529px; left: 529px;
} }
.box1item4{ .box1item4 {
position: absolute; position: absolute;
left: 650px; left: 650px;
} }
// 线栏 // 线栏
.line{ .line {
width: 100%; width: 100%;
height: 1px; height: 1px;
border-top: 1px solid rgba(217,217,217,1); border-top: 1px solid rgba(217, 217, 217, 1);
margin-top: 28px; margin-top: 28px;
margin-bottom: 28px; margin-bottom: 28px;
} }
.box2{ .box2 {
width: 100%; width: 100%;
height: 34px; height: 34px;
position: relative; position: relative;
line-height: 34px; line-height: 34px;
margin-bottom: 28px; margin-bottom: 28px;
margin-top: 28px; margin-top: 28px;
} }
.box2item1{ .box2item1 {
position: absolute; position: absolute;
} }
.box2item2{ .box2item2 {
position: absolute; position: absolute;
left: 192px; left: 192px;
} }
.box3{ .box3 {
width: 100%; width: 100%;
height: 34px; height: 34px;
position: relative; position: relative;
line-height: 34px; line-height: 34px;
margin-bottom: 28px; margin-bottom: 28px;
} }
.box3item1{ .box3item1 {
position: absolute; position: absolute;
} }
.box3item2{ .box3item2 {
position: absolute; position: absolute;
left: 189px; left: 189px;
} }
.box4{ .box4 {
width: 100%; width: 100%;
height: 34px; height: 34px;
position: relative; position: relative;
line-height: 34px; line-height: 34px;
} }
.box4item1{ .box4item1 {
position: absolute; position: absolute;
} }
.box4item2{ .box4item2 {
position: absolute; position: absolute;
left: 189px; left: 189px;
} }
.box4item3{ .box4item3 {
position: absolute; position: absolute;
left: 405px; left: 455px;
} }
.box5{ .box5 {
width: 100%; width: 100%;
height: 34px; height: 34px;
position: relative; position: relative;
line-height: 34px; line-height: 34px;
} }
.box5item1{ .box5item1 {
position: absolute; position: absolute;
} }
.box5item2{ .box5item2 {
position: absolute; position: absolute;
left: 189px; left: 189px;
} }
.box5item3{ .box5item3 {
position: absolute; position: absolute;
left: 405px; left: 405px;
} }
.box6 {
.box6{ width: 100%;
width: 100%; height: 34px;
height: 34px; position: relative;
position: relative; line-height: 34px;
line-height: 34px;
} }
.box6item1{ .box6item1 {
position: absolute; position: absolute;
} }
.box6item2{ .box6item2 {
position: absolute; position: absolute;
left: 189px; left: 189px;
} }
.box6item3{ .box6item3 {
position: absolute; position: absolute;
left: 405px; left: 405px;
} }
.box7 {
.box7{ width: 100%;
width: 100%; height: 34px;
height: 34px; position: relative;
position: relative; line-height: 34px;
line-height: 34px; }
} .box7item1 {
.box7item1{ position: absolute;
position: absolute; }
} .box7item2 {
.box7item2{ position: absolute;
position: absolute; left: 189px;
left: 189px; }
} .box7item3 {
.box7item3{ position: absolute;
position: absolute; left: 405px;
left: 405px;
} }
...@@ -41,6 +41,13 @@ const Edit = (props: any) => { ...@@ -41,6 +41,13 @@ const Edit = (props: any) => {
} }
}, [DataServices]); }, [DataServices]);
useEffect(() => {
console.log(CurData);
if (CurData != null) {
setload(false);
}
}, [CurData]);
useEffect(() => { useEffect(() => {
if (SaveChooseData != null) { if (SaveChooseData != null) {
console.log(SaveChooseData); console.log(SaveChooseData);
...@@ -63,6 +70,8 @@ const Edit = (props: any) => { ...@@ -63,6 +70,8 @@ const Edit = (props: any) => {
val.serviceCommunityList = CList; val.serviceCommunityList = CList;
val.creator = 'admin'; val.creator = 'admin';
val.updater = 'admin'; val.updater = 'admin';
console.log(val);
return;
setload(true); setload(true);
TosTosServiceProviderSave(val); TosTosServiceProviderSave(val);
}; };
...@@ -70,10 +79,12 @@ const Edit = (props: any) => { ...@@ -70,10 +79,12 @@ const Edit = (props: any) => {
return ( return (
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件v1.2 */} {/* 头部组件v1.2 */}
<TitleBack title="Edit Service Provider" /> <TitleBack
title={SaveChooseData !== null ? 'Edit Service Provider' : 'Add service provider'}
/>
<Form ref={formRef} name="basic" onFinish={onFinish}> <Form ref={formRef} name="basic" onFinish={onFinish}>
<Spin spinning={load} tip="In the submission,Please Wait..."> <Spin spinning={load}>
<div className={styles.box1}> <div className={styles.box1}>
<div className={styles.box1item1}>Company Name</div> <div className={styles.box1item1}>Company Name</div>
<div className={styles.box1item2}> <div className={styles.box1item2}>
...@@ -140,6 +151,10 @@ const Edit = (props: any) => { ...@@ -140,6 +151,10 @@ const Edit = (props: any) => {
required: true, required: true,
message: 'Please enter the name of the person in charge!', message: 'Please enter the name of the person in charge!',
}, },
{
len: 2,
message: 'It must be between 2 and 30',
},
]} ]}
> >
<Input style={{ width: 200 }} placeholder="Please enter a name" /> <Input style={{ width: 200 }} placeholder="Please enter a name" />
...@@ -150,7 +165,16 @@ const Edit = (props: any) => { ...@@ -150,7 +165,16 @@ const Edit = (props: any) => {
<div className={styles.box4}> <div className={styles.box4}>
<div className={styles.box4item1}>Contact Details</div> <div className={styles.box4item1}>Contact Details</div>
<div className={styles.box4item2}> <div className={styles.box4item2}>
<Form.Item name="contactPhone"> <Form.Item
name="contactPhone"
rules={[
{
pattern: /^(\d{8}|1[0-9]{10})$/,
message: 'ncorrect format of mobile phone number',
whitespace: true,
},
]}
>
<Input style={{ width: 200 }} placeholder="Telephone" /> <Input style={{ width: 200 }} placeholder="Telephone" />
</Form.Item> </Form.Item>
</div> </div>
...@@ -186,6 +210,8 @@ function mapStateToProps(state: any) { ...@@ -186,6 +210,8 @@ function mapStateToProps(state: any) {
const { CurData, SaveChooseData } = state.ServiceProvider; const { CurData, SaveChooseData } = state.ServiceProvider;
const { DataServices } = state.User; const { DataServices } = state.User;
const { CommunityList } = state.Init; const { CommunityList } = state.Init;
console.log(state.ServiceProvider);
console.log(CurData);
return { return {
CurData, CurData,
SaveChooseData, SaveChooseData,
......
...@@ -25,6 +25,13 @@ let readyData: any = { ...@@ -25,6 +25,13 @@ let readyData: any = {
// 节流阀 // 节流阀
let flag = false; let flag = false;
const services = [
[0, 'Security Guards'],
[0, 'Accountant'],
[0, 'repair'],
[0, 'Clean'],
];
const ServiceProviderManagement = (props: any) => { const ServiceProviderManagement = (props: any) => {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
...@@ -88,9 +95,11 @@ const ServiceProviderManagement = (props: any) => { ...@@ -88,9 +95,11 @@ const ServiceProviderManagement = (props: any) => {
useEffect(() => { useEffect(() => {
if (DataServices) { if (DataServices) {
options = DataServices.data.serviceScopeList.map((v: string, i: number) => { console.log(DataServices);
return [i, v];
}); // options = DataServices.data.serviceScopeList.map((v: string, i: number) => {
// return [i, v];
// });
} }
}, [DataServices]); }, [DataServices]);
...@@ -179,16 +188,16 @@ const ServiceProviderManagement = (props: any) => { ...@@ -179,16 +188,16 @@ const ServiceProviderManagement = (props: any) => {
for (let items1 in tmp[items].serviceScopeList) { for (let items1 in tmp[items].serviceScopeList) {
switch (tmp[items].serviceScopeList[items1]) { switch (tmp[items].serviceScopeList[items1]) {
case '0': case '0':
tmp[items].serviceScopeList[items1] = '保安'; tmp[items].serviceScopeList[items1] = 'Security Guards';
break; break;
case '1': case '1':
tmp[items].serviceScopeList[items1] = '会计'; tmp[items].serviceScopeList[items1] = 'Accountant';
break; break;
case '2': case '2':
tmp[items].serviceScopeList[items1] = '维修'; tmp[items].serviceScopeList[items1] = 'repair';
break; break;
case '3': case '3':
tmp[items].serviceScopeList[items1] = '清洁'; tmp[items].serviceScopeList[items1] = 'Clean';
break; break;
} }
} }
...@@ -211,8 +220,8 @@ const ServiceProviderManagement = (props: any) => { ...@@ -211,8 +220,8 @@ const ServiceProviderManagement = (props: any) => {
list={['Service Provider']} list={['Service Provider']}
status={[ status={[
{ {
name: ['status', '服务范围'], name: ['status', 'services'],
data: [[null, '全部'], ...options], data: [[null, 'All'], ...options],
}, },
]} ]}
community={'serviceCommunityList'} community={'serviceCommunityList'}
......
...@@ -22,14 +22,17 @@ interface LoginProps { ...@@ -22,14 +22,17 @@ interface LoginProps {
submitting?: boolean; submitting?: boolean;
} }
let flag = false;
const Login: React.FC<LoginProps> = (props) => { const Login: React.FC<LoginProps> = (props) => {
const { userLogin = {}, submitting } = props; const { userLogin = {}, submitting } = props;
const { status, type: loginType } = userLogin; const { status, type: loginType } = userLogin;
const [type, setType] = useState<string>('account'); const [type, setType] = useState<string>('account');
// const [userName, setUsername] = useState(''); const [userName, setUsername] = useState('');
// const [password, setPasswd] = useState(''); // const [password, setPasswd] = useState('');
const [forgetflag, setForgetFlag] = useState(false); const [forgetflag, setForgetFlag] = useState(false);
const { dispatch } = props; const { dispatch } = props;
const handleSubmit = (values: LoginParamsType) => { const handleSubmit = (values: LoginParamsType) => {
console.log(values); console.log(values);
...@@ -37,7 +40,7 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -37,7 +40,7 @@ const Login: React.FC<LoginProps> = (props) => {
console.log('验证码!'); console.log('验证码!');
} }
if (values.userName !== '' && values.password !== '') { if (values.userName && values.password) {
dispatch({ dispatch({
type: 'login/login', type: 'login/login',
payload: { ...values }, payload: { ...values },
...@@ -46,9 +49,9 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -46,9 +49,9 @@ const Login: React.FC<LoginProps> = (props) => {
message.error('The username or password cannot be empty!'); message.error('The username or password cannot be empty!');
} }
}; };
// const usernameHandle = (e: any) => { const usernameHandle = (e: any) => {
// setUsername(e.target.value); setUsername(e.target.value);
// }; };
// const passwdHandle = (e: any) => { // const passwdHandle = (e: any) => {
// setPasswd(e.target.value); // setPasswd(e.target.value);
// }; // };
...@@ -67,7 +70,7 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -67,7 +70,7 @@ const Login: React.FC<LoginProps> = (props) => {
/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(userName) /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(userName)
) { ) {
console.log('邮箱正确!'); console.log('邮箱正确!');
console.log(Captcha); flag = true;
} else { } else {
message.warning('Please enter the correct email address!'); message.warning('Please enter the correct email address!');
} }
...@@ -81,6 +84,20 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -81,6 +84,20 @@ const Login: React.FC<LoginProps> = (props) => {
} }
}, [location.pathname]); }, [location.pathname]);
const timeOut = () => {
if (flag) {
let number = 60;
let timeId = setTimeout(() => {
number--;
if (number === 0) {
flag = false;
clearTimeout(timeId);
}
}, 60000);
return number;
}
};
return ( return (
<div> <div>
{/* {forgetflag ? ( {/* {forgetflag ? (
...@@ -136,7 +153,7 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -136,7 +153,7 @@ const Login: React.FC<LoginProps> = (props) => {
{forgetflag ? 'Please enter email address' : 'Account Name'} {forgetflag ? 'Please enter email address' : 'Account Name'}
</div> </div>
<Form.Item name="userName"> <Form.Item name="userName">
<input className={styles.input} /> <input className={styles.input} onChange={usernameHandle} />
</Form.Item> </Form.Item>
<div className={styles.box1}> <div className={styles.box1}>
{forgetflag ? 'Please enter a verification code' : 'Password'} {forgetflag ? 'Please enter a verification code' : 'Password'}
...@@ -145,7 +162,7 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -145,7 +162,7 @@ const Login: React.FC<LoginProps> = (props) => {
<div className={styles.box2}> <div className={styles.box2}>
<input className={styles.input5} /> <input className={styles.input5} />
<div className={styles.button2} style={{ float: 'right' }} onClick={handleSend}> <div className={styles.button2} style={{ float: 'right' }} onClick={handleSend}>
Send {flag ? timeOut : 'Send'}
</div> </div>
</div> </div>
) : ( ) : (
......
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