Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
schedule
Overview
Overview
Details
Activity
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
fengzhaoyu
schedule
Commits
473ad2f6
Commit
473ad2f6
authored
Sep 27, 2020
by
fengzhaoyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:重复规则
parent
f070a93d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
103 additions
and
92 deletions
+103
-92
list.js
components/list/list.js
+1
-0
constant.js
pages/createMeeting/constant.js
+11
-0
createMeeting.axml
pages/createMeeting/createMeeting.axml
+3
-5
createMeeting.js
pages/createMeeting/createMeeting.js
+75
-87
utils.js
utils/utils.js
+13
-0
No files found.
components/list/list.js
View file @
473ad2f6
...
@@ -24,6 +24,7 @@ Component({
...
@@ -24,6 +24,7 @@ Component({
didUnmount
()
{
},
didUnmount
()
{
},
methods
:
{
methods
:
{
comSelectList
(
event
)
{
comSelectList
(
event
)
{
debugger
if
(
this
.
props
.
multiple
&&
event
.
currentTarget
.
dataset
.
item
.
id
!=
-
1
)
{
if
(
this
.
props
.
multiple
&&
event
.
currentTarget
.
dataset
.
item
.
id
!=
-
1
)
{
if
(
this
.
data
.
comSelectList
.
includes
(
-
1
))
{
if
(
this
.
data
.
comSelectList
.
includes
(
-
1
))
{
this
.
setData
({
this
.
setData
({
...
...
pages/createMeeting/constant.js
0 → 100644
View file @
473ad2f6
export
const
repeatWeek
=
[
'SU'
,
'MO'
,
'TU'
,
'WE'
,
'TH'
,
'FR'
,
'SA'
]
export
const
repeatList
=
[
{
id
:
0
,
text
:
'不重复'
,
icon
:
'iconicon_cycle'
,
repeatable
:
0
,
recurrenceModel
:
{
model
:
'no_repeat'
}
},
{
id
:
1
,
text
:
'每天'
,
icon
:
''
,
repeatable
:
1
,
recurrenceModel
:
{
model
:
'daily'
,
interval
:
1
,
initialTime
:
`2020-03-23`
,
terminateTime
:
`2022-03-23`
,
weekDayList
:
null
}
},
{
id
:
2
,
text
:
'每周'
,
icon
:
''
,
repeatable
:
1
,
recurrenceModel
:
{
model
:
'weekly'
,
interval
:
1
,
initialTime
:
`2020-03-23`
,
terminateTime
:
`2022-03-23`
,
weekDayList
:
[
'MO'
]
}
},
{
id
:
3
,
text
:
'每周的工作日'
,
icon
:
''
,
repeatable
:
1
,
recurrenceModel
:
{
model
:
'weekly'
,
interval
:
1
,
initialTime
:
`2020-03-23`
,
terminateTime
:
`2022-03-23`
,
weekDayList
:
[
'MO'
,
'TU'
,
'WE'
,
'TH'
,
'FR'
]
}
},
{
id
:
4
,
text
:
'每月'
,
icon
:
''
,
repeatable
:
1
,
recurrenceModel
:
{
model
:
'absolute_Monthly'
,
daysOfMonth
:
[
'23'
],
interval
:
1
,
initialTime
:
`2020-03-23`
,
terminateTime
:
`2022-03-23`
,
weekDayList
:
null
}
}
]
\ No newline at end of file
pages/createMeeting/createMeeting.axml
View file @
473ad2f6
<view class="createMeeting ">
<view class="createMeeting ">
<button size="default" onTap="click" type="primary">Button</button>
<!-- title remark 标题 描述 -->
<!-- title remark 标题 描述 -->
<view class="createTitle">
<view class="createTitle">
<view class="title">
<view class="title">
...
@@ -41,7 +40,7 @@
...
@@ -41,7 +40,7 @@
{{comListData.repeatList[comListData.comSelectListId].text}}重复
{{comListData.repeatList[comListData.comSelectListId].text}}重复
</view>
</view>
</view>
</view>
<view class="icon iconfont iconicon_repeat1 " catchTap="
showPopup" data-type='repeat'
a:if="{{comListData.comSelectListId == 0}}">
<view class="icon iconfont iconicon_repeat1 " catchTap="
handleRepeatModal"
a:if="{{comListData.comSelectListId == 0}}">
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -92,8 +91,6 @@
...
@@ -92,8 +91,6 @@
</view>
</view>
<popup title="{{popup.title}}" show="{{popup.show}}" mask="{{popup.mask}}" onClose="closePopup">
<popup title="{{popup.title}}" show="{{popup.show}}" mask="{{popup.mask}}" onClose="closePopup">
<meeting-time-picker a:if="{{'time' === popup.type}}" onComplete="onComplete" isIPX="{{isIPX}}"></meeting-time-picker>
<meeting-time-picker a:if="{{'time' === popup.type}}" onComplete="onComplete" isIPX="{{isIPX}}"></meeting-time-picker>
<hlist a:if="{{'participator' === popup.type}}" dataComList="{{comHListData.contactData}}" onSelectComHList="selectComHList"></hlist>
<list a:if="{{popup.type=='repeat'}}" dataComList="{{repeat.repeatList}}" onComSelectList="selectRepeatListItem"></list>
<list a:if="{{popup.type=='repeat'}}" dataComList="{{comType=='repeat' ? comListData.repeatList : comListData.meetingWayList}}" onComSelectList="selectComList" comSelectListId="{{comType=='repeat' ? comListData.comSelectListId : comListData.meetingWayModelId}}" iconType="{{comListData.iconType}}">
</list>
</popup>
</popup>
</view>
</view>
\ No newline at end of file
pages/createMeeting/createMeeting.js
View file @
473ad2f6
import
{
addSchedule
,
updateMeetingTask
,
get
UserScheduleInTime
,
get
DeviceBySn
}
from
'../../api/request.js'
import
{
addSchedule
,
updateMeetingTask
,
getDeviceBySn
}
from
'../../api/request.js'
import
{
throttle
,
getInterTime
,
getShowTime
}
from
'./../../utils/utils.js'
import
{
throttle
,
getInterTime
,
getShowTime
,
getTwoYearToday
}
from
'./../../utils/utils.js'
import
{
checkFullScren
}
from
"../../utils/checkFullScren"
;
import
{
checkFullScren
}
from
"../../utils/checkFullScren"
;
import
{
repeatList
}
from
"./constant"
import
create
from
'dd-store'
import
create
from
'dd-store'
import
pageStore
from
'../meetingDetail/store'
;
import
pageStore
from
'../meetingDetail/store'
;
create
.
Page
({
create
.
Page
({
...
@@ -17,22 +20,10 @@ create.Page({
...
@@ -17,22 +20,10 @@ create.Page({
{
id
:
3
,
text
:
'每周的工作日'
,
icon
:
''
,
repeatable
:
1
,
recurrenceModel
:
{
model
:
'weekly'
,
interval
:
1
,
initialTime
:
`2020-03-23`
,
terminateTime
:
`2022-03-23`
,
weekDayList
:
[
'MO'
,
'TU'
,
'WE'
,
'TH'
,
'FR'
]
}
},
{
id
:
3
,
text
:
'每周的工作日'
,
icon
:
''
,
repeatable
:
1
,
recurrenceModel
:
{
model
:
'weekly'
,
interval
:
1
,
initialTime
:
`2020-03-23`
,
terminateTime
:
`2022-03-23`
,
weekDayList
:
[
'MO'
,
'TU'
,
'WE'
,
'TH'
,
'FR'
]
}
},
{
id
:
4
,
text
:
'每月'
,
icon
:
''
,
repeatable
:
1
,
recurrenceModel
:
{
model
:
'absolute_Monthly'
,
daysOfMonth
:
[
'23'
],
interval
:
1
,
initialTime
:
`2020-03-23`
,
terminateTime
:
`2022-03-23`
,
weekDayList
:
null
}
}
{
id
:
4
,
text
:
'每月'
,
icon
:
''
,
repeatable
:
1
,
recurrenceModel
:
{
model
:
'absolute_Monthly'
,
daysOfMonth
:
[
'23'
],
interval
:
1
,
initialTime
:
`2020-03-23`
,
terminateTime
:
`2022-03-23`
,
weekDayList
:
null
}
}
],
],
meetingWayList
:
[
// { id: 0, text: 'Webex meeting', imageUrl: '../../assests/Webex.png', meetingWayModel: { model: 'webex' } },
{
id
:
0
,
text
:
'钉钉'
,
imageUrl
:
'../../assests/dingding.png'
,
meetingWayModel
:
{
model
:
'dingtalk'
}
},
{
id
:
1
,
text
:
'Zoom Meeting'
,
imageUrl
:
'../../assests/Zoom.png'
,
meetingWayModel
:
{
model
:
'zoom'
}
}
],
comSelectListId
:
0
,
comSelectListId
:
0
,
meetingWayModelId
:
null
,
iconType
:
'icon'
iconType
:
'icon'
},
},
// 传给组件 hList 水平排列 所有数据 comHListData
comHListData
:
{
contactData
:
[
{
id
:
0
,
text
:
'钉钉联系人'
,
imageUrl
:
'../../assests/dingContact.png'
},
{
id
:
1
,
text
:
'手动添加邮箱'
,
imageUrl
:
'../../assests/emailContact.png'
}
]
},
title
:
``
,
title
:
``
,
remark
:
''
,
remark
:
''
,
isShowRemark
:
false
,
isShowRemark
:
false
,
...
@@ -43,19 +34,20 @@ create.Page({
...
@@ -43,19 +34,20 @@ create.Page({
type
:
''
type
:
''
},
},
showTime
:
''
,
showTime
:
''
,
placeholder
:
''
,
repeatable
:
0
,
isIPX
:
false
,
repeat
:
{
repeatList
:
repeatList
,
recurrenceModel
:
{
model
:
'no_repeat'
},
recurrenceModel
:
{
model
:
'no_repeat'
},
repeatWeek
:
[
'SU'
,
'MO'
,
'TU'
,
'WE'
,
'TH'
,
'FR'
,
'SA'
],
repeatable
:
0
,
popupTitle
:
'会议重复'
,
},
popupShow
:
false
,
// repeatWeek: ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'],
comType
:
''
,
comType
:
''
,
comTimeType
:
''
,
comTimeType
:
''
,
weekList
:
[
'周日'
,
'周一'
,
'周二'
,
'周三'
,
'周四'
,
'周五'
,
'周六'
],
weekList
:
[
'周日'
,
'周一'
,
'周二'
,
'周三'
,
'周四'
,
'周五'
,
'周六'
],
week
:
''
,
week
:
''
,
conflictPeople
:
[],
placeholder
:
''
,
isIPX
:
false
,
limitClick
:
false
,
limitClick
:
false
,
},
},
onLoad
(
query
)
{
onLoad
(
query
)
{
...
@@ -77,17 +69,10 @@ create.Page({
...
@@ -77,17 +69,10 @@ create.Page({
this
.
reset
()
this
.
reset
()
},
},
onShow
()
{
onShow
()
{
if
(
this
.
$store
.
data
.
participatorList
.
length
>
1
)
{
this
.
conflictPeople
()
}
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
update
()
this
.
update
()
},
100
)
},
100
)
},
},
click
()
{
updateMeetingTask
()
},
// 添加标题
// 添加标题
handleChangeTitle
(
event
)
{
handleChangeTitle
(
event
)
{
...
@@ -122,7 +107,7 @@ create.Page({
...
@@ -122,7 +107,7 @@ create.Page({
this
.
update
()
this
.
update
()
},
},
// 选择时间
// 选择时间
打开popup
handleTime
()
{
handleTime
()
{
this
.
setData
({
this
.
setData
({
popup
:
{
popup
:
{
...
@@ -161,6 +146,63 @@ create.Page({
...
@@ -161,6 +146,63 @@ create.Page({
}
}
},
},
// 选择重复规则 打开popup
handleRepeatModal
()
{
this
.
setData
({
popup
:
{
show
:
true
,
title
:
"重复规则"
,
mask
:
true
,
type
:
'repeat'
}
})
},
// selectRepeatList
selectRepeatListItem
(
event
)
{
const
item
=
event
.
currentTarget
.
dataset
.
item
const
repeatModal
=
dealRepeatModal
(
item
)
},
// 处理重复模型
dealRepeatModal
(
item
)
{
// 不重复
if
(
item
.
repeatable
===
0
)
{
return
{
repeatable
:
item
.
repeatable
,
recurrenceModel
:
item
.
recurrenceModel
}
}
const
initialTime
=
this
.
$store
.
data
.
startTime
.
replace
(
/
\/
/g
,
"-"
).
substring
(
0
,
10
)
const
terminateTime
=
getTwoYearToday
(
this
.
$store
.
data
.
startTime
)
const
recurrenceModel
=
{
modal
:
item
.
recurrenceModel
.
modal
,
initialTime
:
initialTime
,
terminateTime
:
terminateTime
}
// 每月重复
if
(
item
.
recurrenceModel
.
model
===
"absolute_Monthly"
)
{
recurrenceModel
.
interval
=
1
recurrenceModel
.
daysOfMonth
=
[
new
Date
(
this
.
$store
.
data
.
startTime
).
getDate
()]
return
{
repeatable
:
item
.
repeatable
,
recurrenceModel
:
recurrenceModel
}
}
// 每周重复
if
(
item
.
recurrenceModel
.
weekDayList
&&
item
.
recurrenceModel
.
weekDayList
.
length
>
4
)
{
}
// 每周的一天重复
return
{
repeatable
:
item
.
repeatable
,
recurrenceModel
:
recurrenceModel
}
},
// 关闭popup
// 关闭popup
closePopup
()
{
closePopup
()
{
this
.
setData
({
this
.
setData
({
...
@@ -204,16 +246,6 @@ create.Page({
...
@@ -204,16 +246,6 @@ create.Page({
break
break
}
}
},
},
// 所有的关闭操作
close
(
event
)
{
switch
(
event
.
target
.
dataset
.
close
)
{
case
'meetingWayModel'
:
this
.
setData
({
'comListData.meetingWayModelId'
:
null
,
meetingWayModel
:
null
})
}
},
// 选择循环机制 选择会议方式 选择时间 出现popup弹窗
// 选择循环机制 选择会议方式 选择时间 出现popup弹窗
showPopup
(
event
)
{
showPopup
(
event
)
{
...
@@ -247,7 +279,7 @@ create.Page({
...
@@ -247,7 +279,7 @@ create.Page({
for
(
let
value
of
this
.
data
.
comListData
.
repeatList
)
{
for
(
let
value
of
this
.
data
.
comListData
.
repeatList
)
{
if
(
index
)
{
if
(
index
)
{
value
.
recurrenceModel
.
initialTime
=
this
.
$store
.
data
.
startTime
.
replace
(
/
\/
/g
,
"-"
).
substring
(
0
,
10
)
value
.
recurrenceModel
.
initialTime
=
this
.
$store
.
data
.
startTime
.
replace
(
/
\/
/g
,
"-"
).
substring
(
0
,
10
)
value
.
recurrenceModel
.
terminateTime
=
this
.
getTwoYearToday
(
this
.
$store
.
data
.
startTime
)
value
.
recurrenceModel
.
terminateTime
=
getTwoYearToday
(
this
.
$store
.
data
.
startTime
)
if
(
index
===
2
)
{
if
(
index
===
2
)
{
value
.
recurrenceModel
.
weekDayList
=
[
this
.
data
.
repeatWeek
[
new
Date
(
this
.
$store
.
data
.
startTime
).
getDay
()]]
value
.
recurrenceModel
.
weekDayList
=
[
this
.
data
.
repeatWeek
[
new
Date
(
this
.
$store
.
data
.
startTime
).
getDay
()]]
}
else
if
(
index
===
4
)
{
}
else
if
(
index
===
4
)
{
...
@@ -302,26 +334,12 @@ create.Page({
...
@@ -302,26 +334,12 @@ create.Page({
break
;
break
;
}
}
},
},
// 获取两年后的今天
getTwoYearToday
(
startTime
)
{
let
date
=
new
Date
(
startTime
)
date
.
setYear
(
date
.
getFullYear
()
+
2
)
let
year
=
date
.
getFullYear
();
let
month
=
date
.
getMonth
()
+
1
<
10
?
'0'
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
;
let
day
=
date
.
getDate
()
<
10
?
'0'
+
date
.
getDate
()
:
date
.
getDate
()
return
year
+
'-'
+
month
+
'-'
+
day
},
// 添加参会人
// 添加参会人
handleAddParticipator
:
throttle
(
function
()
{
handleAddParticipator
:
throttle
(
function
()
{
const
_that
=
this
const
_that
=
this
let
require
=
[]
let
require
=
[]
let
select
=
[]
let
select
=
[]
// let outLookConcat = []
// for (let participator of _that.$store.data.participatorList) {
// if (participator.platform === 'outlook') {
// outLookConcat.push(participator)
// }
// }
select
=
this
.
$store
.
data
.
participatorUserId
select
=
this
.
$store
.
data
.
participatorUserId
require
=
[
getApp
().
globalData
.
userid
]
require
=
[
getApp
().
globalData
.
userid
]
select
=
_that
.
selectedelRequired
(
require
,
select
).
pickedUsers
select
=
_that
.
selectedelRequired
(
require
,
select
).
pickedUsers
...
@@ -340,12 +358,10 @@ create.Page({
...
@@ -340,12 +358,10 @@ create.Page({
participatorList
.
push
({
userId
:
item
.
userId
,
username
:
item
.
name
,
headUrl
:
item
.
avatar
,
platform
:
'dingtalk'
})
participatorList
.
push
({
userId
:
item
.
userId
,
username
:
item
.
name
,
headUrl
:
item
.
avatar
,
platform
:
'dingtalk'
})
participatorUserId
.
push
(
item
.
userId
)
participatorUserId
.
push
(
item
.
userId
)
})
})
participatorList
=
_that
.
setArrary
(
participatorList
.
concat
(
outLookConcat
))
participatorUserId
=
[...
new
Set
(
participatorUserId
)]
participatorUserId
=
[...
new
Set
(
participatorUserId
)]
_that
.
$store
.
data
.
participatorList
=
participatorList
_that
.
$store
.
data
.
participatorList
=
participatorList
_that
.
$store
.
data
.
participatorUserId
=
participatorUserId
_that
.
$store
.
data
.
participatorUserId
=
participatorUserId
_that
.
update
()
_that
.
update
()
_that
.
conflictPeople
()
},
},
fail
:
function
(
err
)
{
fail
:
function
(
err
)
{
}
}
...
@@ -437,34 +453,6 @@ create.Page({
...
@@ -437,34 +453,6 @@ create.Page({
let
day
=
date
.
getDate
()
<
10
?
'0'
+
date
.
getDate
()
:
date
.
getDate
()
let
day
=
date
.
getDate
()
<
10
?
'0'
+
date
.
getDate
()
:
date
.
getDate
()
let
hour
=
date
.
getHours
()
<
10
?
'0'
+
date
.
getHours
()
:
date
.
getHours
()
let
hour
=
date
.
getHours
()
<
10
?
'0'
+
date
.
getHours
()
:
date
.
getHours
()
let
miunutes
=
date
.
getMinutes
()
<
10
?
'0'
+
date
.
getMinutes
()
:
date
.
getMinutes
()
let
miunutes
=
date
.
getMinutes
()
<
10
?
'0'
+
date
.
getMinutes
()
:
date
.
getMinutes
()
return
`
${
year
}
/
${
month
}
/
${
day
}
${
hour
}
:
${
miunutes
}
:00`
return
`
${
year
}
/
${
month
}
/
${
day
}
${
hour
}
:
${
miunutes
}
:00`
},
},
// 会议冲突
conflictPeople
()
{
let
userIds
=
[]
for
(
let
value
of
this
.
$store
.
data
.
participatorList
)
{
userIds
.
push
(
value
.
userId
)
}
let
data
=
{
startTime
:
this
.
$store
.
data
.
startTime
.
replace
(
/
\/
/g
,
"-"
),
endTime
:
this
.
$store
.
data
.
endTime
.
replace
(
/
\/
/g
,
"-"
),
userIds
:
userIds
}
getUserScheduleInTime
(
data
).
then
(
res
=>
{
let
conflictPeople
=
[]
for
(
let
value
in
res
.
data
.
data
)
{
const
arr
=
res
.
data
.
data
[
value
].
filter
(
function
(
item
)
{
return
item
.
confirmAttendance
===
1
})
if
(
arr
.
length
>
0
)
{
conflictPeople
.
push
(
value
)
}
}
this
.
setData
({
conflictPeople
:
conflictPeople
})
})
}
});
});
utils/utils.js
View file @
473ad2f6
...
@@ -180,3 +180,16 @@ export function getShowTime(startTime, endTime) {
...
@@ -180,3 +180,16 @@ export function getShowTime(startTime, endTime) {
}
}
return
`
${
startTime
.
substring
(
5
,
7
)}
月
${
startTime
.
substring
(
8
,
10
)}
日
${
weekList
[
weekIndex
]}
${
startTime
.
substring
(
11
,
16
)}
-
${
endTime
.
substring
(
11
,
16
)}
`
return
`
${
startTime
.
substring
(
5
,
7
)}
月
${
startTime
.
substring
(
8
,
10
)}
日
${
weekList
[
weekIndex
]}
${
startTime
.
substring
(
11
,
16
)}
-
${
endTime
.
substring
(
11
,
16
)}
`
}
}
/*
获取两年后的今天
*/
export
function
getTwoYearToday
(
startTime
)
{
let
date
=
new
Date
(
startTime
)
date
.
setYear
(
date
.
getFullYear
()
+
2
)
let
year
=
date
.
getFullYear
();
let
month
=
date
.
getMonth
()
+
1
<
10
?
'0'
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
;
let
day
=
date
.
getDate
()
<
10
?
'0'
+
date
.
getDate
()
:
date
.
getDate
()
return
year
+
'-'
+
month
+
'-'
+
day
}
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