Commit 845174ed authored by Sixiang_Zzb's avatar Sixiang_Zzb

LIEF用户管理模块 修改

parent 8597cd71
import React, { useEffect } from 'react';
import styles from './index.less';
import { Row, Col, Table, Space, Tabs, Button } from 'antd';
const { TabPane } = Tabs
const { TabPane } = Tabs;
import { objectColumns } from '@/utils/string';
import { size } from 'lodash';
import Toast from '../Toast/Toast';
const TableShow = (props: any) => {
const { data } = props;
const dataRow = data.rows;
const goTo = (values: any, e: any) => {
console.log(values)
props.onSubmit(values)
}
console.log(values);
props.onSubmit(values);
};
const deleteUnit = (values: any, e: any) => {
props.onChange(values)
}
props.onChange(values);
};
useEffect(() => {
console.log("组件入参")
console.log(dataRow)
}, [])
console.log('组件入参');
console.log(dataRow);
}, []);
//
// Contact Details
// Email
......@@ -38,69 +35,117 @@ const TableShow = (props: any) => {
// Owner/Family Member/Tenant
// const user_status = [[1, "家属"], [2, "租户"]]
const user_status = [[1, "Family Member"], [2, "Tenant"]]
const user_status = [
[1, 'Family Member'],
[2, 'Tenant'],
];
// 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 = ['Not Used', 'Used'];
const key = objectColumns([
["User Name", "ower_name"],
["Contact Details", "ower_phone"],
["Email", "ower_email"],
["RelationShip", null, (text: any, record: any) => (<Space size="middle">{record.owner_relationship != null ? user_status[(record.owner_relationship) - 1][1] : null}</Space>)],
["status", null, (text: any, record: any) => (<Space size="middle">{user_type_status[record.enable]}</Space>)],
["Actions", null, (text: any, record: any) => (<Space size="middle"> <a onClick={goTo.bind(this, record)}>Detail</a></Space>)],
])
['User Name', 'ower_name'],
['Contact Details', 'ower_phone'],
['Email', 'ower_email'],
[
'RelationShip',
null,
(text: any, record: any) => (
<Space size="middle">
{record.owner_relationship != null ? user_status[record.owner_relationship - 1][1] : null}
</Space>
),
],
[
'status',
null,
(text: any, record: any) => <Space size="middle">{user_type_status[record.enable]}</Space>,
],
[
'Actions',
null,
(text: any, record: any) => (
<Space size="middle">
{' '}
<a onClick={goTo.bind(this, record)}>Detail</a>
</Space>
),
],
]);
return (
<>
<Tabs defaultActiveKey="0" >
{
dataRow.map((item, index) => {
<Tabs defaultActiveKey="0">
{dataRow.map((item, index) => {
return (
<TabPane tab={item.name} key={index}>
<Row gutter={16}><Col>Address:</Col><Col>{((item).owner).addressAndpostalCode + " " + ((item).owner).buildingNumber + "#" + ((item).owner).floorNumber + "-" + ((item).owner).roomNumber}</Col></Row>
{
(item.unit).map((unit: any, uindex: any) => {
<Row gutter={16}>
<Col>Address:</Col>
<Col>
{item.owner.buildingNumber +
'#' +
item.owner.floorNumber +
'-' +
item.owner.roomNumber +
',' +
item.owner.addressAndpostalCode}
</Col>
</Row>
{item.unit.map((unit: any, uindex: any) => {
return (
<div key={unit.living}>
<Row gutter={32}>
<Col span={20}>
<Table title={() => {
<Table
title={() => {
return (
<div style={{ height: 80, position: "relative" }}>
<div style={{ position: "absolute", left: 0, bottom: 16 }}>
<Row gutter={32}><Col>Unit No:</Col><Col>{unit.living}</Col></Row>
<div style={{ height: 80, position: 'relative' }}>
<div style={{ position: 'absolute', left: 0, bottom: 16 }}>
<Row gutter={32}>
<Col>Unit No:</Col>
<Col>{unit.living}</Col>
</Row>
</div>
<div style={{ position: "absolute", right: 0, bottom: 16 }}>
{props.deleteDisable ? null : <Button type="primary" danger onClick={deleteUnit.bind(this, unit.living)}>Delete</Button>}
<div style={{ position: 'absolute', right: 0, bottom: 16 }}>
{props.deleteDisable ? null : (
<Button
type="primary"
danger
onClick={deleteUnit.bind(this, unit.living)}
>
Delete
</Button>
)}
</div>
</div>
)
}} footer={() => ''} rowKey={"ower_name"} dataSource={unit.member} columns={key} pagination={false}></Table>
);
}}
footer={() => ''}
rowKey={'ower_name'}
dataSource={unit.member}
columns={key}
pagination={false}
></Table>
</Col>
<Col>
<Row>
<img width={80} src={unit.imgUrl} />
<img width={80} height={80} src={unit.imgUrl} />
</Row>
<Row style={{ marginTop: 8 }}>
<div style={{ width: 80, textAlign: 'center' }}>
{item.owner.cdkCode}({user_code[item.owner.cdkStatus]})
</div>
</Row>
<Row style={{ marginTop: 8 }}><div style={{ width: 80, textAlign: "center" }}>{item.owner.cdkCode}({user_code[item.owner.cdkStatus]})</div></Row>
</Col>
</Row>
</div>
)
})
}
);
})}
</TabPane>
)
})
}
);
})}
</Tabs>
</>
);
};
......@@ -125,6 +170,8 @@ export default TableShow;
// ower_phone: "微微"
// room_number: "399"
{/* <div style={{ width: 80, height: 80, border: "1px solid #cccccc",padding:8,lineHeight:1,textAlign:"center",fontSize:12}}>
{
/* <div style={{ width: 80, height: 80, border: "1px solid #cccccc",padding:8,lineHeight:1,textAlign:"center",fontSize:12}}>
Activation Code Has Been Used/Is Inactive
</div> */}
\ No newline at end of file
</div> */
}
......@@ -14,7 +14,7 @@ const TitleBack = (props: any) => {
<div className={styles.item0}>
<TitleGet title={props.title} />
</div>
{props.sublist != null && props.title == 'Edit Owner Infomation' ? (
{props.sublist != null ? (
props.sublist.map((item: any, index: any) => {
return (
<div key={index} className={styles.item1}>
......
......@@ -28,7 +28,7 @@ const CardAdd = (props: any) => {
message.success('Operation Success!');
setLoading(false);
ResultClear(module, dispatch);
history.go(-1);
history.goBack();
} else {
message.error('Operation Fail!');
setLoading(false);
......@@ -58,7 +58,9 @@ const CardAdd = (props: any) => {
if (communityInfo != null) {
form.setFieldsValue({
zipCode:
communityInfo.data.rows.residentialAddress + communityInfo.data.rows.residentialZipCode,
communityInfo.data.rows.residentialAddress +
' ' +
communityInfo.data.rows.residentialZipCode,
});
}
}, [communityInfo]);
......
......@@ -72,20 +72,25 @@ const CardDetail = (props: any) => {
]}
title="Apply Card Detail"
></TitleBack>
<Row gutter={8}>
<Col>Community:</Col>
<Col span={3}>{DataSave.community_name}</Col>
<Col>unit:</Col>
<Col>Unit:</Col>
<Col>
{DataSave.build_number}#{DataSave.floor_number}-{DataSave.room_number}
{'BLK ' +
DataSave.build_number +
'#' +
DataSave.floor_number +
'-' +
DataSave.room_number}
</Col>
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col>Address:</Col>
<Col>
{DataSave.zip_address} {DataSave.build_number}#{DataSave.floor_number}-
{DataSave.room_number} {DataSave.zip_code}
{DataSave.zip_address} {DataSave.zip_code}
</Col>
</Row>
......
......@@ -51,8 +51,6 @@ const ChargeDetail = (props: any) => {
/>
<div className={styles.box2}>
<div className={styles.time1}>UploadTime : </div>
<div className={styles.time2}>{timestampToTime(CurData.createTime.time)}</div>
<div className={styles.item21}>Project (community)</div>
<div className={styles.item22}>{CurData.communityName}</div>
<div className={styles.item23}>{CurData.streetName}</div>
......
......@@ -28,7 +28,7 @@ const UsersAdd = (props: any) => {
if (checkParam(values)) {
values.owerPhone = null;
values.owerEmail = null;
values.buildingNumber = 'BLK ' + values.buildingNumber;
values.buildingNumber = 'BLK ' + values.buildingNumber + ' ';
RA(14, values, module, dispatch);
setLoading(true);
} else {
......@@ -57,7 +57,6 @@ 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 {
......
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