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