Commit a2888ae6 authored by Sixiang_Zzb's avatar Sixiang_Zzb

测试bug修复

parent 254019ff
...@@ -124,9 +124,9 @@ const PictureOptionsRow = (props: any) => { ...@@ -124,9 +124,9 @@ const PictureOptionsRow = (props: any) => {
message.error('You can only upload JPG/PNG file!'); message.error('You can only upload JPG/PNG file!');
} }
// 文件大小判断 // 文件大小判断
const isLt2M = file.size / 1024 / 1024 < 2; const isLt2M = file.size / 1024 / 1024 <= 2;
if (!isLt2M) { if (!isLt2M) {
message.error('Image must smaller than 2MB!'); message.error('Image must be less than or equal to 2MB!');
} }
return isJpgOrPng && isLt2M; return isJpgOrPng && isLt2M;
} }
......
...@@ -34,13 +34,13 @@ const TableShow = (props: any) => { ...@@ -34,13 +34,13 @@ const TableShow = (props: any) => {
// const user_type_status = ["Registered", "Unregistered", "Cancellation"] // const user_type_status = ["Registered", "Unregistered", "Cancellation"]
const user_type_status = ['Normal', 'Normal', 'Cancellation']; const user_type_status = ['Normal', 'Normal', 'Cancellation'];
const user_code = ['Not Used', 'Used']; const user_code = ['Activation Code Is Inactive', 'Activation Code Has Been Used'];
const key = objectColumns([ const key = objectColumns([
['User Name', 'owner_family_name'], ['User Name', 'owner_family_name'],
['Contact Details', 'owner_family_phone'], ['Contact Details', 'owner_family_phone'],
['Email', 'owner_family_email'], ['Email', 'owner_family_email'],
[ [
'RelationShip', 'User Type',
null, null,
(text: any, record: any) => ( (text: any, record: any) => (
<Space size="middle"> <Space size="middle">
...@@ -71,7 +71,7 @@ const TableShow = (props: any) => { ...@@ -71,7 +71,7 @@ const TableShow = (props: any) => {
{dataRow.map((item: any, index: number) => { {dataRow.map((item: any, index: number) => {
return ( return (
<TabPane tab={item.name} key={index}> <TabPane tab={item.name} key={index}>
<Row gutter={16}> <Row gutter={16} style={{ marginLeft: 9 }}>
<Col>Address:</Col> <Col>Address:</Col>
<Col> <Col>
{item.owner.buildingNumber + {item.owner.buildingNumber +
...@@ -93,7 +93,7 @@ const TableShow = (props: any) => { ...@@ -93,7 +93,7 @@ const TableShow = (props: any) => {
return ( return (
<div style={{ height: 80, position: 'relative' }}> <div style={{ height: 80, position: 'relative' }}>
<div style={{ position: 'absolute', left: 0, bottom: 16 }}> <div style={{ position: 'absolute', left: 0, bottom: 16 }}>
<Row gutter={32}> <Row gutter={18}>
<Col>Unit No:</Col> <Col>Unit No:</Col>
<Col>{unit.living}</Col> <Col>{unit.living}</Col>
</Row> </Row>
...@@ -119,13 +119,13 @@ const TableShow = (props: any) => { ...@@ -119,13 +119,13 @@ const TableShow = (props: any) => {
pagination={false} pagination={false}
></Table> ></Table>
</Col> </Col>
<Col> <Col style={{ textAlign: 'center' }}>
<Row>
<img width={80} height={80} src={unit.imgUrl} />
</Row>
<Row style={{ marginTop: 8 }}> <Row style={{ marginTop: 8 }}>
<div style={{ width: 80, textAlign: 'center' }}> <div style={{ textAlign: 'center' }}>
{item.owner.cdkCode}({user_code[item.owner.cdkStatus]}) <img width={80} height={80} src={unit.imgUrl} />
<br />
{item.owner.cdkCode}
<br />({user_code[item.owner.cdkStatus]})
</div> </div>
</Row> </Row>
</Col> </Col>
......
...@@ -52,8 +52,8 @@ export default { ...@@ -52,8 +52,8 @@ export default {
'menu.usemanagement': 'User Management', 'menu.usemanagement': 'User Management',
'menu.monitoringcenter': 'Monitoring Center', 'menu.monitoringcenter': 'Monitoring Center',
'menu.usemanagement.lifeusers': 'LIFE Users', 'menu.usemanagement.lifeusers': 'LIFE User Management',
'menu.usemanagement.serviceproviders': 'Service Providers', 'menu.usemanagement.serviceproviders': 'Service Provider Management',
'menu.propertymanagement': 'Property Management', 'menu.propertymanagement': 'Property Management',
'menu.commercialservice': 'Commercial Service', 'menu.commercialservice': 'Commercial Service',
'menu.commercialservice.communitymaintenance': 'Community maintenance', 'menu.commercialservice.communitymaintenance': 'Community maintenance',
......
...@@ -47,7 +47,7 @@ const Detail = (props: any) => { ...@@ -47,7 +47,7 @@ const Detail = (props: any) => {
{ title: 'Job Title', dataIndex: 'cdkCode' }, { title: 'Job Title', dataIndex: 'cdkCode' },
{ title: 'User Status', dataIndex: 'cdkStatus' }, { title: 'User Status', dataIndex: 'cdkStatus' },
{ {
title: 'actions', title: 'Actions',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Space size="middle"> <Space size="middle">
{' '} {' '}
...@@ -150,10 +150,7 @@ const Detail = (props: any) => { ...@@ -150,10 +150,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={'Close'} />
list={SaveChooseData.serviceCommunityList}
defaultValue={'Put It Away'}
/>
) : ( ) : (
<></> <></>
)} )}
......
...@@ -101,7 +101,7 @@ const Edit = (props: any) => { ...@@ -101,7 +101,7 @@ const Edit = (props: any) => {
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件v1.2 */} {/* 头部组件v1.2 */}
<TitleBack <TitleBack
title={SaveChooseData !== null ? 'Edit Service Provider' : 'Add service provider'} title={SaveChooseData !== null ? 'Edit Service Provider' : 'Create New Service Provider'}
/> />
<Form ref={formRef} name="basic" onFinish={onFinish}> <Form ref={formRef} name="basic" onFinish={onFinish}>
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import styles from './Guard.less'; import styles from './Guard.less';
import { Input ,Menu,Table,Space,Pagination,Tooltip, Button } from 'antd'; import { Input, Menu, Table, Space, Pagination, Tooltip, Button } from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi'; import { Link, useIntl, connect, Dispatch } from 'umi';
...@@ -10,45 +10,53 @@ import TitleGet from '../../../components/TitleGet/TitleGet'; ...@@ -10,45 +10,53 @@ import TitleGet from '../../../components/TitleGet/TitleGet';
import { timestampToTime } from '../../../utils/time'; import { timestampToTime } from '../../../utils/time';
const Guard = (props:any) => { const Guard = (props: any) => {
const { CurDataFollowDetail } = props;
const {CurDataFollowDetail} = props; console.log(CurDataFollowDetail);
return (
<div className={styles.base}>
const handleClickBtn = () => {};
<div className={styles.item0}><TitleGet title={"Edit Security Guard Account"}/></div> return (
<div className={styles.base}>
<div className={styles.item0}>
<TitleGet title={'Edit Security Guard Account'} />
</div>
<div className={styles.item0_1}>Status:Normal</div> <div className={styles.item0_1}>Status:Normal</div>
<div className={styles.item0_1}>Registration Date:{timestampToTime(CurDataFollowDetail.createTime.time)}</div> <div className={styles.item0_1}>
<div className={styles.item2}><BackButton/></div> Registration Date:
{/* {timestampToTime(CurDataFollowDetail.createTime.time)} */}
</div>
<div className={styles.item2}>
<BackButton />
</div>
<div className={styles.clear0}></div> <div className={styles.clear0}></div>
<div className={styles.item1}>Company Name</div> <div className={styles.item1}>Company Name</div>
<div className={styles.item1_1} >{CurDataFollowDetail.companyName}</div> <div className={styles.item1_1}>{CurDataFollowDetail.companyName}</div>
<div className={styles.clear1}></div> <div className={styles.clear1}></div>
<div className={styles.item1} >Full Name</div> <div className={styles.item1}>Full Name</div>
<div className={styles.item1_1} >{CurDataFollowDetail.saferName}</div> <div className={styles.item1_1}>{CurDataFollowDetail.saferName}</div>
<div className={styles.clear1} ></div> <div className={styles.clear1}></div>
<div className={styles.item1} >Contact Details</div> <div className={styles.item1}>Contact Details</div>
<div className={styles.item1_1} >{CurDataFollowDetail.saferPhone}</div> <div className={styles.item1_1}>{CurDataFollowDetail.saferPhone}</div>
<div className={styles.item1} style={{ marginLeft: 32,width:40}} >Email</div> <div className={styles.item1} style={{ marginLeft: 32, width: 40 }}>
<div className={styles.item1_1} >{CurDataFollowDetail.saferEmail}</div> Email
<div className={styles.clear1}></div> </div>
<div className={styles.item1_1}>{CurDataFollowDetail.saferEmail}</div>
<div className={styles.clear1}></div>
<Line /> <Line />
<Button>Cancellation</Button>
<Button onClick={handleClickBtn}>Cancellation</Button>
</div> </div>
); );
}; };
function mapStateToProps(state:any) { function mapStateToProps(state: any) {
const {CurDataFollowDetail } = state.ServiceProvider; const { CurDataFollowDetail } = state.ServiceProvider;
return { return {
CurDataFollowDetail, CurDataFollowDetail,
}; };
......
...@@ -77,6 +77,7 @@ const ServiceProviderManagement = (props: propsType) => { ...@@ -77,6 +77,7 @@ const ServiceProviderManagement = (props: propsType) => {
SaveChooseData(values); SaveChooseData(values);
history.push(location.pathname + '/Edit'); history.push(location.pathname + '/Edit');
}; };
const goToCreate = () => { const goToCreate = () => {
if (permissionArr.indexOf('8') < 0) { if (permissionArr.indexOf('8') < 0) {
message.error('No Permissions!!!', 3); message.error('No Permissions!!!', 3);
...@@ -85,13 +86,25 @@ const ServiceProviderManagement = (props: propsType) => { ...@@ -85,13 +86,25 @@ const ServiceProviderManagement = (props: propsType) => {
SaveChooseData(null); SaveChooseData(null);
history.push(location.pathname + '/Edit'); history.push(location.pathname + '/Edit');
}; };
const goToServices = () => { const goToServices = () => {
history.push(location.pathname + '/Services'); history.push(location.pathname + '/Services');
}; };
// 请求
const TosTosServiceProviderGet = () => {
if (readyData.serviceCommunityList.length === 0) {
readyData.serviceCommunityList = CommunityList;
}
dispatch({
type: 'ServiceProvider/TosTosServiceProviderGet',
playload: { ...readyData },
});
};
const columns = [ const columns = [
{ title: 'Service Provider', dataIndex: 'providerName' }, { title: 'Service Provider', dataIndex: 'providerName' },
{ title: 'contact Name', dataIndex: 'contactName' }, { title: 'Contact Name', dataIndex: 'contactName' },
{ {
title: 'Contacts', title: 'Contacts',
...@@ -142,17 +155,6 @@ const ServiceProviderManagement = (props: propsType) => { ...@@ -142,17 +155,6 @@ const ServiceProviderManagement = (props: propsType) => {
} }
}, [DataServices]); }, [DataServices]);
// 请求
const TosTosServiceProviderGet = () => {
if (readyData.serviceCommunityList.length === 0) {
readyData.serviceCommunityList = CommunityList;
}
dispatch({
type: 'ServiceProvider/TosTosServiceProviderGet',
playload: { ...readyData },
});
};
// 监听路由url // 监听路由url
useEffect(() => { useEffect(() => {
if (location.query) { if (location.query) {
...@@ -161,7 +163,7 @@ const ServiceProviderManagement = (props: propsType) => { ...@@ -161,7 +163,7 @@ const ServiceProviderManagement = (props: propsType) => {
...location.query, ...location.query,
}; };
} }
console.log(CommunityList, flag); // console.log(CommunityList, flag);
if (CommunityList && flag === false) { if (CommunityList && flag === false) {
flag = true; flag = true;
setLoading(true); setLoading(true);
...@@ -241,7 +243,7 @@ const ServiceProviderManagement = (props: propsType) => { ...@@ -241,7 +243,7 @@ const ServiceProviderManagement = (props: propsType) => {
list={['Service Provider']} list={['Service Provider']}
status={[ status={[
{ {
name: ['status', 'Services'], name: ['status', 'Services Available'],
data: [...options], data: [...options],
}, },
]} ]}
...@@ -249,11 +251,7 @@ const ServiceProviderManagement = (props: propsType) => { ...@@ -249,11 +251,7 @@ const ServiceProviderManagement = (props: propsType) => {
onSubmit={CallBackTitleSearch} onSubmit={CallBackTitleSearch}
defaultValue={{ defaultValue={{
providerName: readyData.providerName, providerName: readyData.providerName,
status: readyData.serviceScope // status:,
? parseInt(readyData.serviceScope) === 0
? 'SecurutyGuard'
: 'Accountant'
: null,
}} }}
checklist={ checklist={
readyData.serviceCommunityList.length !== 0 ? readyData.serviceCommunityList : null readyData.serviceCommunityList.length !== 0 ? readyData.serviceCommunityList : null
...@@ -263,7 +261,7 @@ const ServiceProviderManagement = (props: propsType) => { ...@@ -263,7 +261,7 @@ const ServiceProviderManagement = (props: propsType) => {
{/* 内容组件 */} {/* 内容组件 */}
<div className={styles.box2}> <div className={styles.box2}>
<button className={styles.buttonAdd2} onClick={goToServices}> <button className={styles.buttonAdd2} onClick={goToServices}>
Avail Services Services Available
</button> </button>
<button className={styles.buttonAdd} onClick={goToCreate}> <button className={styles.buttonAdd} onClick={goToCreate}>
Create New Create New
......
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