Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TOSTUMI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maple
TOSTUMI
Commits
57d20fdc
Commit
57d20fdc
authored
Jan 20, 2021
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Signed-off-by: cellee <893264950@qq.com>
parent
f0aec099
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
246 additions
and
222 deletions
+246
-222
Facility.tsx
src/pages/CommunityManagement/FacilityBookings/Facility.tsx
+5
-1
FacilityTow.tsx
...ages/CommunityManagement/FacilityBookings/FacilityTow.tsx
+241
-221
No files found.
src/pages/CommunityManagement/FacilityBookings/Facility.tsx
View file @
57d20fdc
...
...
@@ -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
}
`
;
...
...
src/pages/CommunityManagement/FacilityBookings/FacilityTow.tsx
View file @
57d20fdc
...
...
@@ -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,230 +287,244 @@ const FacilityTow = (props: any) => {
);
return
(
<
div
style=
{
{
padding
:
16
}
}
>
{
/* 头部组件v1.2 */
}
<
TitleBack
title=
{
PATHNAME
}
url=
{
getUrlLast
(
location
.
pathname
)
+
'?Facility=true'
}
/>
{
/* 设施切换 */
}
<
div
className=
{
'FacilityName'
}
>
<
label
>
Community :
</
label
>
{
DataSave
?
DataSave
.
community
:
''
}
</
div
>
<
Tabs
defaultActiveKey=
"0"
tabPosition=
"top"
onTabClick=
{
(
key
)
=>
onTabClicks
(
key
)
}
tabBarExtraContent=
{
facilityDetail
?
operations
:
''
}
>
{
DataSave
?
DataSave
.
facilities
.
map
((
i
:
any
)
=>
<
TabPane
tab=
{
`${i.name}`
}
key=
{
i
.
id
}
></
TabPane
>)
:
''
}
</
Tabs
>
{
/* 设施内容 */
}
<
Spin
spinning=
{
load
}
>
<
div
className=
{
'base basediy'
}
>
<
Form
ref=
{
formRef
}
form=
{
form
}
name=
"basic"
onFinish=
{
onFinish
}
validateMessages=
{
validateMessages
}
labelAlign=
"right"
<>
{
DataSave
?
(
<
div
style=
{
{
padding
:
16
}
}
>
{
/* 头部组件v1.2 */
}
<
TitleBack
title=
{
PATHNAME
}
url=
{
getUrlLast
(
location
.
pathname
)
+
'?Facility=true'
}
/>
{
/* 设施切换 */
}
<
div
className=
{
'FacilityName'
}
>
<
label
>
Community :
</
label
>
{
DataSave
?
DataSave
.
community
:
''
}
</
div
>
<
Tabs
defaultActiveKey=
"0"
tabPosition=
"top"
onTabClick=
{
(
key
)
=>
onTabClicks
(
key
)
}
tabBarExtraContent=
{
facilityDetail
?
operations
:
''
}
>
{
/* 设施名称 以及费用 */
}
<
Input
.
Group
>
<
Form
.
Item
label=
"Facility Classification"
name=
"facilityName"
rules=
{
NewFaci
[
1
]
}
>
<
Input
placeholder=
"Facility Classification"
disabled=
{
facilityDetail
}
maxLength=
{
30
}
/>
</
Form
.
Item
>
<
span
className=
"divIconMoney"
>
Fee($):
</
span
>
<
Form
.
Item
label=
""
name=
"communityManagerFee"
>
<
InputNumber
prefix=
"$"
placeholder=
"00.00"
disabled=
{
facilityDetail
}
min=
{
0
}
max=
{
999
}
step=
{
0.01
}
style=
{
{
width
:
'120px'
}
}
/>
</
Form
.
Item
>
<
span
className=
"divIconMoney"
>
Deposit:
</
span
>
<
Form
.
Item
label=
""
name=
"communityMargin"
>
<
InputNumber
prefix=
"$"
placeholder=
"00.00"
disabled=
{
facilityDetail
}
min=
{
0
}
max=
{
999
}
step=
{
0.01
}
style=
{
{
width
:
'120px'
}
}
/>
</
Form
.
Item
>
</
Input
.
Group
>
<
hr
></
hr
>
{
/* 设施品类上传 */
}
<
Form
.
Item
label=
"Facilities"
className=
"flex required"
style=
{
{
marginBottom
:
0
,
minHeight
:
134
}
}
>
<
Facilitys
disabled=
{
facilityDetail
}
updata=
{
{
// userToken: token,
imageType
:
'categoriesImageName'
,
extends
:
ctyName
,
}
}
></
Facilitys
>
</
Form
.
Item
>
{
/* 设施详情上传 */
}
<
Form
.
Item
name=
"categoriesDetailsImageName"
label=
"Facility Pictures"
rules=
{
NewFaci
[
4
]
}
>
<
PictureOptionsRow
over=
{
facilityDetail
}
data=
{
{
// userToken: token,
imageType
:
'categoriesDetailsImageName'
,
extends
:
ctyName
,
}
}
limitNums=
{
99
}
imgs=
{
fileList
}
/>
</
Form
.
Item
>
{
/* 时间 */
}
<
Form
.
Item
label=
"Opening Hours"
className=
"required"
>
<
Form
.
Item
name=
"Time"
noStyle
>
<
RangePicker
minuteStep=
{
60
}
format=
"HH:mm"
onChange=
{
(
time
:
any
,
timeString
:
any
)
=>
{
onChanges
(
time
,
timeString
);
}
}
allowClear=
{
false
}
disabled=
{
facilityDetail
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
hr
></
hr
>
{
/* ------------- */
}
<
p
className=
"diyp"
>
Booking Rules :
</
p
>
{
/* 预约设置 */
}
<
Input
.
Group
>
<
Form
.
Item
name=
"cancelReservationDay"
label=
"Early Cancellation"
rules=
{
NewFaci
[
5
]
}
>
<
Input
onKeyUp=
{
keyup
.
bind
(
this
,
'cancelReservationDay'
)
}
disabled=
{
facilityDetail
}
// prefix="Advance"
suffix=
"Day(s) In Advance"
style=
{
{
width
:
160
,
textAlign
:
'center'
}
}
placeholder=
"0"
maxLength=
{
2
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"No Deposit To Cancel Reservation"
name=
"nomarginCancelReservationDay"
rules=
{
NewFaci
[
6
]
}
{
DataSave
?
DataSave
.
facilities
.
map
((
i
:
any
)
=>
(
<
TabPane
tab=
{
`${i.name}`
}
key=
{
i
.
id
}
></
TabPane
>
))
:
''
}
</
Tabs
>
{
/* 设施内容 */
}
<
Spin
spinning=
{
load
}
>
<
div
className=
{
'base basediy'
}
>
<
Form
ref=
{
formRef
}
form=
{
form
}
name=
"basic"
onFinish=
{
onFinish
}
validateMessages=
{
validateMessages
}
labelAlign=
"right"
>
<
Input
onKeyUp=
{
keyup
.
bind
(
this
,
'nomarginCancelReservationDay'
)
}
disabled=
{
facilityDetail
}
// prefix="Advance"
suffix=
"Day(s) In Advance"
style=
{
{
width
:
160
,
textAlign
:
'center'
}
}
placeholder=
"0"
maxLength=
{
2
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"Booking"
name=
"canReservationDay"
rules=
{
NewFaci
[
7
]
}
>
<
Input
onKeyUp=
{
keyup
.
bind
(
this
,
'canReservationDay'
)
}
placeholder=
"0"
style=
{
{
width
:
160
,
textAlign
:
'center'
}
}
disabled=
{
facilityDetail
}
// prefix="Advance"
suffix=
"Day(s) In Advance"
maxLength=
{
2
}
/>
</
Form
.
Item
>
</
Input
.
Group
>
{
/* 设置次数 */
}
<
Input
.
Group
>
<
Form
.
Item
label=
"Booking Quotas"
rules=
{
NewFaci
[
8
]
}
>
<
Select
placeholder=
"Cycle"
allowClear
style=
{
{
width
:
120
}
}
disabled=
{
facilityDetail
}
value=
{
Cycle
}
onChange=
{
handleChange
}
{
/* 设施名称 以及费用 */
}
<
Input
.
Group
>
<
Form
.
Item
label=
"Facility Classification"
name=
"facilityName"
rules=
{
NewFaci
[
1
]
}
>
<
Input
placeholder=
"Facility Classification"
disabled=
{
facilityDetail
}
maxLength=
{
30
}
/>
</
Form
.
Item
>
<
span
className=
"divIconMoney"
>
Fee($):
</
span
>
<
Form
.
Item
label=
""
name=
"communityManagerFee"
>
<
InputNumber
prefix=
"$"
placeholder=
"00.00"
disabled=
{
facilityDetail
}
min=
{
0
}
max=
{
999
}
step=
{
0.01
}
style=
{
{
width
:
'120px'
}
}
/>
</
Form
.
Item
>
<
span
className=
"divIconMoney"
>
Deposit:
</
span
>
<
Form
.
Item
label=
""
name=
"communityMargin"
>
<
InputNumber
prefix=
"$"
placeholder=
"00.00"
disabled=
{
facilityDetail
}
min=
{
0
}
max=
{
999
}
step=
{
0.01
}
style=
{
{
width
:
'120px'
}
}
/>
</
Form
.
Item
>
</
Input
.
Group
>
<
hr
></
hr
>
{
/* 设施品类上传 */
}
<
Form
.
Item
label=
"Facilities"
className=
"flex required"
style=
{
{
marginBottom
:
0
,
minHeight
:
134
}
}
>
<
Option
value=
"1"
>
Week
</
Option
>
<
Option
value=
"2"
>
Month
</
Option
>
<
Option
value=
"3"
>
Year
</
Option
>
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
name=
"canReservationNum"
rules=
{
NewFaci
[
9
]
}
>
<
Input
onKeyUp=
{
keyup
.
bind
(
this
,
'canReservationNum'
)
}
placeholder=
"Second"
style=
{
{
width
:
120
}
}
disabled=
{
facilityDetail
}
defaultValue=
{
0
}
suffix=
"Time(s)"
/>
</
Form
.
Item
>
</
Input
.
Group
>
<
hr
></
hr
>
<>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
load
}
disabled=
{
facilityDetail
}
>
Submit
</
Button
>
</>
</
Form
>
<
Facilitys
disabled=
{
facilityDetail
}
updata=
{
{
// userToken: token,
imageType
:
'categoriesImageName'
,
extends
:
ctyName
,
}
}
></
Facilitys
>
</
Form
.
Item
>
{
/* 设施详情上传 */
}
<
Form
.
Item
name=
"categoriesDetailsImageName"
label=
"Facility Pictures"
rules=
{
NewFaci
[
4
]
}
>
<
PictureOptionsRow
over=
{
facilityDetail
}
data=
{
{
// userToken: token,
imageType
:
'categoriesDetailsImageName'
,
extends
:
ctyName
,
}
}
limitNums=
{
99
}
imgs=
{
fileList
}
/>
</
Form
.
Item
>
{
/* 时间 */
}
<
Form
.
Item
label=
"Opening Hours"
className=
"required"
>
<
Form
.
Item
name=
"Time"
noStyle
>
<
RangePicker
minuteStep=
{
60
}
format=
"HH:mm"
onChange=
{
(
time
:
any
,
timeString
:
any
)
=>
{
onChanges
(
time
,
timeString
);
}
}
allowClear=
{
false
}
disabled=
{
facilityDetail
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
hr
></
hr
>
{
/* ------------- */
}
<
p
className=
"diyp"
>
Booking Rules :
</
p
>
{
/* 预约设置 */
}
<
Input
.
Group
>
<
Form
.
Item
name=
"cancelReservationDay"
label=
"Early Cancellation"
rules=
{
NewFaci
[
5
]
}
>
<
Input
onKeyUp=
{
keyup
.
bind
(
this
,
'cancelReservationDay'
)
}
disabled=
{
facilityDetail
}
// prefix="Advance"
suffix=
"Day(s) In Advance"
style=
{
{
width
:
160
,
textAlign
:
'center'
}
}
placeholder=
"0"
maxLength=
{
2
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"No Deposit To Cancel Reservation"
name=
"nomarginCancelReservationDay"
rules=
{
NewFaci
[
6
]
}
>
<
Input
onKeyUp=
{
keyup
.
bind
(
this
,
'nomarginCancelReservationDay'
)
}
disabled=
{
facilityDetail
}
// prefix="Advance"
suffix=
"Day(s) In Advance"
style=
{
{
width
:
160
,
textAlign
:
'center'
}
}
placeholder=
"0"
maxLength=
{
2
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"Booking"
name=
"canReservationDay"
rules=
{
NewFaci
[
7
]
}
>
<
Input
onKeyUp=
{
keyup
.
bind
(
this
,
'canReservationDay'
)
}
placeholder=
"0"
style=
{
{
width
:
160
,
textAlign
:
'center'
}
}
disabled=
{
facilityDetail
}
// prefix="Advance"
suffix=
"Day(s) In Advance"
maxLength=
{
2
}
/>
</
Form
.
Item
>
</
Input
.
Group
>
{
/* 设置次数 */
}
<
Input
.
Group
>
<
Form
.
Item
label=
"Booking Quotas"
rules=
{
NewFaci
[
8
]
}
>
<
Select
placeholder=
"Cycle"
allowClear
style=
{
{
width
:
120
}
}
disabled=
{
facilityDetail
}
value=
{
Cycle
}
onChange=
{
handleChange
}
>
<
Option
value=
"1"
>
Week
</
Option
>
<
Option
value=
"2"
>
Month
</
Option
>
<
Option
value=
"3"
>
Year
</
Option
>
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
name=
"canReservationNum"
rules=
{
NewFaci
[
9
]
}
>
<
Input
onKeyUp=
{
keyup
.
bind
(
this
,
'canReservationNum'
)
}
placeholder=
"Second"
style=
{
{
width
:
120
}
}
disabled=
{
facilityDetail
}
defaultValue=
{
0
}
suffix=
"Time(s)"
/>
</
Form
.
Item
>
</
Input
.
Group
>
<
hr
></
hr
>
<>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
load
}
disabled=
{
facilityDetail
}
>
Submit
</
Button
>
</>
</
Form
>
</
div
>
</
Spin
>
<
Modal
title=
"Close Facility"
visible=
{
isModalVisible
}
onOk=
{
handleOk
}
okText=
{
'Confirm'
}
cancelText=
{
'Cancel'
}
onCancel=
{
handleCancel
}
centered
confirmLoading=
{
load
}
>
<
p
>
Closing of facilities :
{
' '
}
<
span
style=
{
{
color
:
'#f00'
}
}
>
{
DataSaveDetail
&&
DataSaveDetail
.
facilities
&&
DataSaveDetail
.
facilities
.
facilityName
?
DataSaveDetail
.
facilities
.
facilityName
:
''
}{
' '
}
</
span
>
?
</
p
>
</
Modal
>
</
div
>
</
Spin
>
<
Modal
title=
"Close Facility"
visible=
{
isModalVisible
}
onOk=
{
handleOk
}
okText=
{
'Confirm'
}
cancelText=
{
'Cancel'
}
onCancel=
{
handleCancel
}
centered
confirmLoading=
{
load
}
>
<
p
>
Closing of facilities :
{
' '
}
<
span
style=
{
{
color
:
'#f00'
}
}
>
{
DataSaveDetail
&&
DataSaveDetail
.
facilities
&&
DataSaveDetail
.
facilities
.
facilityName
?
DataSaveDetail
.
facilities
.
facilityName
:
''
}{
' '
}
</
span
>
?
</
p
>
</
Modal
>
</
div
>
)
:
(
''
)
}
</>
);
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment