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
dd58cf90
Commit
dd58cf90
authored
Jan 15, 2021
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设施
Signed-off-by:
cellee
<
893264950@qq.com
>
parent
18f07ced
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
177 additions
and
118 deletions
+177
-118
config.ts
config/config.ts
+2
-2
proxy.ts
config/proxy.ts
+6
-6
FacilityBookings.ts
src/models/CommunityManagement/FacilityBookings.ts
+4
-1
BugDetail.tsx
src/pages/AccountManagement/SystemFeedback/BugDetail.tsx
+5
-1
SystemFeedback.tsx
...pages/AccountManagement/SystemFeedback/SystemFeedback.tsx
+5
-5
Bookings.tsx
src/pages/CommunityManagement/FacilityBookings/Bookings.tsx
+3
-2
Facility.tsx
src/pages/CommunityManagement/FacilityBookings/Facility.tsx
+60
-78
FacilityBookings.tsx
...CommunityManagement/FacilityBookings/FacilityBookings.tsx
+10
-4
FacilityTow.tsx
...ages/CommunityManagement/FacilityBookings/FacilityTow.tsx
+80
-17
params.ts
src/utils/params.ts
+2
-2
No files found.
config/config.ts
View file @
dd58cf90
/*
/*
* @Author: your name
* @Author: your name
* @Date: 2020-12-01 18:40:06
* @Date: 2020-12-01 18:40:06
* @LastEditTime: 2021-01-1
3 10:34:13
* @LastEditTime: 2021-01-1
5 18:17:37
* @LastEditors: Please set LastEditors
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @Description: In User Settings Edit
* @FilePath: \tostumi\config\config.ts
* @FilePath: \tostumi\config\config.ts
...
@@ -326,7 +326,7 @@ export default defineConfig({
...
@@ -326,7 +326,7 @@ export default defineConfig({
},
},
{
{
path
:
'./FacilityDetail'
,
path
:
'./FacilityDetail'
,
component
:
'./CommunityManagement/FacilityBookings/Facility'
,
component
:
'./CommunityManagement/FacilityBookings/Facility
Tow
'
,
},
},
{
{
path
:
'./FacilityApply'
,
path
:
'./FacilityApply'
,
...
...
config/proxy.ts
View file @
dd58cf90
...
@@ -86,15 +86,15 @@ export default {
...
@@ -86,15 +86,15 @@ export default {
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
pathRewrite
:
{
'^'
:
''
},
},
},
'/tos/'
:
{
target
:
'http://47.74.233.180:8651'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
},
// '/tos/': {
// '/tos/': {
// target: 'http://
192.168.1.28
:8651',
// target: 'http://
47.74.233.180
:8651',
// changeOrigin: true,
// changeOrigin: true,
// pathRewrite: { '^': '' },
// pathRewrite: { '^': '' },
// },
// },
'/tos/'
:
{
target
:
'http://192.168.1.28:8651'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^'
:
''
},
},
},
},
};
};
src/models/CommunityManagement/FacilityBookings.ts
View file @
dd58cf90
...
@@ -32,7 +32,10 @@ export default {
...
@@ -32,7 +32,10 @@ export default {
resultTime
:
null
,
// 设施已预约时间段
resultTime
:
null
,
// 设施已预约时间段
FacilitysList
:
[],
// 动态新增组件
FacilitysList
:
[],
// 动态新增组件
Remaining
:
null
,
Remaining
:
null
,
},
},
reducers
:
{
reducers
:
{
...
...
src/pages/AccountManagement/SystemFeedback/BugDetail.tsx
View file @
dd58cf90
...
@@ -57,7 +57,11 @@ const BugDetail = (props: any) => {
...
@@ -57,7 +57,11 @@ const BugDetail = (props: any) => {
:
'-'
}
:
'-'
}
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"Actions"
>
<
Descriptions
.
Item
label=
"Actions"
>
{
DataSave
?
moment
(
DataSave
.
updateTime
.
time
).
calendar
()
:
'-'
}
{
DataSave
?
moment
(
DataSave
.
updateTime
.
time
).
format
(
'YYYY-MM-DD hh'
)
+
':00'
+
(
parseInt
(
moment
(
DataSave
.
updateTime
.
time
).
format
(
'HH'
))
>
11
?
'PM'
:
'AM'
)
:
'-'
}
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
</
Descriptions
>
</
Descriptions
>
</
div
>
</
div
>
...
...
src/pages/AccountManagement/SystemFeedback/SystemFeedback.tsx
View file @
dd58cf90
...
@@ -30,12 +30,12 @@ const SystemFeedback = (props: any) => {
...
@@ -30,12 +30,12 @@ const SystemFeedback = (props: any) => {
title
:
'Submission time'
,
title
:
'Submission time'
,
dataIndex
:
'createTime'
,
dataIndex
:
'createTime'
,
render
:
(
text
:
any
)
=>
{
render
:
(
text
:
any
)
=>
{
//
let data =
let
data
=
//
moment(text.time).format('YYYY-MM-DD hh') +
moment
(
text
.
time
).
format
(
'YYYY-MM-DD hh'
)
+
//
':00' +
':00'
+
//
(parseInt(moment(text.time).format('HH')) > 11 ? 'PM' : 'AM');
(
parseInt
(
moment
(
text
.
time
).
format
(
'HH'
))
>
11
?
'PM'
:
'AM'
);
let
data
=
moment
(
text
.
time
).
calendar
();
//
let data = moment(text.time).calendar();
return
data
;
return
data
;
},
},
},
},
...
...
src/pages/CommunityManagement/FacilityBookings/Bookings.tsx
View file @
dd58cf90
...
@@ -135,7 +135,7 @@ const Bookings = (props: any) => {
...
@@ -135,7 +135,7 @@ const Bookings = (props: any) => {
}
}
// 没有次数
// 没有次数
if
(
Remaining
==
0
)
{
if
(
Remaining
.
canReservationNum
==
0
)
{
message
.
error
(
'No bookable times'
);
message
.
error
(
'No bookable times'
);
return
false
;
return
false
;
}
}
...
@@ -315,6 +315,7 @@ const Bookings = (props: any) => {
...
@@ -315,6 +315,7 @@ const Bookings = (props: any) => {
opname=
{
getFacility
}
opname=
{
getFacility
}
defaultName=
{
DataSave
!=
null
?
DataSave
.
communityName
:
null
}
defaultName=
{
DataSave
!=
null
?
DataSave
.
communityName
:
null
}
// onSubmit={getFacility}
// onSubmit={getFacility}
disabled=
{
DataSave
&&
DataSave
.
type
==
2
?
true
:
false
}
/>
/>
</
Spin
>
</
Spin
>
{
/* <Input.Search style={{ width: 200, height: 32 }} onSearch={getFacility} loading={loading} defaultValue={}/> */
}
{
/* <Input.Search style={{ width: 200, height: 32 }} onSearch={getFacility} loading={loading} defaultValue={}/> */
}
...
@@ -531,7 +532,7 @@ const Bookings = (props: any) => {
...
@@ -531,7 +532,7 @@ const Bookings = (props: any) => {
<
div
className=
{
styles
.
box6item1
}
>
Remaining times :
</
div
>
<
div
className=
{
styles
.
box6item1
}
>
Remaining times :
</
div
>
<
div
className=
{
styles
.
box6item2
}
>
<
div
className=
{
styles
.
box6item2
}
>
<
BarChartOutlined
style=
{
{
color
:
'#999'
,
marginRight
:
10
}
}
/>
<
BarChartOutlined
style=
{
{
color
:
'#999'
,
marginRight
:
10
}
}
/>
<
span
style=
{
{
color
:
'#f00'
}
}
>
{
Remaining
}
</
span
>
times
<
span
style=
{
{
color
:
'#f00'
}
}
>
{
Remaining
.
canReservationNum
}
</
span
>
times
</
div
>
</
div
>
</
div
>
</
div
>
)
:
(
)
:
(
...
...
src/pages/CommunityManagement/FacilityBookings/Facility.tsx
View file @
dd58cf90
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
'./css/index.less'
;
import
'./css/index.less'
;
import
{
Input
,
InputNumber
,
Button
,
Form
,
Select
,
message
,
Spin
}
from
'antd'
;
import
{
Input
,
InputNumber
,
Button
,
Form
,
Select
,
message
,
Spin
,
TimePicker
}
from
'antd'
;
const
{
Option
}
=
Select
;
const
{
Option
}
=
Select
;
const
{
RangePicker
}
=
TimePicker
;
import
{
connect
,
history
}
from
'umi'
;
import
{
connect
,
history
}
from
'umi'
;
import
PictureOptionsRow
from
'@/components/PictureOptions/PictureOptionsRow'
;
import
PictureOptionsRow
from
'@/components/PictureOptions/PictureOptionsRow'
;
...
@@ -145,69 +146,71 @@ const Facility = (props: any) => {
...
@@ -145,69 +146,71 @@ const Facility = (props: any) => {
// setRef3(values)
// setRef3(values)
// }
// }
// 判断数组是否有重复项
function
isRepeat
(
arr
:
any
)
{
let
hash
=
{};
for
(
let
i
in
arr
)
{
if
(
hash
[
arr
[
i
]])
{
return
true
;
}
hash
[
arr
[
i
]]
=
true
;
}
return
false
;
}
// 提交
// 提交
const
onFinish
=
(
values
:
any
)
=>
{
const
onFinish
=
(
values
:
any
)
=>
{
var
result
=
values
;
// 过滤表单;
// 过滤表单;
let
imgs
:
any
=
[];
let
imgs
:
any
=
[];
// 小设施图片 -- 用作提交
let
name
=
[];
// 小设施名称 -- 用作判断重名
for
(
let
i
in
FacilitysList
)
{
for
(
let
i
in
FacilitysList
)
{
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
}
`
;
}
}
console
.
log
(
imgs
);
// 如果小设施有重名
if
(
isRepeat
(
name
))
{
if
(
imgs
.
length
==
0
)
{
message
.
error
(
'Facility name cannot be repeated!'
);
}
else
if
(
imgs
.
length
==
0
)
{
// 图片设施判断
// 图片设施判断
message
.
error
(
'Please Upload At Least One Facility!'
);
message
.
error
(
'Please Upload At Least One Facility!'
);
}
else
if
(
soltTime
.
length
<
2
||
!
soltTime
[
0
]
)
{
}
else
if
(
!
values
.
Time
)
{
// 判断时间选择
// 判断时间选择
message
.
error
(
'Please Fill In The Appointment Period!'
);
message
.
error
(
'Please Fill In The Appointment Period!'
);
}
else
if
(
soltTime
[
1
]
<=
soltTime
[
0
])
{
// 开始时间与结束时间选择错误
message
.
error
(
'Wrong selection of start time and end time!'
);
}
else
if
(
}
else
if
(
// 提前预订时间大于 取消时间
// 提前预订时间大于 取消时间
result
.
canReservationDay
<
result
.
cancelReservationDay
||
values
.
canReservationDay
<
values
.
cancelReservationDay
||
result
.
canReservationDay
<
result
.
nomarginCancelReservationDay
values
.
canReservationDay
<
values
.
nomarginCancelReservationDay
)
{
)
{
message
.
error
(
'Reservation should be greater than cancellation time!'
);
message
.
error
(
'Reservation should be greater than cancellation time!'
);
// } else if ( // 暂时去掉这个需求判断
// } else if ( // 暂时去掉这个需求判断
// // 不为 0 的时候 No Deposit To Cancel Reservation 必须要小于 Booking
// // 不为 0 的时候 No Deposit To Cancel Reservation 必须要小于 Booking
//
result
.nomarginCancelReservationDay != 0 &&
//
values
.nomarginCancelReservationDay != 0 &&
//
result.canReservationDay <= result
.nomarginCancelReservationDay
//
values.canReservationDay <= values
.nomarginCancelReservationDay
// ) {
// ) {
// message.error('nomarginCancelReservationDay 要小于 Booking !');
// message.error('nomarginCancelReservationDay 要小于 Booking !');
}
else
{
}
else
{
let
categoriesName
:
any
=
imgs
;
// 设施图片
let
categoriesName
:
any
=
imgs
;
// 设施图片
result
.
categoriesName
=
categoriesName
;
// 设施内容
values
.
categoriesName
=
categoriesName
;
// 设施内容
result
.
reservationQuantumTime
=
soltTime
;
// 开放时间段
values
.
reservationQuantumTime
=
[
result
.
categoriesOpenTime
=
`
${
soltTime
[
0
]}
-
${
soltTime
[
1
]}
`
;
// 预约时间段 二开需要
moment
(
values
.
Time
[
0
]).
format
(
'HH:mm'
),
result
.
communityManagerFee
=
result
.
communityManagerFee
?
result
.
communityManagerFee
:
'0.00'
;
// 价格押金没有为0
moment
(
values
.
Time
[
1
]).
format
(
'HH:mm'
),
result
.
communityMargin
=
result
.
communityMargin
?
result
.
communityMargin
:
'0.00'
;
// 价格押金没有为0
];
// 开放时间段
// values.categoriesOpenTime = `${soltTime[0]}-${soltTime[1]}`; // 预约时间段 二开需要
result
.
periodType
=
Cycle
;
values
.
communityManagerFee
=
values
.
communityManagerFee
?
values
.
communityManagerFee
:
'0.00'
;
// 价格押金没有为0
delete
result
.
startTime
;
values
.
communityMargin
=
values
.
communityMargin
?
values
.
communityMargin
:
'0.00'
;
// 价格押金没有为0
delete
result
.
endTime
;
delete
result
.
picList
;
values
.
periodType
=
Cycle
;
delete
values
.
picList
;
if
(
sourceData
!=
null
)
{
delete
values
.
Time
;
result
.
id
=
DataSave
.
id
;
if
(
Result
==
null
)
{
// RA(6, values);
RA
(
17
,
result
);
}
}
else
{
RA
(
6
,
result
);
}
}
}
return
false
;
return
false
;
};
};
const
onFinishFailed
=
(
errorInfo
:
any
)
=>
{
// console.log('Failed:', errorInfo);
};
const
Subscribe
=
()
=>
{
const
Subscribe
=
()
=>
{
history
.
push
(
getUrlLast
(
location
.
pathname
)
+
'/FacilityApply'
);
history
.
push
(
getUrlLast
(
location
.
pathname
)
+
'/FacilityApply'
);
};
};
...
@@ -285,25 +288,14 @@ const Facility = (props: any) => {
...
@@ -285,25 +288,14 @@ const Facility = (props: any) => {
});
});
};
};
// 下拉选择
//时间
const
startTimes
=
(
value
:
any
)
=>
{
const
onChanges
=
(
value
:
any
,
b
:
any
)
=>
{
let
s
=
soltTime
;
// console.log(value);
if
(
sourceData
!=
null
)
{
// console.log(b);
s
[
0
]
=
moment
(
value
).
format
(
'HH:mm'
);
// 修改后的时间
}
else
{
formRef
.
current
.
setFieldsValue
({
s
[
0
]
=
value
;
Time
:
[
moment
(
b
[
0
],
'HH:mm'
),
moment
(
b
[
1
],
'HH:mm'
)],
}
});
setSoltTime
(
s
);
};
// 结束时间
const
endTimes
=
(
value
:
any
)
=>
{
let
s
=
soltTime
;
if
(
sourceData
!=
null
)
{
s
[
1
]
=
moment
(
value
).
format
(
'HH:mm'
);
}
else
{
s
[
1
]
=
value
;
}
setSoltTime
(
s
);
};
};
return
(
return
(
...
@@ -317,7 +309,6 @@ const Facility = (props: any) => {
...
@@ -317,7 +309,6 @@ const Facility = (props: any) => {
form=
{
form
}
form=
{
form
}
name=
"basic"
name=
"basic"
onFinish=
{
onFinish
}
onFinish=
{
onFinish
}
onFinishFailed=
{
onFinishFailed
}
validateMessages=
{
validateMessages
}
validateMessages=
{
validateMessages
}
>
>
{
/* 选择小区 */
}
{
/* 选择小区 */
}
...
@@ -339,8 +330,8 @@ const Facility = (props: any) => {
...
@@ -339,8 +330,8 @@ const Facility = (props: any) => {
maxLength=
{
30
}
maxLength=
{
30
}
/>
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"Fee($)"
name=
"communityManagerFee"
>
<
span
className=
"divIconMoney"
>
Fee($):
</
span
>
{
/* <span className="divIconMoney">$</span> */
}
<
Form
.
Item
label=
""
name=
"communityManagerFee"
>
<
InputNumber
<
InputNumber
onKeyUp=
{
keyup_communityManagerFee
}
onKeyUp=
{
keyup_communityManagerFee
}
prefix=
"$"
prefix=
"$"
...
@@ -352,9 +343,8 @@ const Facility = (props: any) => {
...
@@ -352,9 +343,8 @@ const Facility = (props: any) => {
style=
{
{
width
:
'120px'
}
}
style=
{
{
width
:
'120px'
}
}
/>
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
span
className=
"divIconMoney"
>
Deposit:
</
span
>
<
Form
.
Item
label=
"Deposit"
name=
"communityMargin"
>
<
Form
.
Item
label=
""
name=
"communityMargin"
>
{
/* <span className="divIconMoney">$</span> */
}
<
InputNumber
<
InputNumber
onKeyUp=
{
keyup_communityMargin
}
onKeyUp=
{
keyup_communityMargin
}
prefix=
"$"
prefix=
"$"
...
@@ -403,23 +393,15 @@ const Facility = (props: any) => {
...
@@ -403,23 +393,15 @@ const Facility = (props: any) => {
{
/* 时间 */
}
{
/* 时间 */
}
<
Form
.
Item
label=
"Opening Hours"
className=
"required"
>
<
Form
.
Item
label=
"Opening Hours"
className=
"required"
>
<
Form
.
Item
name=
"startTime"
noStyle
>
<
Form
.
Item
name=
"Time"
noStyle
>
<
OnTime
<
RangePicker
placeholder=
{
'Start Time'
}
type=
{
0
}
openSelect=
{
startTimes
}
defaultValue=
{
soltTime
[
0
]
}
disabled=
{
imgOpen
}
/>
</
Form
.
Item
>
<
span
className=
"diyspan"
>
-
</
span
>
<
Form
.
Item
name=
"endTime"
noStyle
>
<
OnTime
placeholder=
{
'Closing Time'
}
// 默认值
openSelect=
{
endTimes
}
type=
{
0
}
defaultValue=
{
soltTime
[
1
]
}
disabled=
{
imgOpen
}
disabled=
{
imgOpen
}
minuteStep=
{
60
}
format=
"HH:mm"
onChange=
{
(
time
:
any
,
timeString
:
any
)
=>
{
onChanges
(
time
,
timeString
);
}
}
allowClear=
{
false
}
/>
/>
</
Form
.
Item
>
</
Form
.
Item
>
</
Form
.
Item
>
</
Form
.
Item
>
...
...
src/pages/CommunityManagement/FacilityBookings/FacilityBookings.tsx
View file @
dd58cf90
...
@@ -116,12 +116,18 @@ const FacilityBookings = (props: any) => {
...
@@ -116,12 +116,18 @@ const FacilityBookings = (props: any) => {
// 列表2 点击跳转
// 列表2 点击跳转
const
makeOperator
=
(
values
:
any
,
index
:
any
)
=>
{
const
makeOperator
=
(
values
:
any
,
index
:
any
)
=>
{
const
path
=
[
'/FacilityDetail'
,
'/FacilityEdit'
,
'/FacilityApply'
];
const
path
=
[
'/FacilityDetail'
,
'/FacilityEdit'
,
'/FacilityApply'
];
if
(
index
!=
1
)
{
message
.
error
(
'In function development!'
);
values
.
type
=
index
;
return
false
;
console
.
log
(
values
);
if
(
index
==
2
)
{
values
.
communityName
=
values
.
community
;
// values.id = values.community;
}
}
SA
(
values
);
SA
(
values
);
// 清空设施列表图
// 清空设施列表图;
let
list
:
any
=
[];
let
list
:
any
=
[];
dispatch
({
type
:
'FacilityBookings/genxin'
,
list
});
dispatch
({
type
:
'FacilityBookings/genxin'
,
list
});
...
...
src/pages/CommunityManagement/FacilityBookings/FacilityTow.tsx
View file @
dd58cf90
...
@@ -36,7 +36,7 @@ const FacilityTow = (props: any) => {
...
@@ -36,7 +36,7 @@ const FacilityTow = (props: any) => {
const
[
ctyName
,
setCtyName
]
=
useState
(
null
);
// 小区名称
const
[
ctyName
,
setCtyName
]
=
useState
(
null
);
// 小区名称
const
[
fileList
,
setFileList
]
=
useState
([]
as
any
);
// 设施总图片列表组
const
[
fileList
,
setFileList
]
=
useState
([]
as
any
);
// 设施总图片列表组
const
[
Cycle
,
setCycle
]
=
useState
(
null
as
any
);
// 周期下拉
const
[
Cycle
,
setCycle
]
=
useState
(
null
as
any
);
// 周期下拉
const
[
soltTime
,
setSoltTime
]
=
useState
([
''
,
''
]);
// 已选时间
const
[
Facilityid
,
setFacilityId
]
=
useState
(
null
as
any
);
// 周期下拉
const
formRef
=
useRef
(
null
as
any
);
const
formRef
=
useRef
(
null
as
any
);
const
[
form
]
=
Form
.
useForm
();
// 表单标识
const
[
form
]
=
Form
.
useForm
();
// 表单标识
...
@@ -57,7 +57,11 @@ const FacilityTow = (props: any) => {
...
@@ -57,7 +57,11 @@ const FacilityTow = (props: any) => {
// 传递来的小区和设施
// 传递来的小区和设施
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
DataSave
)
{
if
(
DataSave
)
{
if
(
DataSave
.
type
==
0
)
{
setFacilityDetail
(
true
);
}
setCtyName
(
DataSave
.
community
);
setCtyName
(
DataSave
.
community
);
setFacilityId
(
DataSave
.
facilities
[
0
].
id
);
beg
(
DataSave
.
facilities
[
0
].
id
);
beg
(
DataSave
.
facilities
[
0
].
id
);
}
else
{
}
else
{
//返回列表
//返回列表
...
@@ -67,8 +71,6 @@ const FacilityTow = (props: any) => {
...
@@ -67,8 +71,6 @@ const FacilityTow = (props: any) => {
// 点击设施获取到的设施列表
// 点击设施获取到的设施列表
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
DataSaveDetail
)
{
if
(
DataSaveDetail
)
{
console
.
log
();
let
{
categories
,
facilities
}
=
DataSaveDetail
;
let
{
categories
,
facilities
}
=
DataSaveDetail
;
// 设施A、设施B小图
// 设施A、设施B小图
...
@@ -79,7 +81,7 @@ const FacilityTow = (props: any) => {
...
@@ -79,7 +81,7 @@ const FacilityTow = (props: any) => {
fileList
:
[
fileList
:
[
{
{
uid
:
item
.
id
,
uid
:
item
.
id
,
name
:
item
.
categoriesName
,
name
:
item
.
categories
Image
Name
,
status
:
'done'
,
status
:
'done'
,
url
:
item
.
categoriesImageUrl
,
url
:
item
.
categoriesImageUrl
,
},
},
...
@@ -116,23 +118,75 @@ const FacilityTow = (props: any) => {
...
@@ -116,23 +118,75 @@ const FacilityTow = (props: any) => {
formRef
.
current
.
setFieldsValue
({
formRef
.
current
.
setFieldsValue
({
Time
:
[
moment
(
time
[
0
],
'HH:mm'
),
moment
(
time
[
1
],
'HH:mm'
)],
Time
:
[
moment
(
time
[
0
],
'HH:mm'
),
moment
(
time
[
1
],
'HH:mm'
)],
});
});
setSoltTime
([...
time
]);
}
}
},
[
DataSaveDetail
]);
},
[
DataSaveDetail
]);
// tab 切换
// tab 切换
const
onTabClicks
=
(
id
:
String
)
=>
{
const
onTabClicks
=
(
id
:
String
)
=>
{
setFacilityId
(
id
);
beg
(
id
);
beg
(
id
);
};
};
// 判断数组是否有重复项
function
isRepeat
(
arr
:
any
)
{
let
hash
=
{};
for
(
let
i
in
arr
)
{
if
(
hash
[
arr
[
i
]])
{
return
true
;
}
hash
[
arr
[
i
]]
=
true
;
}
return
false
;
}
// 提交
// 提交
const
onFinish
=
(
values
:
any
)
=>
{
const
onFinish
=
(
values
:
any
)
=>
{
console
.
log
(
values
);
// 提取设施icon图和名称出来;
message
.
error
(
'In function development!'
);
let
imgs
:
any
=
[];
// 小设施图片 -- 用作提交
};
let
name
=
[];
// 小设施名称 -- 用作判断重名
for
(
let
i
in
FacilitysList
)
{
name
.
push
(
FacilitysList
[
i
].
name
);
imgs
[
i
]
=
`
${
FacilitysList
[
i
].
name
}
&
${
FacilitysList
[
i
].
fileList
[
0
].
name
}
&
${
FacilitysList
[
i
].
fileList
[
0
].
uid
}
`
;
}
// 单个的话也转化为数组
if
(
typeof
values
.
categoriesDetailsImageName
==
'string'
)
{
values
.
categoriesDetailsImageName
=
values
.
categoriesDetailsImageName
.
split
(
','
);
}
const
onFinishFailed
=
(
errorInfo
:
any
)
=>
{
// 如果小设施有重名
// console.log('Failed:', errorInfo);
if
(
isRepeat
(
name
))
{
message
.
error
(
'Facility name cannot be repeated!'
);
}
else
if
(
imgs
.
length
==
0
)
{
// 图片设施判断
message
.
error
(
'Please Upload At Least One Facility!'
);
}
else
if
(
// 提前预订时间大于 取消时间
values
.
canReservationDay
<
values
.
cancelReservationDay
||
values
.
canReservationDay
<
values
.
nomarginCancelReservationDay
)
{
message
.
error
(
'Reservation should be greater than cancellation time!'
);
}
else
{
let
categoriesName
:
any
=
imgs
;
// 设施图片
values
.
categoriesName
=
categoriesName
;
// 设施内容
values
.
reservationQuantumTime
=
[
moment
(
values
.
Time
[
0
]).
format
(
'HH:mm'
),
moment
(
values
.
Time
[
1
]).
format
(
'HH:mm'
),
];
// 开放时间段
// values.categoriesOpenTime = `${soltTime[0]}-${soltTime[1]}`; // 预约时间段 二开需要
values
.
communityManagerFee
=
values
.
communityManagerFee
?
values
.
communityManagerFee
:
'0.00'
;
// 价格押金没有为0
values
.
communityMargin
=
values
.
communityMargin
?
values
.
communityMargin
:
'0.00'
;
// 价格押金没有为0
values
.
periodType
=
Cycle
;
values
.
id
=
Facilityid
;
delete
values
.
startTime
;
delete
values
.
endTime
;
delete
values
.
picList
;
delete
values
.
Time
;
RA
(
17
,
values
);
}
};
};
// 发起请求
// 发起请求
...
@@ -162,7 +216,12 @@ const FacilityTow = (props: any) => {
...
@@ -162,7 +216,12 @@ const FacilityTow = (props: any) => {
//时间
//时间
const
onChanges
=
(
value
:
any
,
b
:
any
)
=>
{
const
onChanges
=
(
value
:
any
,
b
:
any
)
=>
{
console
.
log
(
value
);
// console.log(value);
// console.log(b);
// 修改后的时间
formRef
.
current
.
setFieldsValue
({
Time
:
[
moment
(
b
[
0
],
'HH:mm'
),
moment
(
b
[
1
],
'HH:mm'
)],
});
};
};
return
(
return
(
...
@@ -190,7 +249,6 @@ const FacilityTow = (props: any) => {
...
@@ -190,7 +249,6 @@ const FacilityTow = (props: any) => {
form=
{
form
}
form=
{
form
}
name=
"basic"
name=
"basic"
onFinish=
{
onFinish
}
onFinish=
{
onFinish
}
onFinishFailed=
{
onFinishFailed
}
validateMessages=
{
validateMessages
}
validateMessages=
{
validateMessages
}
labelAlign=
"right"
labelAlign=
"right"
>
>
...
@@ -232,9 +290,13 @@ const FacilityTow = (props: any) => {
...
@@ -232,9 +290,13 @@ const FacilityTow = (props: any) => {
<
hr
></
hr
>
<
hr
></
hr
>
{
/* 设施品类上传 */
}
{
/* 设施品类上传 */
}
<
Form
.
Item
label=
"Facilities"
className=
"flex required"
style=
{
{
marginBottom
:
0
}
}
>
<
Form
.
Item
label=
"Facilities"
className=
"flex required"
style=
{
{
marginBottom
:
0
,
minHeight
:
134
}
}
>
<
Facilitys
<
Facilitys
disabled=
{
imgOpen
}
disabled=
{
facilityDetail
}
updata=
{
{
updata=
{
{
// userToken: token,
// userToken: token,
imageType
:
'categoriesImageName'
,
imageType
:
'categoriesImageName'
,
...
@@ -251,7 +313,7 @@ const FacilityTow = (props: any) => {
...
@@ -251,7 +313,7 @@ const FacilityTow = (props: any) => {
rules=
{
NewFaci
[
4
]
}
rules=
{
NewFaci
[
4
]
}
>
>
<
PictureOptionsRow
<
PictureOptionsRow
over=
{
imgOpen
}
over=
{
facilityDetail
}
data=
{
{
data=
{
{
// userToken: token,
// userToken: token,
imageType
:
'categoriesDetailsImageName'
,
imageType
:
'categoriesDetailsImageName'
,
...
@@ -271,7 +333,8 @@ const FacilityTow = (props: any) => {
...
@@ -271,7 +333,8 @@ const FacilityTow = (props: any) => {
onChange=
{
(
time
:
any
,
timeString
:
any
)
=>
{
onChange=
{
(
time
:
any
,
timeString
:
any
)
=>
{
onChanges
(
time
,
timeString
);
onChanges
(
time
,
timeString
);
}
}
}
}
disabled
allowClear=
{
false
}
disabled=
{
facilityDetail
}
/>
/>
</
Form
.
Item
>
</
Form
.
Item
>
</
Form
.
Item
>
</
Form
.
Item
>
...
@@ -353,7 +416,7 @@ const FacilityTow = (props: any) => {
...
@@ -353,7 +416,7 @@ const FacilityTow = (props: any) => {
<
hr
></
hr
>
<
hr
></
hr
>
<>
<>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
load
}
>
<
Button
type=
"primary"
htmlType=
"submit"
loading=
{
load
}
disabled=
{
facilityDetail
}
>
Submit
Submit
</
Button
>
</
Button
>
</>
</>
...
...
src/utils/params.ts
View file @
dd58cf90
/*
/*
* @Author: your name
* @Author: your name
* @Date: 2020-11-19 20:34:18
* @Date: 2020-11-19 20:34:18
* @LastEditTime: 2021-01-1
4 15:31:59
* @LastEditTime: 2021-01-1
5 18:52:31
* @LastEditors: Please set LastEditors
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\utils\params.ts
* @FilePath: \tostumi\src\utils\params.ts
...
@@ -90,7 +90,7 @@ export const requestList = [
...
@@ -90,7 +90,7 @@ export const requestList = [
[
'/tos/tosCommunity/get/user'
,
'55 根据用户id获取用户管辖小区名'
,
{}],
[
'/tos/tosCommunity/get/user'
,
'55 根据用户id获取用户管辖小区名'
,
{}],
[
'/tos/user/twoLevel/get'
,
'56 获取二级账号'
,
{}],
[
'/tos/user/twoLevel/get'
,
'56 获取二级账号'
,
{}],
[
'/tos/user/twoLevel/get/CommunityAuth'
,
'57 根据用户id获取用户管辖小区名和权限'
,
{}],
[
'/tos/user/twoLevel/get/CommunityAuth'
,
'57 根据用户id获取用户管辖小区名和权限'
,
{}],
[
'/tos/community/categories/subscribe/reservation
Num
'
,
'58 获取小区设施可预约次数'
,
{}],
[
'/tos/community/categories/subscribe/reservation
Info
'
,
'58 获取小区设施可预约次数'
,
{}],
[
'/tos/bug/feedback/list'
,
'59 获取用户反馈列表'
,
{}],
[
'/tos/bug/feedback/list'
,
'59 获取用户反馈列表'
,
{}],
[
'/tos/community/facilities/get/detail'
,
'60 获取小区设施详情'
,
{}],
[
'/tos/community/facilities/get/detail'
,
'60 获取小区设施详情'
,
{}],
];
];
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