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
212aeb1a
Commit
212aeb1a
authored
Jan 29, 2021
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增设施预约时间组件
Signed-off-by:
cellee
<
893264950@qq.com
>
parent
e52152da
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
436 additions
and
135 deletions
+436
-135
OnTime.less
src/components/OnTime/OnTime.less
+115
-0
OnTime.tsx
src/components/OnTime/OnTime.tsx
+261
-93
OnTimeTow.tsx
src/components/OnTime/OnTimeTow.tsx
+2
-2
FacilityBookings.ts
src/models/CommunityManagement/FacilityBookings.ts
+1
-1
AccountAdds.tsx
src/pages/AccountManagement/account/AccountAdds.tsx
+4
-4
AccountEdit.tsx
src/pages/AccountManagement/account/AccountEdit.tsx
+1
-1
Adds.tsx
src/pages/CommunityManagement/CellList/Adds.tsx
+5
-1
Bookings.tsx
src/pages/CommunityManagement/FacilityBookings/Bookings.tsx
+15
-15
ContractContent.tsx
src/pages/ContractManagement/ContractContent.tsx
+4
-4
ContractDetail.tsx
src/pages/ContractManagement/ContractDetail.tsx
+19
-13
Template.tsx
src/pages/runTest/Template.tsx
+9
-1
No files found.
src/components/OnTime/OnTime.less
0 → 100644
View file @
212aeb1a
.ontime-box {
position: relative;
box-sizing: border-box;
border: 1px solid #d9d9d9;
border-radius: 2px;
&.disabled {
background: #f5f5f5;
border-color: #d9d9d9;
cursor: not-allowed;
}
.ims {
min-height: 30px;
line-height: 30px;
padding: 0 6px 0 10px;
color: #000;
font-size: 14px;
transition: all 0.5s;
cursor: pointer;
&.active {
color: #999;
}
span {
display: inline-block;
padding: 0 6px;
}
}
.icon {
transform: scale(0.9);
transform: rotate(0);
transition: all 0.3s;
&.icon-up {
transform: rotate(180deg);
}
}
// 时间段选择
.slot {
position: absolute;
top: calc(100% + 2px);
left: 0;
border: 1px solid #d9d9d9;
padding: 8px 8px 0;
z-index: 10;
background: #fff;
border-radius: 2px;
min-width: 396px;
// 可选时间
.opens {
display: flex;
justify-content: end;
align-items: center;
flex-wrap: wrap;
span.sapa {
cursor: pointer;
display: inline-block;
padding: 2px 4px;
margin: 0 8px 8px 0;
font-size: 13px;
letter-spacing: 1px;
border: 1px solid #d9d9d9;
border-radius: 2px;
transition: all 0.5s;
&:nth-child(4n) {
margin-right: 0;
}
&.active {
border-color: #1890ff;
background: #1890ff;
color: #fff;
}
&.disabled {
cursor: not-allowed;
border-color: #f9f9f9;
background: #f9f9f9;
color: #999;
}
//去掉双击页面内容的蓝色背景
-moz-user-select: none; /*火狐*/
-webkit-user-select: none; /*webkit浏览器*/
-ms-user-select: none; /*IE10*/
-khtml-user-select: none; /*早期浏览器*/
user-select: none;
}
// 无数据
.nodata {
width: 100%;
min-height: 80px;
padding: 20px 0;
text-align: center;
li {
padding-top: 10px;
}
span {
transform: scale(2);
}
}
}
// 按钮
.oks {
display: flex;
justify-content: flex-end;
align-items: center;
margin-bottom: 8px;
button {
&:nth-child(1) {
margin-right: 6px;
}
}
}
}
}
src/components/OnTime/OnTime.tsx
View file @
212aeb1a
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Select
,
TimePicker
}
from
'antd'
;
import
{
getLocale
}
from
'umi'
;
const
{
Option
}
=
Select
;
import
{
Button
,
message
}
from
'antd'
;
import
{
DownOutlined
,
CloseCircleOutlined
,
LinkOutlined
,
CloseOutlined
,
CheckOutlined
,
}
from
'@ant-design/icons'
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
'./OnTime.less'
;
const
OnTime
=
(
porps
:
any
)
=>
{
const
OnTime
=
(
porps
:
any
)
=>
{
// placeholder 默认显示 disabled 是否禁止
// disabled 是否禁用 // limit 设施默认禁止时间段 // onChanges 提交到父页面 // inhibitTime 选择日期后的禁止时间
// openSelect 选中函数 limit 限制时间 type 类型 时开始还是结束 1 就是结束 结尾是59
let
{
disabled
,
limit
,
onChanges
,
inhibitTime
}
=
porps
;
// defaultValue 默认时间 inhibitTime 禁止选择时间
let
{
placeholder
,
disabled
,
openSelect
,
limit
,
type
,
defaultValue
,
inhibitTime
}
=
porps
;
const
[
imgOpen
,
setImgOpen
]
=
useState
(
null
as
any
);
// 语言设置
// 已经预约时间禁止
const
[
imgOpen
,
setImgOpen
]
=
useState
([]
as
any
);
const
[
Scheduled
,
setScheduled
]
=
useState
(
null
as
any
);
// 是否选择
const
[
Scheduled
,
setScheduled
]
=
useState
(
false
);
// 禁止选择时间
// 可选择时间段
useEffect
(()
=>
{
const
[
Quantum
,
setQuantum
]
=
useState
([]
as
any
);
if
(
inhibitTime
!=
null
)
{
let
arrs
=
''
as
any
;
inhibitTime
.
forEach
((
element
:
any
)
=>
{
let
strArr
=
cutOut
(
element
);
arrs
=
arrs
+
strArr
;
});
let
confirm
=
[...
new
Set
(
arrs
.
substr
(
0
,
arrs
.
length
-
1
).
split
(
','
))];
let
newConfirm
=
[]
as
any
;
// 已经选择时间段 ---(应该储存 index )
confirm
.
forEach
((
element
:
any
)
=>
{
const
[
time
,
settime
]
=
useState
([]
as
any
);
return
newConfirm
.
push
(
parseInt
(
element
));
});
// 已经选择时间段
const
[
timeOks
,
settimeOks
]
=
useState
([]
as
any
);
setScheduled
(
newConfirm
);
// 语言
useEffect
(()
=>
{
if
(
getLocale
()
==
'zh-CN'
)
{
setImgOpen
([
'开始时间'
,
'结束时间'
]);
}
else
{
setImgOpen
([
'Start time'
,
'End time'
]);
}
}
},
[
inhibitTime
]);
},
[
1
]);
// 设施开放时间
useEffect
(()
=>
{
if
(
limit
)
{
let
time
=
limit
.
split
(
'-'
);
let
star
=
parseInt
(
moment
(
time
[
0
],
'HH:mm'
).
format
(
'HH'
));
let
end
=
parseInt
(
moment
(
time
[
1
],
'HH:mm'
).
format
(
'HH'
));
// 时间截取
for
(
let
i
=
star
;
i
<
end
;
i
++
)
{
function
cutOut
(
str
:
any
)
{
let
a
=
Quantum
;
var
one
=
str
.
indexOf
(
':'
);
let
item
=
{
let
str1
=
parseInt
(
str
.
substring
(
0
,
one
));
id
:
i
,
// 值
let
str2
=
parseInt
(
str
.
match
(
/-
(\S
*
)
:/
)[
1
]);
disabled
:
false
,
// 是否禁用
let
arr
=
''
;
active
:
false
,
// 是否选中
for
(
let
i
=
str1
;
i
<=
str2
;
i
++
)
{
};
arr
=
`
${
arr
}${
i
}
,`
;
a
.
push
(
item
);
setQuantum
(
a
);
}
}
}
return
arr
;
},
[
limit
]);
}
// 已经选择的时间
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
defaultValue
!=
null
)
{
if
(
inhibitTime
)
{
let
a
=
moment
(
defaultValue
,
'HH:mm'
);
// 先循环一次把所有k的变成可选
setImgOpen
(
a
);
for
(
let
k
in
Quantum
)
{
Quantum
[
k
].
disabled
=
false
;
}
// 在进行判断
for
(
let
i
in
inhibitTime
)
{
let
a
=
parseInt
(
moment
(
inhibitTime
[
i
],
'HH:mm'
).
format
(
'HH'
));
for
(
let
j
in
Quantum
)
{
if
(
Quantum
[
j
].
id
==
a
)
{
Quantum
[
j
].
disabled
=
true
;
}
}
}
}
}
},
[
defaultValue
]);
},
[
inhibitTime
]);
// console.log(limit);
// 点击时间
// 生成数组 -- 时间
const
onclicks
=
(
item
:
any
,
index
:
any
)
=>
{
const
createArray
=
(
num
:
any
)
=>
{
// 用作判断
var
arr
=
[];
let
is
=
true
;
for
(
let
i
=
0
;
i
<
num
;
i
++
)
{
if
(
i
<
10
)
{
// 添加
arr
[
i
]
=
`0
${
i
}
`
;
let
tim
=
time
;
// 已经选择的时间 (index)
}
else
{
let
timOk
=
timeOks
;
arr
[
i
]
=
i
;
let
list
=
Quantum
;
// 时间段列表
// 如果已经选择的时间没有选择两个以上的话就添加进去,否则先要重新还原
if
(
tim
.
length
==
1
)
{
// 里面有一个值的话 把大于存在的动态赋值 class
let
min
=
tim
[
0
]
<
index
?
tim
[
0
]
:
index
;
let
max
=
tim
[
0
]
>
index
?
tim
[
0
]
:
index
;
// 先做下判断,看是不是选了中间已被占用的时间
for
(
let
i
=
min
;
i
<
max
;
i
++
)
{
if
(
Quantum
[
i
].
disabled
)
{
is
=
false
;
}
}
// 再改变区间内的值
if
(
is
)
{
for
(
let
i
=
min
;
i
<
max
;
i
++
)
{
list
[
i
].
active
=
true
;
}
}
}
}
else
if
(
tim
.
length
==
2
)
{
for
(
let
i
in
list
)
{
list
[
i
].
active
=
false
;
}
// 复原
time
.
length
=
0
;
timeOks
.
length
=
0
;
}
// 添加
if
(
is
)
{
list
[
index
].
active
=
true
;
setQuantum
([...
list
]);
// 先加入在排序
tim
.
push
(
index
);
tim
.
sort
(
function
(
a
:
any
,
b
:
any
)
{
return
a
-
b
;
});
// 先加入在排序
timOk
.
push
(
item
.
id
);
timOk
.
sort
(
function
(
a
:
any
,
b
:
any
)
{
return
a
-
b
;
});
settime
([...
tim
]);
// 排序加入 -- index
settimeOks
([...
timOk
]);
// 排序加入
}
}
return
arr
;
};
};
//小时
// 点击展开
const
hourS
=
createArray
(
24
).
map
((
item
)
=>
const
opens
=
()
=>
{
// 处理限制时间段
// 如果是禁用状态点击无效
limit
?
(
if
(
!
disabled
)
{
<
Option
value=
{
item
+
(
type
?
':59'
:
':00'
)
}
key=
{
item
}
disabled=
{
Times
(
item
,
limit
)
}
>
let
start
=
!
Scheduled
;
{
item
+
(
type
?
':59'
:
':00'
)
}
setScheduled
(
start
);
</
Option
>
)
:
(
<
Option
value=
{
item
+
(
type
?
':59'
:
':00'
)
}
key=
{
item
}
>
{
item
+
(
type
?
':59'
:
':00'
)
}
</
Option
>
),
);
// 字符串截取判断
// 复原选中的
function
Times
(
item
:
any
,
openTime
:
string
)
{
if
(
start
)
{
if
(
// 先全部清掉
parseInt
(
item
)
>=
parseInt
(
openTime
.
slice
(
0
,
2
))
&&
for
(
let
i
in
Quantum
)
{
parseInt
(
item
)
<=
parseInt
(
openTime
.
slice
(
6
,
8
))
// 再赋值选中的
)
{
let
imgOpens
=
parseInt
(
moment
([
0
],
'HH:mm'
).
format
(
'HH'
));
if
(
Scheduled
&&
Scheduled
.
indexOf
(
parseInt
(
item
))
!=
-
1
)
{
// 如果已选择了 还原
// 如果存在有预约的时间 且在数组里面,就禁止选择
if
(
!
isNaN
(
imgOpens
))
{
return
true
;
for
(
let
j
in
imgOpen
)
{
if
(
i
==
imgOpen
[
j
])
{
Quantum
[
i
].
active
=
true
;
}
}
}
}
}
}
return
false
;
}
};
// 点击确定
const
oks
=
()
=>
{
if
(
timeOks
.
length
==
0
)
{
// 还原提示
}
else
if
(
timeOks
.
length
==
1
)
{
// 只有一个的话
let
openTime
=
[
moment
(
timeOks
[
0
],
'HH'
).
format
(
'HH:mm'
),
moment
(
timeOks
[
0
]
+
1
,
'HH'
).
format
(
'HH:mm'
),
];
setImgOpen
(
openTime
);
// console.log(openTime);
// 提交到父页面
onChanges
(
openTime
);
}
else
{
}
else
{
return
true
;
// 有两个的话
let
openTime
=
[
moment
(
timeOks
[
0
],
'HH'
).
format
(
'HH:mm'
),
moment
(
timeOks
[
1
]
+
1
,
'HH'
).
format
(
'HH:mm'
),
];
setImgOpen
(
openTime
);
// console.log(openTime);
// 提交到父页面
onChanges
(
openTime
);
}
}
}
// 再隐藏
setScheduled
(
false
);
};
// 点击取消还原
const
cancel
=
()
=>
{
Quantum
.
map
((
item
:
any
)
=>
{
return
(
item
.
active
=
false
);
});
// 再隐藏
setScheduled
(
false
);
};
return
(
return
(
<>
<
div
className=
{
disabled
?
'ontime-box disabled'
:
'ontime-box'
}
>
{
defaultValue
?
(
<
div
<
TimePicker
className=
{
Scheduled
?
'ims'
:
'ims active'
}
defaultValue=
{
moment
(
defaultValue
,
'HH:mm'
)
}
onClick=
{
()
=>
{
format=
"HH:mm"
opens
();
onChange=
{
openSelect
}
}
}
placeholder=
{
placeholder
}
>
defaultOpenValue=
{
moment
(
'00:00'
,
'HH:mm'
)
}
<
span
>
{
imgOpen
[
0
]
}
</
span
>
-
<
span
>
{
imgOpen
[
1
]
}
</
span
>
disabled=
{
disabled
}
{
Scheduled
?
(
/>
<
CloseCircleOutlined
twoToneColor=
"#333"
/>
)
:
(
<
DownOutlined
style=
{
{
color
:
'#d9d9d9'
}
}
className=
{
Scheduled
?
'icon icon-up'
:
'icon'
}
/>
)
}
</
div
>
{
/* 时间段选择 */
}
{
Scheduled
?
(
<
div
className=
"slot"
>
{
/* 可选时间 */
}
<
div
className=
"opens"
>
{
Quantum
.
length
>
0
?
(
Quantum
.
map
((
item
:
any
,
index
:
any
)
=>
{
return
(
<
span
key=
{
index
}
className=
{
item
.
active
?
`sapa active ${item.disabled ? 'disabled' : ''}`
:
`sapa ${item.disabled ? 'disabled' : ''}`
}
onClick=
{
()
=>
{
onclicks
(
item
,
index
);
}
}
>
{
item
.
id
<
10
?
`0${item.id}`
:
item
.
id
}
:00-
{
item
.
id
+
1
<
10
?
`0${item.id + 1}`
:
item
.
id
+
1
}
:00
</
span
>
);
})
)
:
(
<
div
className=
"nodata"
>
<
LinkOutlined
/>
<
li
>
No time to choose
</
li
>
</
div
>
)
}
</
div
>
{
/* 确认按钮 */
}
{
Quantum
.
length
>
0
?
(
<
div
className=
"oks"
>
<
Button
size=
"small"
icon=
{
<
CloseOutlined
/>
}
onClick=
{
()
=>
{
cancel
();
}
}
>
Cancel
</
Button
>
<
Button
type=
"primary"
icon=
{
<
CheckOutlined
/>
}
size=
"small"
onClick=
{
()
=>
{
oks
();
}
}
>
OK
</
Button
>
</
div
>
)
:
(
''
)
}
</
div
>
)
:
(
)
:
(
<
Select
''
style=
{
{
width
:
140
}
}
placeholder=
{
placeholder
}
disabled=
{
disabled
}
onSelect=
{
openSelect
}
>
{
hourS
}
</
Select
>
)
}
)
}
</>
</
div
>
);
);
};
};
...
...
src/components/OnTime/OnTimeTow.tsx
View file @
212aeb1a
...
@@ -3,7 +3,7 @@ import { TimePicker } from 'antd';
...
@@ -3,7 +3,7 @@ import { TimePicker } from 'antd';
const
{
RangePicker
}
=
TimePicker
;
const
{
RangePicker
}
=
TimePicker
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
const
OnTime
=
(
porps
:
any
)
=>
{
const
OnTime
Tow
=
(
porps
:
any
)
=>
{
// disabled 是否禁止
// disabled 是否禁止
// limit 默认开放时间
// limit 默认开放时间
// inhibitTime 禁止选择时间
// inhibitTime 禁止选择时间
...
@@ -53,4 +53,4 @@ const OnTime = (porps: any) => {
...
@@ -53,4 +53,4 @@ const OnTime = (porps: any) => {
);
);
};
};
export
default
OnTime
;
export
default
OnTime
Tow
;
src/models/CommunityManagement/FacilityBookings.ts
View file @
212aeb1a
...
@@ -133,7 +133,7 @@ export default {
...
@@ -133,7 +133,7 @@ export default {
if
(
JSON
.
stringify
(
Data3
)
==
"{}"
)
{
if
(
JSON
.
stringify
(
Data3
)
==
"{}"
)
{
Data3
=
false
Data3
=
false
// 提示小区没有设施
// 提示小区没有设施
message
.
error
(
'There Are No Facilities In The Community !'
);
message
.
warning
(
'There Are No Facilities In The Community !'
);
}
}
yield
put
({
type
:
'returnPage3'
,
Data3
});
yield
put
({
type
:
'returnPage3'
,
Data3
});
...
...
src/pages/AccountManagement/account/AccountAdds.tsx
View file @
212aeb1a
...
@@ -204,10 +204,10 @@ const Account = (props: any) => {
...
@@ -204,10 +204,10 @@ const Account = (props: any) => {
permissionArray
:
newData
,
permissionArray
:
newData
,
};
};
console
.
log
(
value
);
//
console.log(value);
console
.
log
(
obj
);
//
console.log(obj);
//
RA(38, value, module, dispatch); // 信息上传
RA
(
38
,
value
,
module
,
dispatch
);
// 信息上传
//
RA(42, obj, module, dispatch); // 权限上传
RA
(
42
,
obj
,
module
,
dispatch
);
// 权限上传
return
true
;
return
true
;
}
}
};
};
...
...
src/pages/AccountManagement/account/AccountEdit.tsx
View file @
212aeb1a
...
@@ -529,7 +529,7 @@ const Account = (props: any) => {
...
@@ -529,7 +529,7 @@ const Account = (props: any) => {
localStorage
.
getItem
(
'towAccount'
)
||
'[{"id":1,"tosAccountName":"test"}]'
,
localStorage
.
getItem
(
'towAccount'
)
||
'[{"id":1,"tosAccountName":"test"}]'
,
);
);
console
.
log
(
towAccount
);
//
console.log(towAccount);
// 选择哪个二级账号
// 选择哪个二级账号
const
handleChange
=
(
value
:
any
)
=>
{
const
handleChange
=
(
value
:
any
)
=>
{
...
...
src/pages/CommunityManagement/CellList/Adds.tsx
View file @
212aeb1a
...
@@ -450,7 +450,11 @@ const Adds = (props: any) => {
...
@@ -450,7 +450,11 @@ const Adds = (props: any) => {
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"Working Hours"
name=
"workingHours"
rules=
{
village
[
3
]
as
any
}
>
<
Form
.
Item
label=
"Working Hours"
name=
"workingHours"
rules=
{
village
[
3
]
as
any
}
>
<
RangePicker
format=
"HH:mm"
placeholder=
{
[
'Start Time'
,
'End Time'
]
}
/>
<
RangePicker
minuteStep=
{
60
}
format=
"HH:mm"
placeholder=
{
[
'Start Time'
,
'End Time'
]
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
label=
"Community Telephone"
name=
"info"
rules=
{
[{
required
:
false
}]
}
>
<
Form
.
Item
label=
"Community Telephone"
name=
"info"
rules=
{
[{
required
:
false
}]
}
>
...
...
src/pages/CommunityManagement/FacilityBookings/Bookings.tsx
View file @
212aeb1a
...
@@ -17,7 +17,8 @@ import { validateMessages } from '@/utils/params';
...
@@ -17,7 +17,8 @@ import { validateMessages } from '@/utils/params';
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
{
BookingsTip
}
from
'@/utils/tip'
;
import
{
BookingsTip
}
from
'@/utils/tip'
;
// 自定义时间段
// 自定义时间段
import
OnTime
from
'@/components/OnTime/OnTimeTow'
;
// import OnTimeTow from '@/components/OnTime/OnTimeTow';
import
OnTimeTow
from
'@/components/OnTime/OnTime'
;
const
Bookings
=
(
props
:
any
)
=>
{
const
Bookings
=
(
props
:
any
)
=>
{
const
{
dispatch
,
Data3
,
Result
,
DataSave
,
token
,
load
,
resultTime
,
Remaining
}
=
props
;
const
{
dispatch
,
Data3
,
Result
,
DataSave
,
token
,
load
,
resultTime
,
Remaining
}
=
props
;
...
@@ -139,17 +140,17 @@ const Bookings = (props: any) => {
...
@@ -139,17 +140,17 @@ const Bookings = (props: any) => {
// 没有次数
// 没有次数
if
(
Remaining
.
canReservationNum
==
0
)
{
if
(
Remaining
.
canReservationNum
==
0
)
{
message
.
error
(
'No bookable times'
);
message
.
warning
(
'No bookable times'
);
return
false
;
return
false
;
}
}
// 判断时间选择
// 判断时间选择
if
(
value
.
Time
==
null
)
{
if
(
value
.
Time
==
null
)
{
message
.
error
(
'Please Fill In The Appointment Period!'
);
message
.
warning
(
'Please Fill In The Appointment Period!'
);
return
false
;
return
false
;
}
}
// 手机判断
// 手机判断
if
(
tmp
.
accountPhone
&&
tmp
.
accountPhone
.
length
!=
11
&&
tmp
.
accountPhone
.
length
!=
8
)
{
if
(
tmp
.
accountPhone
&&
tmp
.
accountPhone
.
length
!=
11
&&
tmp
.
accountPhone
.
length
!=
8
)
{
message
.
error
(
'Please Fill In The Contact Information Correctly!'
);
message
.
warning
(
'Please Fill In The Contact Information Correctly!'
);
return
false
;
return
false
;
}
}
// 小区信息
// 小区信息
...
@@ -173,12 +174,10 @@ const Bookings = (props: any) => {
...
@@ -173,12 +174,10 @@ const Bookings = (props: any) => {
}
}
// 姓名长度
// 姓名长度
if
(
tmp
.
accountName
&&
tmp
.
accountName
.
length
<
2
)
{
if
(
tmp
.
accountName
&&
tmp
.
accountName
.
length
<
2
)
{
message
.
error
(
'User Name Should be limit 2~30!'
,
3
);
message
.
warning
(
'User Name Should be limit 2~30!'
,
3
);
}
else
{
}
else
{
tmp
.
reservedTimeList
=
[
// tmp.reservedTimeList = Array.from(new Set(value.Time)); // 预约时间 不需要去重也可
moment
(
value
.
Time
[
0
]).
format
(
'HH:mm'
),
tmp
.
reservedTimeList
=
value
.
Time
;
// 预约时间
moment
(
value
.
Time
[
1
]).
format
(
'HH:mm'
),
];
// 预约时间
// 选择的总时间段
// 选择的总时间段
let
times
=
[]
as
any
;
let
times
=
[]
as
any
;
...
@@ -204,7 +203,7 @@ const Bookings = (props: any) => {
...
@@ -204,7 +203,7 @@ const Bookings = (props: any) => {
// 如果选择的时间段有其他包含的话 给出提示,否则 可以提交
// 如果选择的时间段有其他包含的话 给出提示,否则 可以提交
if
(
fruit
)
{
if
(
fruit
)
{
// 判断选的时间 是不是结束时间小于开始时间
// 判断选的时间 是不是结束时间小于开始时间
message
.
error
(
'Reservation period already exists!'
);
message
.
warning
(
'Reservation period already exists!'
);
return
false
;
return
false
;
}
else
{
}
else
{
delete
tmp
.
Time
;
delete
tmp
.
Time
;
...
@@ -325,12 +324,13 @@ const Bookings = (props: any) => {
...
@@ -325,12 +324,13 @@ const Bookings = (props: any) => {
};
};
// 点击确定时间
// 点击确定时间
const
onChanges
=
(
value
:
any
,
b
:
any
)
=>
{
const
onChanges
=
(
value
:
any
)
=>
{
// console.log(value);
let
a
=
parseInt
(
moment
(
value
[
1
],
'HH:mm'
).
format
(
'HH'
))
-
1
;
// console.log(b);
let
b
=
moment
(
a
,
'HH'
).
format
(
'HH:mm'
);
let
c
=
[
value
[
0
],
b
];
// 修改后的时间
// 修改后的时间
formRef
.
current
.
setFieldsValue
({
formRef
.
current
.
setFieldsValue
({
Time
:
[
moment
(
b
[
0
],
'HH:mm'
),
moment
(
b
[
1
],
'HH:mm'
)]
,
Time
:
c
,
});
});
};
};
...
@@ -415,7 +415,7 @@ const Bookings = (props: any) => {
...
@@ -415,7 +415,7 @@ const Bookings = (props: any) => {
</
Col
>
</
Col
>
<
Col
>
<
Col
>
<
Form
.
Item
label=
"Reserve Time"
name=
"Time"
noStyle
>
<
Form
.
Item
label=
"Reserve Time"
name=
"Time"
noStyle
>
<
OnTime
<
OnTime
Tow
disabled=
{
prohibit
}
disabled=
{
prohibit
}
limit=
{
curString
.
categoriesOpenTime
}
// 设施默认禁止时间段
limit=
{
curString
.
categoriesOpenTime
}
// 设施默认禁止时间段
inhibitTime=
{
result
}
// 选择日期后的禁止时间
inhibitTime=
{
result
}
// 选择日期后的禁止时间
...
...
src/pages/ContractManagement/ContractContent.tsx
View file @
212aeb1a
...
@@ -506,11 +506,11 @@ const ContractContent = (props: any) => {
...
@@ -506,11 +506,11 @@ const ContractContent = (props: any) => {
style=
{
{
marginLeft
:
150
,
textTransform
:
'capitalize'
}
}
style=
{
{
marginLeft
:
150
,
textTransform
:
'capitalize'
}
}
>
>
<
p
style=
{
{
marginBottom
:
0
}
}
>
<
p
style=
{
{
marginBottom
:
0
}
}
>
The system will send e
-mail notification in the
{
' '
}
The system will send e
mail on
{
' '
}
<
span
style=
{
{
color
:
'red'
}
}
>
{
state
.
tipTime
[
0
]
}
</
span
>
and
{
' '
}
<
span
style=
{
{
color
:
'red'
}
}
>
{
state
.
tipTime
[
0
]
}
</
span
>
,
{
' '
}
<
span
style=
{
{
color
:
'red'
}
}
>
{
state
.
tipTime
[
1
]
}
</
span
>
and
{
' '
}
<
span
style=
{
{
color
:
'red'
}
}
>
{
state
.
tipTime
[
1
]
}
</
span
>
and
{
' '
}
<
span
style=
{
{
color
:
'red'
}
}
>
{
state
.
tipTime
[
2
]
}
</
span
>
that
the contract is
<
span
style=
{
{
color
:
'red'
}
}
>
{
state
.
tipTime
[
2
]
}
</
span
>
before
the contract is
about to expire
!
about to expire!
</
p
>
</
p
>
<
p
style=
{
{
marginBottom
:
0
}
}
>
<
p
style=
{
{
marginBottom
:
0
}
}
>
<
span
style=
{
{
color
:
'red'
}
}
>
*
</
span
>
If the time has passed, it will not be
<
span
style=
{
{
color
:
'red'
}
}
>
*
</
span
>
If the time has passed, it will not be
...
...
src/pages/ContractManagement/ContractDetail.tsx
View file @
212aeb1a
...
@@ -35,7 +35,7 @@ const ContractContent = (props: any) => {
...
@@ -35,7 +35,7 @@ const ContractContent = (props: any) => {
const
[
fileList
,
setFileList
]
=
useState
([]
as
any
);
// 图片列表
const
[
fileList
,
setFileList
]
=
useState
([]
as
any
);
// 图片列表
const
[
uploadUp
,
setUploadUp
]
=
useState
(
true
);
// 禁止上传 直到选择了小区后
const
[
uploadUp
,
setUploadUp
]
=
useState
(
true
);
// 禁止上传 直到选择了小区后
const
[
comtyName
,
setComtyName
]
=
useState
(
null
);
// 小区名字
const
[
comtyName
,
setComtyName
]
=
useState
(
null
);
// 小区名字
const
[
tipTime
,
setTipTime
]
=
useState
([
'previous month'
,
'two months'
]
as
any
);
//提示时间
const
[
tipTime
,
setTipTime
]
=
useState
([
'previous month'
,
'two months'
,
'there months'
]
as
any
);
//提示时间
const
[
tipModal
,
settipModal
]
=
useState
(
false
);
//附件弹窗
const
[
tipModal
,
settipModal
]
=
useState
(
false
);
//附件弹窗
const
[
fileInfo
,
setfileInfo
]
=
useState
(
null
as
any
);
//附件内容
const
[
fileInfo
,
setfileInfo
]
=
useState
(
null
as
any
);
//附件内容
//pdf 页码内容
//pdf 页码内容
...
@@ -64,13 +64,14 @@ const ContractContent = (props: any) => {
...
@@ -64,13 +64,14 @@ const ContractContent = (props: any) => {
setUploadUp
(
false
);
setUploadUp
(
false
);
// 提示时间
// 提示时间
let
a1
=
moment
(
DataSaveDetail
.
contractValidEndDate
)
// 提示时间
.
subtract
(
2
,
'month'
)
let
a1
=
timeOver
(
DataSaveDetail
.
contractValidEndDate
,
2
);
.
format
(
'YYYY-MM-DD'
);
let
a2
=
timeOver
(
DataSaveDetail
.
contractValidEndDate
,
1
);
let
a2
=
moment
(
DataSaveDetail
.
contractValidEndDate
)
let
a3
=
timeOver
(
DataSaveDetail
.
contractValidEndDate
,
3
);
.
subtract
(
1
,
'month'
)
.
format
(
'YYYY-MM-DD'
);
// setTipTime([a1, a2]);
setTipTime
([
a1
,
a2
]);
setTipTime
([
a3
,
a1
,
a2
]);
// 给到上传绑定
// 给到上传绑定
setComtyName
(
DataSaveDetail
.
communityName
);
setComtyName
(
DataSaveDetail
.
communityName
);
...
@@ -86,6 +87,11 @@ const ContractContent = (props: any) => {
...
@@ -86,6 +87,11 @@ const ContractContent = (props: any) => {
}
}
},
[
DataSaveDetail
]);
},
[
DataSaveDetail
]);
// 时间转换
const
timeOver
=
(
time
:
any
,
day
:
any
)
=>
{
return
moment
(
time
).
subtract
(
day
,
'month'
).
format
(
'YYYY-MM-DD'
);
};
// 监听上传图片列表
// 监听上传图片列表
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
FileImg
!=
null
)
{
if
(
FileImg
!=
null
)
{
...
@@ -191,7 +197,7 @@ const ContractContent = (props: any) => {
...
@@ -191,7 +197,7 @@ const ContractContent = (props: any) => {
<
div
className=
{
styles
.
base
}
>
<
div
className=
{
styles
.
base
}
>
{
/* 头部组件 */
}
{
/* 头部组件 */
}
<
div
className=
{
styles
.
box
}
>
<
div
className=
{
styles
.
box
}
>
<
div
className=
{
styles
.
item1
}
>
{
DataSaveDetail
?
'Detail'
:
'Add'
}
Contract
</
div
>
<
div
className=
{
styles
.
item1
}
>
Contract Details
</
div
>
<
button
className=
{
styles
.
item3
}
onClick=
{
goToReturn
}
>
<
button
className=
{
styles
.
item3
}
onClick=
{
goToReturn
}
>
<
LeftOutlined
/>
<
LeftOutlined
/>
Back
Back
...
@@ -312,10 +318,10 @@ const ContractContent = (props: any) => {
...
@@ -312,10 +318,10 @@ const ContractContent = (props: any) => {
style=
{
{
marginLeft
:
150
,
textTransform
:
'capitalize'
}
}
style=
{
{
marginLeft
:
150
,
textTransform
:
'capitalize'
}
}
>
>
<
p
style=
{
{
marginBottom
:
0
}
}
>
<
p
style=
{
{
marginBottom
:
0
}
}
>
The system will send e
-mail notification in the
{
' '
}
The system will send e
mail on
<
span
style=
{
{
color
:
'red'
}
}
>
{
tipTime
[
0
]
}
</
span
>
{
' '
}
<
span
style=
{
{
color
:
'red'
}
}
>
{
tipTime
[
0
]
}
</
span
>
and
{
' '
}
,
<
span
style=
{
{
color
:
'red'
}
}
>
{
tipTime
[
1
]
}
</
span
>
and
{
' '
}
<
span
style=
{
{
color
:
'red'
}
}
>
{
tipTime
[
1
]
}
</
span
>
that the contract is about to
<
span
style=
{
{
color
:
'red'
}
}
>
{
tipTime
[
2
]
}
</
span
>
before the contract is about
expire
!
to expire
!
</
p
>
</
p
>
<
p
style=
{
{
marginBottom
:
0
}
}
>
<
p
style=
{
{
marginBottom
:
0
}
}
>
<
span
style=
{
{
color
:
'red'
}
}
>
*
</
span
>
If the time has passed, it will not be
<
span
style=
{
{
color
:
'red'
}
}
>
*
</
span
>
If the time has passed, it will not be
...
...
src/pages/runTest/Template.tsx
View file @
212aeb1a
/*
* @Author: your name
* @Date: 2020-11-19 16:54:53
* @LastEditTime: 2021-01-29 20:21:05
* @LastEditors: your name
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\pages\runTest\Template.tsx
*/
import
React
,
{
useEffect
}
from
'react'
;
import
React
,
{
useEffect
}
from
'react'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
...
@@ -22,7 +30,7 @@ const Guard = (props: any) => {
...
@@ -22,7 +30,7 @@ const Guard = (props: any) => {
return
(
return
(
<
div
className=
{
styles
.
base
}
>
<
div
className=
{
styles
.
base
}
>
<
TitleGet
title=
{
'Version 1.6.
0
'
}
/>
<
TitleGet
title=
{
'Version 1.6.
1
'
}
/>
{
/* <p>
{
/* <p>
token:{page.token}
token:{page.token}
name:{getCookie('name')}
name:{getCookie('name')}
...
...
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