Commit a2888ae6 authored by Sixiang_Zzb's avatar Sixiang_Zzb

测试bug修复

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