Commit 57d20fdc authored by cellee's avatar cellee

Signed-off-by: cellee <893264950@qq.com>

parent f0aec099
...@@ -164,8 +164,12 @@ const Facility = (props: any) => { ...@@ -164,8 +164,12 @@ const Facility = (props: any) => {
let imgs: any = []; // 小设施图片 -- 用作提交 let imgs: any = []; // 小设施图片 -- 用作提交
let name = []; // 小设施名称 -- 用作判断重名 let name = []; // 小设施名称 -- 用作判断重名
for (let i in FacilitysList) { for (let i in FacilitysList) {
// 设施名称不能为空
if (FacilitysList[i].name == '') {
message.error('Facility name cannot be empty!');
return false;
}
name.push(FacilitysList[i].name); name.push(FacilitysList[i].name);
imgs[ imgs[
i i
] = `${FacilitysList[i].name}&${FacilitysList[i].fileList[0].name}&${FacilitysList[i].fileList[0].uid}`; ] = `${FacilitysList[i].name}&${FacilitysList[i].fileList[0].name}&${FacilitysList[i].fileList[0].uid}`;
......
...@@ -82,7 +82,7 @@ const FacilityTow = (props: any) => { ...@@ -82,7 +82,7 @@ const FacilityTow = (props: any) => {
return n1.id - n2.id; return n1.id - n2.id;
}); });
} else { } else {
history.push('/CommunityManagement/FacilityBookings'); history.go(-1);
} }
}, [DataSave]); }, [DataSave]);
...@@ -181,6 +181,12 @@ const FacilityTow = (props: any) => { ...@@ -181,6 +181,12 @@ const FacilityTow = (props: any) => {
let name = []; // 小设施名称 -- 用作判断重名 let name = []; // 小设施名称 -- 用作判断重名
for (let i in FacilitysList) { for (let i in FacilitysList) {
// 设施名称不能为空
if (FacilitysList[i].name == '') {
message.error('Facility name cannot be empty!');
return false;
}
name.push(FacilitysList[i].name); name.push(FacilitysList[i].name);
imgs[ imgs[
i i
...@@ -281,6 +287,8 @@ const FacilityTow = (props: any) => { ...@@ -281,6 +287,8 @@ const FacilityTow = (props: any) => {
); );
return ( return (
<>
{DataSave ? (
<div style={{ padding: 16 }}> <div style={{ padding: 16 }}>
{/* 头部组件v1.2 */} {/* 头部组件v1.2 */}
<TitleBack title={PATHNAME} url={getUrlLast(location.pathname) + '?Facility=true'} /> <TitleBack title={PATHNAME} url={getUrlLast(location.pathname) + '?Facility=true'} />
...@@ -298,7 +306,9 @@ const FacilityTow = (props: any) => { ...@@ -298,7 +306,9 @@ const FacilityTow = (props: any) => {
tabBarExtraContent={facilityDetail ? operations : ''} tabBarExtraContent={facilityDetail ? operations : ''}
> >
{DataSave {DataSave
? DataSave.facilities.map((i: any) => <TabPane tab={`${i.name}`} key={i.id}></TabPane>) ? DataSave.facilities.map((i: any) => (
<TabPane tab={`${i.name}`} key={i.id}></TabPane>
))
: ''} : ''}
</Tabs> </Tabs>
...@@ -406,7 +416,11 @@ const FacilityTow = (props: any) => { ...@@ -406,7 +416,11 @@ const FacilityTow = (props: any) => {
{/* 预约设置 */} {/* 预约设置 */}
<Input.Group> <Input.Group>
<Form.Item name="cancelReservationDay" label="Early Cancellation" rules={NewFaci[5]}> <Form.Item
name="cancelReservationDay"
label="Early Cancellation"
rules={NewFaci[5]}
>
<Input <Input
onKeyUp={keyup.bind(this, 'cancelReservationDay')} onKeyUp={keyup.bind(this, 'cancelReservationDay')}
disabled={facilityDetail} disabled={facilityDetail}
...@@ -497,7 +511,9 @@ const FacilityTow = (props: any) => { ...@@ -497,7 +511,9 @@ const FacilityTow = (props: any) => {
<p> <p>
Closing of facilities :{' '} Closing of facilities :{' '}
<span style={{ color: '#f00' }}> <span style={{ color: '#f00' }}>
{DataSaveDetail && DataSaveDetail.facilities && DataSaveDetail.facilities.facilityName {DataSaveDetail &&
DataSaveDetail.facilities &&
DataSaveDetail.facilities.facilityName
? DataSaveDetail.facilities.facilityName ? DataSaveDetail.facilities.facilityName
: ''}{' '} : ''}{' '}
</span> </span>
...@@ -505,6 +521,10 @@ const FacilityTow = (props: any) => { ...@@ -505,6 +521,10 @@ const FacilityTow = (props: any) => {
</p> </p>
</Modal> </Modal>
</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