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
710c642a
Commit
710c642a
authored
Nov 06, 2020
by
Sixiang_Zzb
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'final' of
http://120.77.240.215:9701/Maple/tostumi
into final
parents
eddb1a43
1c2ac72c
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
577 additions
and
387 deletions
+577
-387
index.jsx
src/components/SelectOptions/index.jsx
+4
-5
CellList.ts
src/models/CommunityManagement/CellList.ts
+3
-1
Contract.ts
src/models/CommunityManagement/Contract.ts
+60
-64
FacilityBookings.ts
src/models/CommunityManagement/FacilityBookings.ts
+13
-2
Bookings.tsx
src/pages/CommunityManagement/FacilityBookings/Bookings.tsx
+270
-148
Facility.tsx
src/pages/CommunityManagement/FacilityBookings/Facility.tsx
+14
-14
FacilityBookings.tsx
...CommunityManagement/FacilityBookings/FacilityBookings.tsx
+40
-12
Bookings.less
...es/CommunityManagement/FacilityBookings/css/Bookings.less
+163
-141
tip.ts
src/utils/tip.ts
+10
-0
No files found.
src/components/SelectOptions/index.jsx
View file @
710c642a
...
...
@@ -53,14 +53,12 @@ function getDotText(arr) {
}
}
class
SelectOptions
extends
React
.
Component
{
class
SelectOptions
extends
React
.
Pure
Component
{
state
=
{};
constructor
(
props
)
{
super
(
props
);
const
{
list
,
dispatch
,
checklist
}
=
this
.
props
;
console
.
log
(
list
);
if
(
list
==
null
)
{
//console.error("组件错误:没有数据导入")
}
...
...
@@ -102,7 +100,8 @@ class SelectOptions extends React.Component {
}
console
.
log
(
this
.
state
.
componetVisible
);
}
// console.log(this.props.list);
if
(
this
.
props
.
list
.
length
>
this
.
state
.
checkedList
.
length
)
{
}
// console.log(prevProps.list);
// if (this.props.list.length > prevProps.list.length) {
// console.log(this.props.list);
...
...
@@ -229,7 +228,7 @@ class SelectOptions extends React.Component {
};
// 索引 -- 全部点击
itemSelectAll
=
(
e
)
=>
{
console
.
log
(
this
.
props
.
list
);
//
console.log(this.props.list);
this
.
setState
({
checkedListOptions
:
this
.
props
.
list
,
checkedList
:
this
.
state
.
resultList
,
...
...
src/models/CommunityManagement/CellList.ts
View file @
710c642a
...
...
@@ -64,8 +64,10 @@ export default {
switch
(
playload
.
index
)
{
case
24
:
{
let
CommunityList
=
null
;
yield
put
({
type
:
'Init/returnCommunityList'
,
CommunityList
});
let
Data
=
resp
.
data
;
let
CommunityList
=
resp
.
data
.
communityList
;
CommunityList
=
resp
.
data
.
communityList
;
yield
put
({
type
:
'returnPage'
,
Data
});
yield
put
({
type
:
'Init/returnCommunityList'
,
CommunityList
});
}
...
...
src/models/CommunityManagement/Contract.ts
View file @
710c642a
...
...
@@ -2,117 +2,113 @@ import * as service from '../../services/tos';
import
{
message
}
from
'antd'
;
import
{
Link
,
useIntl
,
connect
,
Dispatch
,
history
}
from
'umi'
;
import
{
routerRedux
}
from
'dva/router'
import
{
routerRedux
}
from
'dva/router'
;
export
default
{
namespace
:
'Contract'
,
state
:
{
Data
:
{
data
:
[],
total
:
0
},
curString
:{},
curString
:
{},
Result
:
null
,
DataSave
:
null
,
DataSaveDetail
:
null
,
playload
:
{}
DataSaveDetail
:
null
,
playload
:
{},
},
reducers
:
{
returnPage
(
state
,
{
Data
})
{
returnPage
(
state
,
{
Data
})
{
return
{
...
state
,
Data
};
},
returnResult
(
state
,
{
Result
})
{
return
{
...
state
,
Result
};
returnResult
(
state
,
{
Result
})
{
return
{
...
state
,
Result
};
},
returnDataSave
(
state
,
{
DataSave
})
{
return
{
...
state
,
DataSave
}
return
{
...
state
,
DataSave
};
},
returnDataSaveDetail
(
state
,
{
DataSaveDetail
})
{
return
{
...
state
,
DataSaveDetail
}
return
{
...
state
,
DataSaveDetail
};
},
returnPath
(
state
,
{
playload
})
{
returnPath
(
state
,
{
playload
})
{
return
{
...
state
,
playload
};
},
},
effects
:
{
//预订设施查询
*
RA
({
playload
},
{
call
,
put
})
{
console
.
log
(
"开始请求"
)
console
.
log
(
'开始请求'
);
const
resp
=
yield
call
(
service
.
RA
,
playload
);
console
.
log
(
resp
)
if
(
resp
.
code
==
500
||
resp
.
error_code
!=
"0000"
)
{
console
.
log
(
resp
)
;
if
(
resp
.
code
==
500
||
resp
.
error_code
!=
'0000'
)
{
// window.location.href = '/500';
}
if
(
resp
.
error_code
!=
"0000"
)
{
console
.
log
(
"请求错误码:"
+
"("
+
playload
.
index
+
")"
+
resp
.
error_code
)
console
.
log
(
playload
)
}
else
{
if
(
resp
.
error_code
!=
'0000'
)
{
console
.
log
(
'请求错误码:'
+
'('
+
playload
.
index
+
')'
+
resp
.
error_code
);
console
.
log
(
playload
);
}
else
{
switch
(
playload
.
index
)
{
case
19
:
{
let
Data
=
resp
.
data
;
yield
put
({
type
:
'returnPage'
,
Data
});
}
break
;
let
Data
=
resp
.
data
;
yield
put
({
type
:
'returnPage'
,
Data
});
}
break
;
case
20
:
{
let
DataSaveDetail
=
resp
.
data
;
yield
put
({
type
:
'returnDataSaveDetail'
,
DataSaveDetail
});
}
break
;
case
27
:
{
message
.
success
(
'save success !'
);
var
tmp
=
resp
yield
put
({
type
:
'returnResult'
,
tmp
})
setTimeout
(
function
(){
history
.
goBack
()
},
1000
)
}
break
;
yield
put
({
type
:
'returnDataSaveDetail'
,
DataSaveDetail
});
}
break
;
case
27
:
{
message
.
success
(
'save success !'
);
var
tmp
=
resp
;
yield
put
({
type
:
'returnResult'
,
tmp
});
setTimeout
(
function
()
{
history
.
goBack
();
},
1000
);
}
break
;
}
}
},
// url 带参数
*
RA2
({
playload
},
{
call
,
put
}){
console
.
log
(
"开始请求"
)
const
resp
=
yield
call
(
service
.
RA2
,
playload
);
console
.
log
(
resp
)
},
//
*RA2({ playload }, { call, put }){
//
console.log("开始请求")
//
const resp = yield call(service.RA2, playload);
//
console.log(resp)
//
},
*
ResultClear
({
},
{
put
})
{
var
tmp
=
null
yield
put
({
type
:
'returnResult'
,
tmp
}
)
*
ResultClear
({},
{
put
})
{
var
tmp
=
null
;
yield
put
({
type
:
'returnResult'
,
tmp
});
},
*
SA
({
playload
},
{
call
,
put
})
{
var
DataSave
=
playload
yield
put
({
type
:
'returnDataSave'
,
DataSave
}
)
var
DataSave
=
playload
;
yield
put
({
type
:
'returnDataSave'
,
DataSave
});
},
*
Paths
({
playload
},
{
put
}){
yield
put
({
type
:
'returnPath'
,
playload
}
)
}
*
Paths
({
playload
},
{
put
})
{
yield
put
({
type
:
'returnPath'
,
playload
});
},
},
subscriptions
:
{
setup
({
dispatch
,
history
})
{
// 监听 路由
return
history
.
listen
(({
pathname
})
=>
{
let
path
=
{
path
:
pathname
}
dispatch
({
type
:
'Paths'
,
// 选择返回值
playload
:{
path
},
})
// 监听 路由
return
history
.
listen
(({
pathname
})
=>
{
let
path
=
{
path
:
pathname
,
};
dispatch
({
type
:
'Paths'
,
// 选择返回值
playload
:
{
path
,
},
});
}
}
});
},
},
};
src/models/CommunityManagement/FacilityBookings.ts
View file @
710c642a
...
...
@@ -131,8 +131,14 @@ export default {
break
;
case
1
:
{
let
Data3
=
resp
.
data
;
yield
put
({
type
:
'returnPage3'
,
Data3
});
let
Data3
=
resp
.
data
;
if
(
JSON
.
stringify
(
Data3
)
==
"{}"
)
{
Data3
=
false
// 提示小区没有设施
message
.
error
(
'There Are No Facilities In The Community !'
);
}
yield
put
({
type
:
'returnPage3'
,
Data3
});
}
break
;
case
2
:{
...
...
@@ -154,6 +160,11 @@ export default {
let
tmp
=
resp
.
data
;
const
reg
=
[[
"url"
,
"categoriesImageUrl"
],
[
"name"
,
"categoriesName"
]]
const
reg2
=
[[
"url"
,
null
]]
//let sourceData = tmp;
// sourceData.categoriesOpenTime= timeToMoment(tmp.categoriesOpenTime);
// sourceData.categoriesName = Fromate(tmp.categoriesList, reg),
// sourceData.categoriesDetailsImageName = Fromate(tmp.facilitiesImageList, reg2)
let
sourceData
=
{
canReservationDay
:
tmp
.
canReservationDay
,
canReservationNum
:
tmp
.
canReservationNum
,
...
...
src/pages/CommunityManagement/FacilityBookings/Bookings.tsx
View file @
710c642a
This diff is collapsed.
Click to expand it.
src/pages/CommunityManagement/FacilityBookings/Facility.tsx
View file @
710c642a
...
...
@@ -66,17 +66,14 @@ const Facility = (props: any) => {
const
formRef
=
useRef
(
null
);
// 进来先清空上传图片列表
useEffect
(()
=>
{
dispatch
({
type
:
module
+
'/overAllImgList'
});
},
[
1
]);
// 再监听列表
const
[
extImgList
,
setextImgList
]
=
useState
(
imgList
);
useEffect
(()
=>
{
console
.
log
(
'变化'
);
console
.
log
(
imgList
);
setextImgList
(
imgList
);
if
(
imgList
!=
null
)
{
setextImgList
(
imgList
);
}
},
[
imgList
]);
useEffect
(()
=>
{
...
...
@@ -144,12 +141,12 @@ const Facility = (props: any) => {
var
result
=
values
;
// 过滤表单;
let
imgs
=
extImgList
.
filter
((
item
:
any
)
=>
(
Object
.
keys
(
item
).
length
==
0
?
false
:
true
));
console
.
log
(
imgs
.
length
);
// 开放时间判断
if
(
imgs
.
length
<
1
)
{
message
.
error
(
'
请至少上传一个设施
'
);
if
(
imgs
.
length
==
0
)
{
message
.
error
(
'
Please upload at least one facility!
'
);
}
else
if
(
!
result
.
endTime
&&
!
result
.
startTime
)
{
message
.
error
(
'
请选择开放时间
'
);
message
.
error
(
'
Please select the opening time!
'
);
}
else
{
// 先处理设施和时间
let
categoriesName
:
any
=
[];
...
...
@@ -161,13 +158,16 @@ const Facility = (props: any) => {
if
(
imgs
[
i
].
name
&&
imgs
[
i
].
pic
)
{
categoriesName
[
i
]
=
`
${
imgs
[
i
].
name
}
&
${
imgs
[
i
].
pic
}
`
;
}
else
{
message
.
error
(
'
请填写设备名称
'
);
message
.
error
(
'
Please fill in the name of the facility!
'
);
return
;
}
}
result
.
categoriesName
=
categoriesName
;
result
.
reservationQuantumTime
=
reservationQuantumTime
;
result
.
categoriesName
=
categoriesName
;
// 设施内容
result
.
reservationQuantumTime
=
reservationQuantumTime
;
// 开放时间段
result
.
categoriesOpenTime
=
`
${
result
.
startTime
}
-
${
result
.
endTime
}
`
;
// 预约时间段 二开需要
delete
result
.
startTime
;
delete
result
.
periodType
;
delete
result
.
picList
;
console
.
log
(
reservationQuantumTime
);
console
.
log
(
result
);
RA
(
6
,
result
);
...
...
src/pages/CommunityManagement/FacilityBookings/FacilityBookings.tsx
View file @
710c642a
...
...
@@ -21,7 +21,9 @@ import { getUrlLastParams } from '../../../utils/string';
import
'./css/index.less'
;
import
ProTable
from
'@ant-design/pro-table'
;
import
{
PlusOutlined
,
SearchOutlined
,
ClearOutlined
}
from
'@ant-design/icons'
;
import
{
PlusOutlined
,
ClockCircleOutlined
,
ClearOutlined
}
from
'@ant-design/icons'
;
import
moment
from
'moment'
;
const
FacilityBookings
=
(
props
:
any
)
=>
{
const
{
formatMessage
}
=
useIntl
();
...
...
@@ -53,6 +55,8 @@ const FacilityBookings = (props: any) => {
const
goToFunction
=
()
=>
{
if
(
curString
.
tab
==
2
)
{
CA
();
// 先清空上传图片列表
dispatch
({
type
:
'FacilityBookings/overAllImgList'
});
}
history
.
push
(
location
.
pathname
+
(
curString
.
tab
==
1
?
'/Booking'
:
'/Adding'
));
};
...
...
@@ -78,10 +82,25 @@ const FacilityBookings = (props: any) => {
[
'Order Time'
,
null
,
(
text
:
any
,
record
:
any
)
=>
<
div
>
{
timestampToTime
(
record
.
createTime
.
time
)
}
</
div
>,
(
text
:
any
,
record
:
any
)
=>
(
<
div
>
<
ClockCircleOutlined
style=
{
{
color
:
'#666'
}
}
/>
{
moment
(
record
.
createTime
.
time
).
format
(
'YYYY-MM-DD'
)
}
</
div
>
),
],
[
'Booking Schedule'
,
'subscribeDate'
],
[
'Booking Schedule'
,
'subscribeDate'
,
(
text
:
any
)
=>
(
<
div
>
<
ClockCircleOutlined
style=
{
{
color
:
'#666'
}
}
/>
{
text
}
</
div
>
),
],
[
'Fee'
,
'managerFeeStatus'
,
(
text
:
any
)
=>
<
div
>
{
managerFeeStatusDes
[
text
]
}
</
div
>],
[
'Deposit'
,
'marginFeeStatus'
,
(
text
:
any
)
=>
<
div
>
{
marginFeeStatusDes
[
text
]
}
</
div
>],
[
'Status'
,
'status'
,
(
text
:
any
)
=>
<
div
>
{
statusDes
[
text
]
}
</
div
>],
...
...
@@ -268,7 +287,7 @@ const FacilityBookings = (props: any) => {
<
Tabs
defaultActiveKey=
{
curString
.
tab
.
toString
()
}
onChange=
{
TabCallback
}
>
<
TabPane
tab=
"Facility Bookings"
key=
"1"
>
<
Table
<
Pro
Table
loading=
{
loading
}
rowKey=
"id"
style=
{
{
marginTop
:
16
}
}
...
...
@@ -280,6 +299,22 @@ const FacilityBookings = (props: any) => {
showSizeChanger
:
false
,
onChange
:
Pagechange
,
}
}
search=
{
false
}
toolBarRender=
{
()
=>
[
<
Button
key=
"3"
type=
"primary"
onClick=
{
goToFunction
}
>
<
PlusOutlined
/>
添加预约
</
Button
>,
]
}
options=
{
{
density
:
true
,
fullScreen
:
true
,
reload
:
()
=>
{
// onReset();
},
setting
:
false
,
}
}
headerTitle=
"预约列表"
/>
</
TabPane
>
...
...
@@ -299,14 +334,7 @@ const FacilityBookings = (props: any) => {
// pagination={false} // 隐藏默认分页
search=
{
false
}
toolBarRender=
{
()
=>
[
<
Button
key=
"3"
type=
"primary"
onClick=
{
()
=>
{
// goToAdd(0,
{});
goToFunction
();
}
}
>
<
Button
key=
"3"
type=
"primary"
onClick=
{
goToFunction
}
>
<
PlusOutlined
/>
添加设施
</
Button
>,
...
...
src/pages/CommunityManagement/FacilityBookings/css/Bookings.less
View file @
710c642a
...
...
@@ -2,167 +2,189 @@
//基石
.base {
width: 100%;
background-color: #ffffff;
padding: 34px;
min-width: 1020px;
width: 100%;
background-color: #ffffff;
padding: 20px;
}
//头部组件
.box{
width: 100%;
height: 64px;
position: relative;
}
.item1{
position: absolute;
width: 180px;
text-align: center;
border-left: 5px solid rgba(24,144,255,
1);
font-family:
'Source Han Sans CN';
font-size: 18px;
font-weight: 600;
color: #000000;
}
.item2{
width:300px
;
position: absolute
;
left: (300px)
;
line-height: 30px;
}
.item4{
position: absolute
;
left: (500px)
;
line-height: 30px;
}
.item3{
width:80
px;
height: 32px
;
position: absolute
;
right: 0;
outline
: none;
background:none
;
cursor: pointer;
border:1px solid rgba(217,217,217,1)
;
border-radius:2px;
}
.box1{
width: 100%
;
height: 34px
;
position: relative
;
margin-bottom: 26px;
}
.box1item1{
position: absolute
;
}
.box1item2{
position: absolute;
left: 161
px;
}
.box2{
width: 100%;
position: relative;
}
.box2item1{
position: absolute
;
}
.box2item2{
width: 336px;
padding-left: 161
px;
.box
{
width: 100%;
height: 64px;
position: relative;
}
.item1
{
position: absolute;
width: 180px;
text-align: center;
border-left: 5px solid rgba(24, 144, 255,
1);
font-family:
'Source Han Sans CN';
font-size: 18px;
font-weight: 600;
color: #000000;
}
.item2 {
width: 300px;
position: absolute
;
left: (300px)
;
line-height: 30px
;
}
.item4 {
position: absolute;
left: (500px)
;
line-height: 30px
;
}
.item3 {
width: 80px;
height: 32
px;
position: absolute
;
right: 0
;
outline: none;
background
: none;
cursor: pointer
;
border: 1px solid rgba(217, 217, 217, 1);
border-radius: 2px
;
}
.box1 {
width: 100%;
height: 34px
;
position: relative
;
margin-bottom: 26px
;
}
.box1item1 {
position: absolute;
line-height: 32px
;
}
.box1item2
{
position: absolute;
left: 135
px;
}
.box2
{
width: 100%;
position: relative;
}
.box2item1 {
position: absolute;
line-height: 32px
;
}
.box2item2
{
width: 336px;
padding-left: 135
px;
}
// 线栏
.line{
.line {
width: 100%;
height: 1px;
border-top: 1px solid rgba(217, 217, 217, 1);
margin-top: 28px;
margin-bottom: 28px;
}
.box3 {
width: 100%;
height: 32px;
position: relative;
margin-bottom: 28px;
}
.box3item1 {
position: absolute;
line-height: 32px;
}
.box3item2 {
position: absolute;
left: 135px;
}
.box3item3 {
position: absolute;
left: 467px;
line-height: 32px;
}
.box3item4 {
position: absolute;
left: 592px;
}
.box4 {
width: 100%;
min-height: 32px;
position: relative;
&::after {
content: '';
display: block;
width: 100%;
height: 1px;
border-top: 1px solid rgba(217,217,217,1);
margin-top: 28px;
margin-bottom: 28px;
clear: both;
}
}
.box3{
width: 100%;
height: 32px;
position: relative;
margin-bottom: 28px;
.box4item1 {
position: absolute;
line-height: 32px;
}
.box3item1{
position: absolute;
.box4item2 {
position: absolute;
left: 135px;
}
.box
3item2
{
position: absolute;
left: 161
px;
.box
4item3
{
position: absolute;
left: 257
px;
}
.box
3item3
{
position: absolute;
left: 467
px;
.box
4item4
{
position: absolute;
left: 281
px;
}
.box
3item4
{
position: absolute;
left: 592
px;
.box
4item5
{
position: absolute;
left: 365
px;
}
.box4{
width: 100%;
height: 32px;
position: relative;
}
.box4item1{
position: absolute;
}
.box4item2{
position: absolute;
left: 161px;
.box4item6 {
position: absolute;
left: 380px;
}
.box4item3{
position: absolute;
left: 257px;
}
.box4item4{
position: absolute;
left: 281px;
.box5 {
width: 100%;
height: 32px;
position: relative;
margin-bottom: 28px;
}
.box
4item5
{
position: absolute;
left: 365
px;
.box
5item1
{
position: absolute;
line-height: 32
px;
}
.box4item6{
position: absolute;
left: 380px;
.box5item2 {
position: absolute;
left: 135px;
}
.box5{
width: 100%;
height: 32px;
position: relative;
margin-bottom: 28px;
.box6 {
width: 100%;
height: 32px;
position: relative;
margin-bottom: 20px;
}
.box
5item1
{
position: absolute;
.box
6item1
{
position: absolute;
}
.box
5item2
{
position: absolute;
left: 161
px;
.box
6item2
{
position: absolute;
left: 216
px;
}
.box6{
width: 100%;
height: 32px;
position: relative;
}
.box6item1{
position: absolute;
.divbox4 {
position: absolute;
left: 135px;
.ant-form-item {
display: inline-block;
}
.jio,
.heng {
display: inline-block;
line-height: 32px;
margin: 0 20px;
}
}
.box6item2{
position: absolute;
left: 216px;
}
\ No newline at end of file
src/utils/tip.ts
View file @
710c642a
...
...
@@ -40,3 +40,13 @@ export const NewFaci = [
[{
required
:
false
,
message
:
'Required'
}],
[{
required
:
false
,
message
:
'Required'
}],
];
// 设施预订
export
const
BookingsTip
=
[
[{
required
:
false
,
message
:
'Please select community'
}],
[{
required
:
false
,
message
:
'Please input Facility Name'
}],
[{
required
:
false
,
message
:
'Please Set management fee'
}],
[{
required
:
false
,
message
:
'Please Set Setting deposit'
}],
[{
required
:
false
,
message
:
'Please Upload facility photos'
}],
[{
required
:
false
,
message
:
'Required'
}],
];
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