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
0391326d
Commit
0391326d
authored
Sep 28, 2020
by
fengzhaoyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit -m "整理代码"
parent
704a2838
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
347 additions
and
598 deletions
+347
-598
list.js
components/list/list.js
+0
-1
createMeeting.axml
pages/createMeeting/createMeeting.axml
+8
-13
createMeeting.js
pages/createMeeting/createMeeting.js
+51
-252
meetingDetail.axml
pages/meetingDetail/meetingDetail.axml
+6
-18
meetingDetail.js
pages/meetingDetail/meetingDetail.js
+110
-66
utils.js
pages/meetingDetail/utils.js
+10
-0
participantsDetail.axml
pages/participantsDetail/participantsDetail.axml
+2
-2
participantsDetail.js
pages/participantsDetail/participantsDetail.js
+48
-235
exampleStore.js
stores/exampleStore.js
+10
-11
utils.js
utils/utils.js
+102
-0
No files found.
components/list/list.js
View file @
0391326d
...
...
@@ -24,7 +24,6 @@ Component({
didUnmount
()
{
},
methods
:
{
comSelectList
(
event
)
{
debugger
if
(
this
.
props
.
multiple
&&
event
.
currentTarget
.
dataset
.
item
.
id
!=
-
1
)
{
if
(
this
.
data
.
comSelectList
.
includes
(
-
1
))
{
this
.
setData
({
...
...
pages/createMeeting/createMeeting.axml
View file @
0391326d
...
...
@@ -36,35 +36,30 @@
<view class="timeText" catchTap="handleTime">
{{showTime}}
</view>
<view class="repeatModal" a:if="{{
comListData.comSelectListId !== 0}}" catchTap="showPopup" data-type='repeat'
>
{{comListData.repeatList[comListData.comSelectLis
tId].text}}重复
<view class="repeatModal" a:if="{{
repeat.repeatable !== 0}}" catchTap="handleRepeatModal"
>
{{repeat.repeatList[repeat.selectRepea
tId].text}}重复
</view>
</view>
<view class="icon iconfont iconicon_repeat1 " catchTap="handleRepeatModal" a:if="{{
comListData.comSelectListId
== 0}}">
<view class="icon iconfont iconicon_repeat1 " catchTap="handleRepeatModal" a:if="{{
repeat.repeatable
== 0}}">
</view>
</view>
</view>
<!-- participatorList participatorUserId 参会人 -->
<view class="participator">
<view class="iconicon_attender iconfont icon {{$data.
p
articipatorList.length>1 ? '' : 'noValueIcon'}}">
<view class="iconicon_attender iconfont icon {{$data.
showP
articipatorList.length>1 ? '' : 'noValueIcon'}}">
</view>
<view class="participatorContaint">
<view class="participatorText" a:if="{{$data.
p
articipatorList.length < 2}}" catchTap="handleAddParticipator" data-type='participator'>
<view class="participatorText" a:if="{{$data.
showP
articipatorList.length < 2}}" catchTap="handleAddParticipator" data-type='participator'>
添加参会人
</view>
<view class="participatorList" a:else>
<view class="participatorListTop">
<view class="participatorText">
<view>
{{$data.participatorList.length}}位参会人
</view>
<view class="conflictStatus" a:if="{{conflictPeople.length}}">
{{conflictPeople.length}}人日程安排冲突
</view>
{{$data.showParticipatorList.length}}位参会人
</view>
<view class="iconright iconfont icon" style=" vertical-align: middle" catchTap="
nextPage" data-nextPage="p
articipantsDetail"></view>
<view class="iconright iconfont icon" style=" vertical-align: middle" catchTap="
goP
articipantsDetail"></view>
</view>
<view class="participatorListBottom" catchTap="
nextPage" data-nextPage="p
articipantsDetail">
<view class="participatorListBottom" catchTap="
goP
articipantsDetail">
<view class="people" a:for="{{$data.participatorList.length > 10 ? [...$data.participatorList].splice(0, 11) : $data.participatorList}}">
<view class="headUrl">
<image a:if="{{item.headUrl}}" mode="scaleToFill" src="{{item.headUrl}}" />
...
...
pages/createMeeting/createMeeting.js
View file @
0391326d
import
{
addSchedule
,
updateMeetingTask
,
getDeviceBySn
}
from
'../../api/request.js'
import
{
throttle
,
getInterTime
,
getShowTime
,
getTwoYearToday
}
from
'./../../utils/utils.js'
import
{
selectPeople
,
modifyTimeImpactRepeat
,
throttle
,
dealRepeatModal
,
getInterTime
,
getShowTime
,
getTwoYearToday
}
from
'./../../utils/utils.js'
import
{
checkFullScren
}
from
"../../utils/checkFullScren"
;
import
{
repeatList
}
from
"./constant"
import
{
repeatList
,
repeatWeek
}
from
"./constant"
import
create
from
'dd-store'
import
pageStore
from
'../meetingDetail/store'
;
create
.
Page
({
...
...
@@ -11,43 +9,24 @@ create.Page({
data
:
{
$data
:
null
,
relatedAppPlatform
:
null
,
// 传给组件list 的所有数据 comListData
comListData
:
{
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
}
}
],
comSelectListId
:
0
,
iconType
:
'icon'
},
title
:
``
,
remark
:
''
,
isShowRemark
:
false
,
showTime
:
''
,
repeat
:
{
repeatList
:
repeatList
,
recurrenceModel
:
{
model
:
'no_repeat'
},
repeatable
:
0
,
selectRepeatId
:
''
},
popup
:
{
show
:
false
,
title
:
''
,
mask
:
''
,
type
:
''
},
showTime
:
''
,
placeholder
:
''
,
isIPX
:
false
,
repeat
:
{
repeatList
:
repeatList
,
recurrenceModel
:
{
model
:
'no_repeat'
},
repeatable
:
0
,
},
// repeatWeek: ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'],
comType
:
''
,
comTimeType
:
''
,
weekList
:
[
'周日'
,
'周一'
,
'周二'
,
'周三'
,
'周四'
,
'周五'
,
'周六'
],
week
:
''
,
limitClick
:
false
,
},
onLoad
(
query
)
{
...
...
@@ -127,24 +106,18 @@ create.Page({
showTime
:
getShowTime
(
this
.
$store
.
data
.
startTime
,
this
.
$store
.
data
.
endTime
)
})
this
.
closePopup
()
this
.
conflictPeople
()
this
.
resetRepeatList
()
/*
改时间 改掉重复规则
先选重复规则 再改时间 重复规则也要改变
暂时修改每周 每月重复问题
*/
if
(
this
.
data
.
recurrenceModel
.
model
===
'weekly'
&&
this
.
data
.
recurrenceModel
.
weekDayList
.
length
===
1
)
{
this
.
setData
({
recurrenceModel
:
this
.
data
.
comListData
.
repeatList
[
2
].
recurrenceModel
})
}
else
if
(
this
.
data
.
recurrenceModel
.
model
===
'absolute_Monthly'
)
{
if
(
this
.
data
.
repeatable
!==
0
)
{
let
recurrenceModel
=
modifyTimeImpactRepeat
(
this
.
data
.
repeat
.
recurrenceModel
)
this
.
setData
({
recurrenceModel
:
this
.
data
.
comListData
.
repeatList
[
4
].
recurrenceModel
'repeat.recurrenceModel'
:
recurrenceModel
})
}
},
// 选择重复规则 打开popup
...
...
@@ -157,51 +130,19 @@ create.Page({
type
:
'repeat'
}
})
},
//
selectRepeatList
//
选择重复
selectRepeatListItem
(
event
)
{
const
item
=
event
.
currentTarget
.
dataset
.
item
const
repeatModal
=
dealRepeatModal
(
item
)
const
repeat
=
dealRepeatModal
(
item
)
this
.
setData
({
'repeat.repeatable'
:
repeat
.
repeatable
,
'repeat.recurrenceModel'
:
repeat
.
recurrenceModel
,
'repeat.selectRepeatId'
:
repeat
.
selectRepeatId
,
})
this
.
closePopup
()
},
// 处理重复模型
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
closePopup
()
{
...
...
@@ -215,181 +156,27 @@ create.Page({
})
},
// 初始化
reset
()
{
this
.
$store
.
resetData
()
this
.
$store
.
data
.
startTime
=
this
.
getTimes
()
this
.
$store
.
data
.
endTime
=
this
.
getTimes
(
new
Date
().
setMinutes
(
new
Date
().
getMinutes
()
+
30
))
this
.
update
()
this
.
setData
({
showTime
:
getShowTime
(
this
.
$store
.
data
.
startTime
,
this
.
$store
.
data
.
endTime
)
})
this
.
resetRepeatList
()
},
Complete
(
data
)
{
this
.
closePop
();
},
// 跳转下一页
nextPage
(
event
)
{
switch
(
event
.
target
.
dataset
.
nextPage
)
{
case
'participantsDetail'
:
dd
.
navigateTo
({
url
:
'./../participantsDetail/participantsDetail'
})
break
}
},
// 选择循环机制 选择会议方式 选择时间 出现popup弹窗
showPopup
(
event
)
{
let
iconType
=
''
let
popupTitle
=
''
switch
(
event
.
currentTarget
.
dataset
.
type
)
{
case
'meetingWayModel'
:
iconType
=
'image'
popupTitle
=
'选择会议方式'
break
case
'repeat'
:
iconType
=
'icon'
popupTitle
=
'会议重复'
break
case
'participator'
:
popupTitle
=
'选择参会人'
break
}
this
.
setData
({
popupTitle
:
popupTitle
,
popupShow
:
true
,
comType
:
event
.
currentTarget
.
dataset
.
type
,
'comListData.iconType'
:
iconType
})
},
resetRepeatList
()
{
let
index
=
0
let
repeatList
=
[]
for
(
let
value
of
this
.
data
.
comListData
.
repeatList
)
{
if
(
index
)
{
value
.
recurrenceModel
.
initialTime
=
this
.
$store
.
data
.
startTime
.
replace
(
/
\/
/g
,
"-"
).
substring
(
0
,
10
)
value
.
recurrenceModel
.
terminateTime
=
getTwoYearToday
(
this
.
$store
.
data
.
startTime
)
if
(
index
===
2
)
{
value
.
recurrenceModel
.
weekDayList
=
[
this
.
data
.
repeatWeek
[
new
Date
(
this
.
$store
.
data
.
startTime
).
getDay
()]]
}
else
if
(
index
===
4
)
{
value
.
recurrenceModel
.
daysOfMonth
=
[
this
.
$store
.
data
.
startTime
.
replace
(
/
\/
/g
,
"-"
).
substring
(
8
,
10
)]
// 添加参会人
handleAddParticipator
:
throttle
(
async
function
()
{
const
select
=
Object
.
keys
(
this
.
$store
.
data
.
participatorList
)
const
require
=
[
getApp
().
globalData
.
userid
]
selectPeople
(
select
,
require
).
then
(
res
=>
{
let
participatorList
=
{
[
getApp
().
globalData
.
userid
]:
{
userId
:
getApp
().
globalData
.
userid
,
username
:
getApp
().
globalData
.
name
,
headUrl
:
getApp
().
globalData
.
avatar
,
platform
:
'dingtalk'
}
}
repeatList
.
push
(
value
)
index
++
}
this
.
setData
({
'comListData.repeatList'
:
repeatList
,
week
:
this
.
data
.
weekList
[
new
Date
(
this
.
$store
.
data
.
startTime
).
getDay
()]
})
},
// 选择完comList后的回调
selectComList
(
event
)
{
switch
(
this
.
data
.
comType
)
{
case
'meetingWayModel'
:
this
.
setData
({
'comListData.meetingWayModelId'
:
event
.
currentTarget
.
dataset
.
item
.
id
,
popupShow
:
false
,
meetingWayModel
:
this
.
data
.
comListData
.
meetingWayList
[
event
.
currentTarget
.
dataset
.
item
.
id
].
meetingWayModel
})
break
;
case
'repeat'
:
this
.
resetRepeatList
()
this
.
setData
({
popupShow
:
false
,
'comListData.comSelectListId'
:
event
.
currentTarget
.
dataset
.
item
.
id
,
repeatable
:
event
.
currentTarget
.
dataset
.
item
.
repeatable
,
recurrenceModel
:
event
.
currentTarget
.
dataset
.
item
.
recurrenceModel
})
this
.
conflictPeople
()
break
;
}
},
// 选择完水平 HList 的回调
selectComHList
(
event
)
{
switch
(
event
.
currentTarget
.
dataset
.
item
.
id
)
{
case
0
:
this
.
addParticipator
()
this
.
setData
({
popupShow
:
false
})
break
;
case
1
:
this
.
setData
({
popupShow
:
false
})
dd
.
navigateTo
({
url
:
'./../outLookContact/outLookContact'
})
break
;
}
},
// 添加参会人
handleAddParticipator
:
throttle
(
function
()
{
const
_that
=
this
let
require
=
[]
let
select
=
[]
select
=
this
.
$store
.
data
.
participatorUserId
require
=
[
getApp
().
globalData
.
userid
]
select
=
_that
.
selectedelRequired
(
require
,
select
).
pickedUsers
dd
.
complexChoose
({
title
:
"选择参会人"
,
//标题
multiple
:
true
,
//是否多选
pickedUsers
:
select
,
//已选用户 s
requiredUsers
:
require
,
//必选用户(不可取消选中状态)
responseUserOnly
:
true
,
//返回人,或者返回人和部门
success
:
function
(
res
)
{
let
participatorList
=
[]
let
participatorUserId
=
[]
participatorList
.
push
({
userId
:
getApp
().
globalData
.
userid
,
username
:
getApp
().
globalData
.
name
,
headUrl
:
getApp
().
globalData
.
avatar
,
platform
:
'dingtalk'
})
participatorUserId
.
push
(
getApp
().
globalData
.
userid
)
res
.
users
.
forEach
((
item
,
index
)
=>
{
participatorList
.
push
({
userId
:
item
.
userId
,
username
:
item
.
name
,
headUrl
:
item
.
avatar
,
platform
:
'dingtalk'
})
participatorUserId
.
push
(
item
.
userId
)
})
participatorUserId
=
[...
new
Set
(
participatorUserId
)]
_that
.
$store
.
data
.
participatorList
=
participatorList
_that
.
$store
.
data
.
participatorUserId
=
participatorUserId
_that
.
update
()
},
fail
:
function
(
err
)
{
for
(
let
i
=
0
;
i
<
res
.
users
.
length
;
i
++
)
{
participatorList
[
res
.
users
[
i
].
userId
]
=
{
userId
:
res
.
users
[
i
].
userId
,
username
:
res
.
users
[
i
].
name
,
headUrl
:
res
.
users
[
i
].
avatar
,
platform
:
'dingtalk'
}
}
this
.
$store
.
data
.
participatorList
=
participatorList
this
.
$store
.
data
.
showParticipatorList
=
Object
.
values
(
participatorList
)
this
.
update
()
})
}),
// 已选用户去中去掉必选用户
selectedelRequired
(
req
,
pic
)
{
for
(
let
i
=
0
;
i
<
req
.
length
;
i
++
)
{
for
(
let
m
=
0
;
m
<
pic
.
length
;
m
++
)
{
if
(
req
[
i
]
==
pic
[
m
])
{
pic
.
splice
(
m
,
1
)
m
--
;
}
}
}
return
{
requiredUsers
:
req
,
pickedUsers
:
pic
}
},
// 数组 去重
setArrary
(
arr
)
{
let
containt
=
{}
for
(
let
x
of
arr
)
{
containt
[
'id'
+
x
.
userId
]
=
x
}
return
Object
.
values
(
containt
)
// 参会人详情
goParticipantsDetail
()
{
dd
.
navigateTo
({
url
:
'./../participantsDetail/participantsDetail'
})
},
addSchedule1
:
throttle
(
async
function
()
{
...
...
@@ -412,9 +199,9 @@ create.Page({
meetingRoomId
:
this
.
$store
.
data
.
roomId
,
scheduleType
:
this
.
$store
.
data
.
roomId
?
'meeting'
:
'common'
,
participatorList
:
!!
this
.
$store
.
data
.
participatorList
.
length
?
this
.
$store
.
data
.
participatorList
:
[{
userId
:
getApp
().
globalData
.
userid
,
username
:
getApp
().
globalData
.
name
,
headUrl
:
getApp
().
globalData
.
avatar
,
platform
:
'dingtalk'
}],
repeatable
:
this
.
data
.
repeatable
,
repeatable
:
this
.
data
.
repeat
.
repeat
able
,
remark
:
this
.
data
.
remark
,
recurrenceModel
:
this
.
data
.
recurrenceModel
,
recurrenceModel
:
this
.
data
.
re
peat
.
re
currenceModel
,
meetingWayModel
:
{
model
:
null
}
}
const
res
=
await
addSchedule
(
data
).
catch
(
err
=>
{
...
...
@@ -424,7 +211,7 @@ create.Page({
if
(
res
.
data
.
code
===
0
)
{
this
.
$store
.
data
.
tabBarIndex
=
'1'
;
this
.
update
();
if
(
this
.
data
.
repeatable
===
0
)
{
if
(
this
.
data
.
repeat
.
repeat
able
===
0
)
{
if
(
this
.
$store
.
addOnceMeeting
)
{
await
this
.
$store
.
addOnceMeeting
({
startTime
:
new
Date
(
this
.
$store
.
data
.
startTime
),
...
...
@@ -445,6 +232,18 @@ create.Page({
}
}),
// 初始化
reset
()
{
this
.
$store
.
resetData
()
this
.
$store
.
data
.
startTime
=
this
.
getTimes
()
this
.
$store
.
data
.
endTime
=
this
.
getTimes
(
new
Date
().
setMinutes
(
new
Date
().
getMinutes
()
+
30
))
this
.
update
()
this
.
setData
({
showTime
:
getShowTime
(
this
.
$store
.
data
.
startTime
,
this
.
$store
.
data
.
endTime
)
})
},
// 获取时间参数
getTimes
(
time
=
new
Date
())
{
let
date
=
getInterTime
(
new
Date
(
time
))
...
...
pages/meetingDetail/meetingDetail.axml
View file @
0391326d
<block a:if="{{getData}}">
<!--<block a:if="{{getData}}"> -->
<block>
<view class=" {{(popupShow || show || centerPopup.showCenterPopup || conToastData.showToast || conSelectPopupData.showSelectPopup || comShareData.isShow )? 'metingDetail' : ''}}">
<import src="../../template/deleteBtn/index.axml"/>
<view class="hideDetail" a:if="{{isExpand}}">
...
...
@@ -6,12 +7,7 @@
{{title}}
</view>
<view class="hideTime">
<text a:if="{{isAcrossDay}}">
{{`${$data.startTime.substring(5, 7)}月${$data.startTime.substring(8, 10)}日 ${$data.startTime.substring(11, 16)}-${$data.endTime.substring(5, 7)}月${$data.endTime.substring(8, 10)}日 ${$data.endTime.substring(11, 16)}`}}
</text>
<text a:else>
{{`${$data.startTime.substring(5, 7)}月${$data.startTime.substring(8, 10)}日 ${week} ${$data.startTime.substring(11, 16)}-${$data.endTime.substring(11, 16)}`}}
</text>
{{showTime}}
</view>
<view class="hideIcon iconfont iconicon_slide" onTap="expand">
</view>
...
...
@@ -61,12 +57,7 @@
<view class="timeContaint">
<view>
<view class="timeText" catchTap="showPopup" data-type='time'>
<text a:if="{{isAcrossDay}}">
{{`${$data.startTime.substring(5, 7)}月${$data.startTime.substring(8, 10)}日 ${$data.startTime.substring(11, 16)}`}}-{{`${$data.endTime.substring(5, 7)}月${$data.endTime.substring(8, 10)}日 ${$data.endTime.substring(11, 16)}`}}
</text>
<text a:else>
{{`${$data.startTime.substring(5, 7)}月${$data.startTime.substring(8, 10)}日 ${week} ${$data.startTime.substring(11, 16)}-${$data.endTime.substring(11, 16)}`}}
</text>
{{showTime}}
<!-- 3月1日 周日 14:00-16:00 -->
</view>
<view class="repeatModal" a:if="{{comListData.comSelectListId !== 0}}" catchTap="showPopup" data-type='repeat'>
...
...
@@ -236,7 +227,4 @@
</view>
</view>
</block>
<view class="loading" a:if="{{loading || !getData}}">
<view class="image">
</view>
</view>
\ No newline at end of file
<!--<view class="loading" a:if="{{loading || !getData}}"><view class="image"></view></view> -->
\ No newline at end of file
pages/meetingDetail/meetingDetail.js
View file @
0391326d
...
...
@@ -3,11 +3,13 @@ import { checkFullScren } from "../../utils/checkFullScren";
import
pageStore
from
'./store'
;
import
{
saveFileInfo
,
getMeetingRoomAffairs
,
createMeetingTask
,
deleteMeetingTask
,
updateMeetingTask
,
uploadPermissions
}
from
'../../api/request'
;
import
{
getOssPermission
,
getuploadResource
,
isParticipate
,
deleteSchedule
,
getScheduleDetail
,
getUserScheduleInTime
,
modifySchedule
,
getMeetingRoomRepeatAffairs
,
updateMoment
,
deleteMoment
}
from
'../../api/request.js'
import
{
throttle
,
getCreateShowTime
}
from
'./../../utils/utils.js'
import
{
getShowTime
,
throttle
,
getCreateShowTime
,
dealRepeatModal
}
from
'./../../utils/utils.js'
import
{
observer
}
from
'/utils/observer.js'
import
{
resolve
}
from
'path'
;
import
{
getFileInfo
,
getFileInfoFromOss
}
from
'./uploadFile.js'
;
import
{
comShareData
}
from
'./const.js'
;
import
{
repeatList
}
from
'../createMeeting/constant'
import
{
getSelectRepeatId
}
from
'./utils'
create
.
Page
({
store
:
pageStore
,
useAll
:
true
,
...
...
@@ -88,15 +90,30 @@ create.Page({
centerPopupId
:
''
},
comShareData
:
comShareData
,
//来自const.js 只做demo展示,没有实际功能
title
:
``
,
remark
:
''
,
isShowRemark
:
false
,
showTime
:
''
,
repeat
:
{
repeatList
:
repeatList
,
recurrenceModel
:
{
model
:
'no_repeat'
},
repeatable
:
0
,
selectRepeatId
:
''
},
popup
:
{
show
:
false
,
title
:
''
,
mask
:
''
,
type
:
''
},
repeatable
:
0
,
recurrenceModel
:
{
model
:
'no_repeat'
},
isShowRemark
:
false
,
repeatWeek
:
[
'SU'
,
'MO'
,
'TU'
,
'WE'
,
'TH'
,
'FR'
,
'SA'
],
popupTitle
:
'会议重复'
,
popupShow
:
false
,
comType
:
''
,
remark
:
''
,
comTimeType
:
''
,
meetingWayModel
:
{
model
:
null
},
weekList
:
[
'周日'
,
'周一'
,
'周二'
,
'周三'
,
'周四'
,
'周五'
,
'周六'
],
...
...
@@ -223,81 +240,107 @@ create.Page({
planDate
:
!!
this
.
data
.
scheduleItem
.
planDate
?
this
.
data
.
scheduleItem
.
planDate
.
replace
(
/
\/
/g
,
'-'
)
:
null
}
getScheduleDetail
(
data
).
then
(
res
=>
{
if
(
res
.
data
.
code
===
0
)
{
if
(
res
.
data
.
code
!==
0
)
{
return
}
if
(
!
res
.
data
.
data
.
id
)
{
console
.
log
(
'详情接口scheduleId不存在'
)
}
let
participatorList
=
[]
let
originUsers
=
[]
let
originUsersId
=
[]
let
participatorUserId
=
[]
let
repeatListMap
=
new
Map
()
for
(
let
value
of
res
.
data
.
data
.
userList
)
{
if
(
value
.
participator
)
{
participatorList
.
push
({
userId
:
value
.
participator
.
userId
,
username
:
value
.
participator
.
username
,
headUrl
:
value
.
participator
.
headUrl
,
platform
:
value
.
participator
.
platform
})
participatorUserId
.
push
(
value
.
participator
.
userId
)
originUsersId
.
push
(
value
.
participator
.
userId
)
originUsers
.
push
({
userId
:
value
.
participator
.
userId
,
username
:
value
.
participator
.
username
,
headUrl
:
value
.
participator
.
headUrl
,
platform
:
value
.
participator
.
platform
})
}
}
for
(
let
item
of
this
.
data
.
comListData
.
repeatList
)
{
if
(
item
.
recurrenceModel
.
recurrenceModel
!==
'weekly'
)
{
repeatListMap
.
set
(
item
.
recurrenceModel
.
model
,
item
.
id
)
}
return
}
this
.
setData
({
id
:
res
.
data
.
data
.
id
,
currentPeople
:
getApp
().
globalData
.
userid
,
aheadTimes
:
!!
res
.
data
.
data
.
aheadTimes
?
res
.
data
.
data
.
aheadTimes
:
[],
'comListData.aheadTimesListId'
:
!!
res
.
data
.
data
.
aheadTimes
?
res
.
data
.
data
.
aheadTimes
:
[
-
1
],
mrReserveStatus
:
res
.
data
.
data
.
mrReserveStatus
,
confirmAttendance
:
res
.
data
.
data
.
confirmAttendance
===
null
?
-
9
:
res
.
data
.
data
.
confirmAttendance
,
organizer
:
res
.
data
.
data
.
organizer
,
'comListData.meetingWayModelId'
:
res
.
data
.
data
.
meetingWayModel
.
model
===
null
?
null
:
(
res
.
data
.
data
.
meetingWayModel
.
model
===
'dingtalk'
?
0
:
1
),
repeatable
:
res
.
data
.
data
.
repeatable
,
recurrenceModel
:
res
.
data
.
data
.
repeatable
?
{
model
:
res
.
data
.
data
.
recurrenceModel
.
model
,
daysOfMonth
:
res
.
data
.
data
.
recurrenceModel
.
daysOfMonth
,
interval
:
1
,
initialTime
:
res
.
data
.
data
.
recurrenceModel
.
initialTime
,
terminateTime
:
res
.
data
.
data
.
recurrenceModel
.
terminateTime
,
weekDayList
:
res
.
data
.
data
.
recurrenceModel
.
weekDayList
}
:
{
model
:
'no_repeat'
},
title
:
res
.
data
.
data
.
title
,
remark
:
res
.
data
.
data
.
remark
,
isExpand
:
res
.
data
.
data
.
confirmAttendance
===
1
?
true
:
false
,
isShowRemark
:
res
.
data
.
data
.
remark
?
true
:
false
,
week
:
this
.
data
.
weekList
[
new
Date
(
res
.
data
.
data
.
startTime
.
replace
(
/-/g
,
"/"
)).
getDay
()],
getData
:
true
,
scheduleItem
:
res
.
data
.
data
,
meetingWayModelData
:
res
.
data
.
data
.
meetingWayModel
})
if
(
res
.
data
.
data
.
repeatable
)
{
this
.
setData
({
'comListData.comSelectListId'
:
res
.
data
.
data
.
recurrenceModel
.
model
===
'weekly'
?
(
res
.
data
.
data
.
recurrenceModel
.
weekDayList
.
length
>
1
?
3
:
2
)
:
repeatListMap
.
get
(
res
.
data
.
data
.
recurrenceModel
.
model
),
})
isShowRemark
:
!!
res
.
data
.
data
.
remark
,
showTime
:
getShowTime
(
res
.
data
.
data
.
startTime
.
replace
(
/-/g
,
"/"
),
res
.
data
.
data
.
endTime
.
replace
(
/-/g
,
"/"
)),
repeat
:
{
repeatable
:
res
.
data
.
data
.
repeatable
,
repeatList
:
repeatList
,
recurrenceModel
:
res
.
data
.
data
.
repeatable
?
res
.
data
.
data
.
recurrenceModel
:
{
model
:
'no_repeat'
},
selectRepeatId
:
res
.
data
.
data
.
repeatable
?
0
:
getSelectRepeatId
(
res
.
data
.
data
.
recurrenceModel
,
repeatList
)
}
this
.
$store
.
data
.
originalData
=
res
.
data
.
data
this
.
$store
.
data
.
originUsers
=
originUsers
this
.
$store
.
data
.
locationName
=
res
.
data
.
data
.
location
.
locationName
this
.
$store
.
data
.
roomId
=
res
.
data
.
data
.
meetingRoomId
<
0
?
''
:
res
.
data
.
data
.
meetingRoomId
})
this
.
store
.
dats
.
scheduleId
=
res
.
data
.
data
.
uuid
this
.
$store
.
data
.
startTime
=
res
.
data
.
data
.
startTime
.
replace
(
/-/g
,
"/"
)
this
.
$store
.
data
.
endTime
=
res
.
data
.
data
.
endTime
.
replace
(
/-/g
,
"/"
)
this
.
$store
.
data
.
participatorList
=
participatorList
this
.
$store
.
data
.
participatorUserId
=
participatorUserId
this
.
$store
.
data
.
originUsersId
=
originUsersId
this
.
update
()
this
.
conflictPeople
()
this
.
store
.
data
.
scheduleId
=
res
.
data
.
data
.
id
;
this
.
store
.
data
.
groupId
=
res
.
data
.
data
.
groupId
;
this
.
update
();
this
.
loadAffairList
();
this
.
resetRepeatList
()
if
(
res
.
data
.
data
.
meetingWayModel
.
model
===
'zoom'
&&
res
.
data
.
data
.
meetingWayModel
.
data
===
null
)
{
setTimeout
(()
=>
{
getScheduleDetail
(
data
).
then
(
success
=>
{
this
.
setData
({
meetingWayModelData
:
res
.
data
.
data
.
meetingWayModel
})
})
},
30000
)
}
}
})
// getScheduleDetail(data).then(res => {
// if (res.data.code === 0) {
// if (!res.data.data.id) {
// console.log('详情接口scheduleId不存在')
// }
// let participatorList = []
// let repeatListMap = new Map()
// for (let value of res.data.data.userList) {
// if (value.participator) {
// participatorList.push({ userId: value.participator.userId, username: value.participator.username, headUrl: value.participator.headUrl, platform: value.participator.platform })
// participatorUserId.push(value.participator.userId)
// originUsersId.push(value.participator.userId)
// originUsers.push({ userId: value.participator.userId, username: value.participator.username, headUrl: value.participator.headUrl, platform: value.participator.platform })
// }
// }
// for (let item of this.data.comListData.repeatList) {
// if (item.recurrenceModel.recurrenceModel !== 'weekly') {
// repeatListMap.set(item.recurrenceModel.model, item.id)
// }
// }
// this.setData({
// id: res.data.data.id,
// currentPeople: getApp().globalData.userid,
// aheadTimes: !!res.data.data.aheadTimes ? res.data.data.aheadTimes : [],
// 'comListData.aheadTimesListId': !!res.data.data.aheadTimes ? res.data.data.aheadTimes : [-1],
// mrReserveStatus: res.data.data.mrReserveStatus,
// confirmAttendance: res.data.data.confirmAttendance === null ? -9 : res.data.data.confirmAttendance,
// organizer: res.data.data.organizer,
// 'comListData.meetingWayModelId': res.data.data.meetingWayModel.model === null ? null : (res.data.data.meetingWayModel.model === 'dingtalk' ? 0 : 1),
// repeatable: res.data.data.repeatable,
// recurrenceModel: res.data.data.repeatable ? { model: res.data.data.recurrenceModel.model, daysOfMonth: res.data.data.recurrenceModel.daysOfMonth, interval: 1, initialTime: res.data.data.recurrenceModel.initialTime, terminateTime: res.data.data.recurrenceModel.terminateTime, weekDayList: res.data.data.recurrenceModel.weekDayList } : { model: 'no_repeat' },
// title: res.data.data.title,
// remark: res.data.data.remark,
// isExpand: res.data.data.confirmAttendance === 1 ? true : false,
// isShowRemark: res.data.data.remark ? true : false,
// week: this.data.weekList[new Date(res.data.data.startTime.replace(/-/g, "/")).getDay()],
// getData: true,
// scheduleItem: res.data.data,
// meetingWayModelData: res.data.data.meetingWayModel
// })
// if (res.data.data.repeatable) {
// this.setData({
// 'comListData.comSelectListId': res.data.data.recurrenceModel.model === 'weekly' ? (res.data.data.recurrenceModel.weekDayList.length > 1 ? 3 : 2) : repeatListMap.get(res.data.data.recurrenceModel.model),
// })
// }
// // this.$store.data.originalData = res.data.data
// // this.$store.data.originUsers = originUsers
// this.$store.data.locationName = res.data.data.location.locationName
// this.$store.data.roomId = res.data.data.meetingRoomId < 0 ? '' : res.data.data.meetingRoomId
// this.$store.data.startTime = res.data.data.startTime.replace(/-/g, "/")
// this.$store.data.endTime = res.data.data.endTime.replace(/-/g, "/")
// this.$store.data.participatorList = participatorList
// this.$store.data.participatorUserId = participatorUserId
// this.$store.data.originUsersId = originUsersId
// this.update()
// this.conflictPeople()
// this.store.data.scheduleId = res.data.data.id;
// this.store.data.groupId = res.data.data.groupId;
// this.update();
// this.loadAffairList();
// this.resetRepeatList()
// // if (res.data.data.meetingWayModel.model === 'zoom' && res.data.data.meetingWayModel.data === null) {
// // setTimeout(() => {
// // getScheduleDetail(data).then(success => {
// // this.setData({
// // meetingWayModelData: res.data.data.meetingWayModel
// // })
// // })
// // }, 30000)
// // }
// }
// })
},
// 添加描述
addRemark
()
{
...
...
@@ -1451,6 +1494,7 @@ create.Page({
this
.
store
.
data
.
isNeedReloadList
=
false
;
this
.
update
();
},
//获取单次会议动态列表
getAffairList
(
id
)
{
...
...
pages/meetingDetail/utils.js
0 → 100644
View file @
0391326d
export
function
getSelectRepeatId
(
recurrenceModel
,
repeatList
)
{
for
(
let
i
=
0
;
i
<
repeatList
.
length
;
i
++
)
{
if
(
repeatList
[
i
].
recurrenceModel
.
model
===
recurrenceModel
.
model
)
{
}
}
return
0
}
\ No newline at end of file
pages/participantsDetail/participantsDetail.axml
View file @
0391326d
<view class="participantsDetail">
<view class="peopleContaint">
<view class="peopleList" a:for="{{!!scheduleItem ? contactPeople : $data.
p
articipatorList}}" a:for-item="item">
<view class="peopleList" a:for="{{!!scheduleItem ? contactPeople : $data.
showP
articipatorList}}" a:for-item="item">
<view class="headImg">
<image a:if="{{!!item.headUrl}}" mode="scaleToFill" src="{{item.headUrl}}"/>
<text a:else>{{item.username.substring(0, 1)}}</text>
...
...
@@ -12,7 +12,7 @@
</view>
</view>
</view>
<view class="addParticipants" catchTap="
showPopup
">
<view class="addParticipants" catchTap="
addParticipator
">
<text class="iconfont iconicon_add "></text>
<text>添加参会人</text>
</view>
...
...
pages/participantsDetail/participantsDetail.js
View file @
0391326d
import
create
from
'dd-store'
import
pageStore
from
'./store'
;
import
{
checkFullScren
}
from
"../../utils/checkFullScren"
;
import
{
selectPeople
,
selectedelRequired
}
from
"../../utils/utils"
;
import
{
modifySchedule
,
addSchedule
,
getUserScheduleInTime
,
getHomeUserSchedule
}
from
'../../api/request.js'
// 传给组件 hList 水平排列 所有数据 comHListData
const
comHListData
=
{
contactData
:
[
{
id
:
'dd'
,
text
:
'钉钉联系人'
,
imageUrl
:
'../../assests/dingContact.png'
},
{
id
:
'outlook'
,
text
:
'手动添加邮箱'
,
imageUrl
:
'../../assests/emailContact.png'
}
]
}
// 传给组件 comPopup 的数据
const
comPopupData
=
{
popupTitle
:
'添加参会人'
,
popupShow
:
false
}
create
.
Page
({
store
:
pageStore
,
useAll
:
true
,
data
:
{
$data
:
null
,
scheduleItem
:
''
,
conflictPeople
:
[],
// 登陆当前账户的人 权限
currentPeople
:
''
,
comHListData
:
comHListData
,
comPopupData
:
comPopupData
,
isIPX
:
false
},
onLoad
(
event
)
{
this
.
reset
()
//
this.reset()
if
(
event
.
scheduleItem
)
{
event
.
scheduleItem
=
decodeURIComponent
(
event
.
scheduleItem
)
let
scheduleItem
=
JSON
.
parse
(
event
.
scheduleItem
)
...
...
@@ -52,265 +38,92 @@ create.Page({
isIPX
:
checkFullScren
(),
currentPeople
:
getApp
().
globalData
.
userid
})
},
onShow
()
{
this
.
getParticipatorLength
()
this
.
conflictPeople
()
},
// 添加参会人 钉钉选人
addParticipator
()
{
const
_that
=
this
let
require
=
[]
let
select
=
[]
let
outLookConcat
=
[]
for
(
let
participator
of
_that
.
$store
.
data
.
participatorList
)
{
if
(
participator
.
platform
===
'outlook'
)
{
outLookConcat
.
push
(
participator
)
}
}
// 创建的 可选 必选
if
(
!
_that
.
data
.
scheduleItem
)
{
select
=
_that
.
$store
.
data
.
participatorUserId
if
(
!
this
.
data
.
scheduleItem
)
{
require
=
[
getApp
().
globalData
.
userid
]
select
=
selectedelRequired
(
Object
.
keys
(
this
.
$store
.
data
.
participatorList
),
require
)
}
// 编辑 发起人的可选必选
else
if
(
this
.
$store
.
data
.
originalData
.
organizer
===
getApp
().
globalData
.
userid
)
{
select
=
_that
.
store
.
data
.
contactPeopleId
select
=
this
.
store
.
data
.
contactPeopleId
require
=
[
getApp
().
globalData
.
userid
]
}
// 编辑 参会人可选必选
else
{
select
=
_that
.
store
.
data
.
contactPeopleId
select
=
this
.
store
.
data
.
contactPeopleId
require
=
[...
this
.
$store
.
data
.
originUsersId
]
}
select
=
_that
.
selectedelRequired
([...
require
],
[...
select
]).
pickedUsers
dd
.
complexChoose
({
title
:
"选择参会人"
,
//标题
multiple
:
true
,
//是否多选
pickedUsers
:
select
,
//已选用户
requiredUsers
:
require
,
//必选用户(不可取消选中状态)
responseUserOnly
:
true
,
//返回人,或者返回人和部门
success
:
function
(
res
)
{
let
people
=
[]
let
peopleId
=
[]
if
(
!
_that
.
data
.
scheduleItem
||
_that
.
$store
.
data
.
originalData
.
organizer
===
getApp
().
globalData
.
userid
)
{
people
.
push
({
userId
:
getApp
().
globalData
.
userid
,
username
:
getApp
().
globalData
.
name
,
headUrl
:
getApp
().
globalData
.
avatar
,
platform
:
'dingtalk'
})
res
.
users
.
forEach
((
item
,
index
)
=>
{
people
.
push
({
userId
:
item
.
userId
,
username
:
item
.
name
,
headUrl
:
item
.
avatar
,
platform
:
'dingtalk'
})
})
}
else
{
_that
.
$store
.
data
.
originUsers
.
forEach
((
item
,
index
)
=>
{
people
.
push
(
item
)
})
res
.
users
.
forEach
((
item
,
index
)
=>
{
people
.
push
({
userId
:
item
.
userId
,
username
:
item
.
name
,
headUrl
:
item
.
avatar
,
platform
:
'dingtalk'
})
})
selectPeople
(
select
,
require
).
then
(
res
=>
{
const
participatorList
=
{}
if
(
!
this
.
data
.
scheduleItem
)
{
participatorList
[
getApp
().
globalData
.
userid
]
=
{
userId
:
getApp
().
globalData
.
userid
,
username
:
getApp
().
globalData
.
name
,
headUrl
:
getApp
().
globalData
.
avatar
,
platform
:
'dingtalk'
}
people
=
_that
.
setArrary
(
people
.
concat
(
outLookConcat
))
for
(
let
value
of
people
)
{
peopleId
.
push
(
value
.
userId
)
for
(
let
i
=
0
;
i
<
res
.
users
.
length
;
i
++
)
{
participatorList
[
res
.
users
[
i
].
userId
]
=
{
userId
:
res
.
users
[
i
].
userId
,
username
:
res
.
users
[
i
].
name
,
headUrl
:
res
.
users
[
i
].
avatar
,
platform
:
'dingtalk'
}
}
people
=
_that
.
setArrary
(
people
.
concat
(
outLookConcat
))
// 创建
if
(
!
_that
.
data
.
scheduleItem
)
{
_that
.
$store
.
data
.
participatorList
=
people
_that
.
$store
.
data
.
participatorUserId
=
peopleId
_that
.
update
()
}
else
{
_that
.
store
.
data
.
contactPeople
=
people
_that
.
store
.
data
.
contactPeopleId
=
peopleId
_that
.
update
()
}
},
fail
:
function
(
err
)
{
this
.
$store
.
data
.
participatorList
=
participatorList
this
.
$store
.
data
.
showParticipatorList
=
Object
.
values
(
participatorList
)
this
.
update
()
}
})
},
// 删除参会人
delParticipants
(
event
)
{
let
userId
=
event
.
target
.
dataset
.
userId
let
userIdList
=
[]
let
userList
=
[]
if
(
!!
this
.
data
.
scheduleItem
)
{
userList
=
this
.
store
.
data
.
contactPeople
userIdList
=
this
.
store
.
data
.
contactPeopleId
}
else
{
userList
=
this
.
$store
.
data
.
participatorList
userIdList
=
this
.
$store
.
data
.
participatorUserId
const
participatorList
=
{
...
this
.
$store
.
data
.
participatorList
}
const
showParticipatorList
=
[...
this
.
$store
.
data
.
showParticipatorList
]
delete
participatorList
[
userId
]
for
(
let
i
=
0
;
i
<
showParticipatorList
.
length
;
i
++
)
{
if
(
showParticipatorList
[
i
].
userId
===
userId
)
{
showParticipatorList
.
splice
(
i
,
1
)
}
userList
.
forEach
((
item
,
index
)
=>
{
if
(
userId
===
item
.
userId
)
{
let
people
=
[...
userList
]
people
.
splice
(
index
,
1
)
if
(
!!
this
.
data
.
scheduleItem
)
{
this
.
store
.
data
.
contactPeople
=
people
}
else
{
this
.
$store
.
data
.
participatorList
=
people
}
this
.
$store
.
data
.
participatorList
=
participatorList
this
.
$store
.
data
.
showParticipatorList
=
showParticipatorList
this
.
update
()
return
}
})
userIdList
.
forEach
((
item
,
index
)
=>
{
if
(
userId
===
item
)
{
let
peopleId
=
[...
userIdList
]
peopleId
.
splice
(
index
,
1
)
if
(
!!
this
.
data
.
scheduleItem
)
{
this
.
store
.
data
.
contactPeopleId
=
peopleId
}
else
{
this
.
$store
.
data
.
participatorUserId
=
peopleId
}
this
.
update
()
return
}
})
this
.
getParticipatorLength
()
this
.
conflictPeople
()
},
// 编辑时候的保存
editSave
()
{
if
(
JSON
.
stringify
(
this
.
$store
.
data
.
originUsers
)
!=
JSON
.
stringify
(
this
.
store
.
data
.
contactPeople
))
{
this
.
$store
.
data
.
updateInfo
.
isUpate
=
true
this
.
$store
.
data
.
updateInfo
.
updateType
=
'operate_user'
this
.
$store
.
data
.
participatorList
=
this
.
store
.
data
.
contactPeople
this
.
$store
.
data
.
participatorUserId
=
this
.
store
.
data
.
contactPeopleId
this
.
update
()
}
dd
.
navigateBack
({
delta
:
1
})
},
// // 编辑时候的保存
// editSave() {
// if (JSON.stringify(this.$store.data.originUsers) != JSON.stringify(this.store.data.contactPeople)) {
// this.$store.data.updateInfo.isUpate = true
// this.$store.data.updateInfo.updateType = 'operate_user'
// this.$store.data.participatorList = this.store.data.contactPeople
// this.$store.data.participatorUserId = this.store.data.contactPeopleId
// this.update()
// }
// dd.navigateBack({
// delta: 1
// })
// },
// 保存信息
saveInfo
()
{
this
.
editSave
()
},
//
//
保存信息
//
saveInfo() {
//
this.editSave()
//
},
// 获取参会人长度
getParticipatorLength
()
{
const
length
=
!!
this
.
data
.
scheduleItem
?
this
.
store
.
data
.
contactPeople
.
length
:
this
.
$store
.
data
.
p
articipatorList
.
length
const
length
=
this
.
$store
.
data
.
showP
articipatorList
.
length
dd
.
setNavigationBar
({
title
:
`参会人(
${
length
}
人)`
})
},
// 重置参会人
reset
()
{
this
.
store
.
data
.
contactPeople
=
[]
this
.
store
.
data
.
contactPeopleId
=
[]
this
.
update
()
},
// 展示弹窗
showPopup
()
{
this
.
setData
({
'comPopupData.popupShow'
:
true
})
},
// 隐藏弹窗
closePopup
()
{
this
.
setData
({
'comPopupData.popupShow'
:
false
})
},
// 选择添加人员的方式
selectComHList
(
event
)
{
switch
(
event
.
currentTarget
.
dataset
.
item
.
id
)
{
// 选择dd加人
case
"dd"
:
this
.
setData
({
'comPopupData.popupShow'
:
false
})
this
.
addParticipator
()
break
;
// 选择通过outlook添加邮箱联系人
case
"outlook"
:
this
.
setData
({
'comPopupData.popupShow'
:
false
})
dd
.
navigateTo
({
url
:
`./../outLookContact/outLookContact?scheduleItem=
${
encodeURIComponent
(
JSON
.
stringify
(
this
.
data
.
scheduleItem
))}
&toPage=participantsDetail`
})
break
;
}
},
// 选择弹窗
onSelectPopup
(
event
)
{
this
.
setData
({
'conSelectPopupData.showSelectPopup'
:
false
,
'conSelectPopupData.selectPopupId'
:
event
.
currentTarget
.
dataset
.
item
.
id
,
'centerPopup.showCenterPopup'
:
true
})
},
// 数组去重
setArrary
(
arr
,
userId
)
{
console
.
log
(
arr
)
let
containt
=
{}
for
(
let
x
of
arr
)
{
containt
[
'id'
+
x
.
userId
]
=
x
}
return
Object
.
values
(
containt
)
},
// 会议冲突
conflictPeople
()
{
let
users
=
[]
let
userIds
=
[]
if
(
!!
this
.
data
.
scheduleItem
)
{
users
=
this
.
store
.
data
.
contactPeople
}
else
{
users
=
this
.
$store
.
data
.
participatorList
}
for
(
let
item
of
users
)
{
userIds
.
push
(
item
.
userId
)
}
// reset() {
// this.store.data.contactPeople = []
// this.store.data.contactPeopleId = []
// this.update()
// },
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
)
{
if
(
!!
this
.
data
.
scheduleItem
)
{
const
arr
=
res
.
data
.
data
[
value
].
filter
(
function
(
item
)
{
return
item
.
confirmAttendance
===
1
})
if
(
arr
.
length
>
1
)
{
conflictPeople
.
push
(
value
)
}
}
else
{
const
arr
=
res
.
data
.
data
[
value
].
filter
(
function
(
item
)
{
return
item
.
confirmAttendance
===
1
})
if
(
arr
.
length
>
0
)
{
conflictPeople
.
push
(
value
)
}
}
}
this
.
setData
({
conflictPeople
:
conflictPeople
})
})
},
// 已选用户去中去掉必选用户
selectedelRequired
([...
req
],
[...
pic
])
{
for
(
let
i
=
0
;
i
<
req
.
length
;
i
++
)
{
for
(
let
m
=
0
;
m
<
pic
.
length
;
m
++
)
{
if
(
req
[
i
]
==
pic
[
m
])
{
pic
.
splice
(
m
,
1
)
m
--
;
}
}
}
return
{
requiredUsers
:
req
,
pickedUsers
:
pic
}
}
});
stores/exampleStore.js
View file @
0391326d
...
...
@@ -2,8 +2,8 @@
class
Store
{
data
=
{
locationName
:
''
,
participatorList
:
[]
,
participatorUserId
:
[],
// 参会人的userId
participatorList
:
{}
,
showParticipatorList
:
[],
roomId
:
''
,
startTime
:
''
,
endTime
:
''
,
...
...
@@ -22,21 +22,20 @@ class Store {
}
resetData
()
{
this
.
data
.
roomId
=
''
this
.
data
.
participatorList
=
[]
this
.
data
.
participatorUserId
=
[]
this
.
data
.
originUsers
=
[]
this
.
data
.
originUsersId
=
[]
this
.
data
.
participatorList
=
{}
this
.
data
.
showParticipatorList
=
[]
//
this.data.originUsers = []
//
this.data.originUsersId = []
this
.
data
.
locationName
=
''
this
.
data
.
onceMeetingContent
=
null
this
.
update
();
}
resetEditData
()
{
this
.
data
.
roomId
=
''
this
.
data
.
participatorList
=
[]
this
.
data
.
originUsers
=
[]
this
.
data
.
originUsersId
=
[]
this
.
data
.
participatorList
=
[]
this
.
data
.
participatorUserId
=
[]
// this.data.originUsers = []
// this.data.originUsersId = []
this
.
data
.
participatorList
=
{}
this
.
data
.
showParticipatorList
=
[]
this
.
data
.
locationName
=
''
this
.
data
.
updateInfo
=
{
updateType
:
''
,
...
...
utils/utils.js
View file @
0391326d
import
globalStore
from
"../stores/exampleStore"
import
{
resolve
}
from
"path"
;
//防止多次重复点击 (函数节流)
export
function
throttle
(
fn
,
gapTime
)
{
if
(
gapTime
==
null
||
gapTime
==
undefined
)
{
...
...
@@ -172,6 +174,7 @@ endTime 结束时间
*/
export
function
getShowTime
(
startTime
,
endTime
)
{
debugger
const
weekList
=
[
'周日'
,
'周一'
,
'周二'
,
'周三'
,
'周四'
,
'周五'
,
'周六'
]
const
weekIndex
=
new
Date
(
startTime
).
getDay
()
let
isAcrossDay
=
false
...
...
@@ -196,3 +199,102 @@ export function getTwoYearToday(startTime) {
let
day
=
date
.
getDate
()
<
10
?
'0'
+
date
.
getDate
()
:
date
.
getDate
()
return
year
+
'-'
+
month
+
'-'
+
day
}
// 处理重复模型
export
function
dealRepeatModal
(
item
)
{
const
repeatWeek
=
[
'SU'
,
'MO'
,
'TU'
,
'WE'
,
'TH'
,
'FR'
,
'SA'
]
// 不重复
if
(
item
.
repeatable
===
0
)
{
return
{
repeatable
:
item
.
repeatable
,
recurrenceModel
:
item
.
recurrenceModel
}
}
const
initialTime
=
globalStore
.
data
.
startTime
.
replace
(
/
\/
/g
,
"-"
).
substring
(
0
,
10
)
const
terminateTime
=
getTwoYearToday
(
globalStore
.
data
.
startTime
)
const
recurrenceModel
=
{
model
:
item
.
recurrenceModel
.
model
,
initialTime
:
initialTime
,
terminateTime
:
terminateTime
,
interval
:
1
}
// 每天重复
if
(
item
.
recurrenceModel
.
model
===
"daily"
)
{
return
{
repeatable
:
item
.
repeatable
,
recurrenceModel
:
recurrenceModel
,
selectRepeatId
:
item
.
id
}
}
// 每月重复
if
(
item
.
recurrenceModel
.
model
===
"absolute_Monthly"
)
{
recurrenceModel
.
daysOfMonth
=
[
new
Date
(
globalStore
.
data
.
startTime
).
getDate
()]
return
{
repeatable
:
item
.
repeatable
,
recurrenceModel
:
recurrenceModel
,
selectRepeatId
:
item
.
id
}
}
// 每周重复
if
(
item
.
recurrenceModel
.
weekDayList
&&
item
.
recurrenceModel
.
weekDayList
.
length
>
4
)
{
recurrenceModel
.
weekDayList
=
item
.
recurrenceModel
.
weekDayList
return
{
repeatable
:
item
.
repeatable
,
recurrenceModel
:
recurrenceModel
,
selectRepeatId
:
item
.
id
}
}
// 每周的一天重复
recurrenceModel
.
weekDayList
=
repeatWeek
[
new
Date
(
globalStore
.
data
.
startTime
).
getDay
()]
return
{
repeatable
:
item
.
repeatable
,
recurrenceModel
:
recurrenceModel
,
selectRepeatId
:
item
.
id
}
}
// 修改时间修改重复模型
export
function
modifyTimeImpactRepeat
(
recurrenceModel
)
{
const
repeatWeek
=
[
'SU'
,
'MO'
,
'TU'
,
'WE'
,
'TH'
,
'FR'
,
'SA'
]
const
initialTime
=
globalStore
.
data
.
startTime
.
replace
(
/
\/
/g
,
"-"
).
substring
(
0
,
10
)
const
terminateTime
=
getTwoYearToday
(
globalStore
.
data
.
startTime
)
recurrenceModel
.
initialTime
=
initialTime
recurrenceModel
.
terminateTime
=
terminateTime
if
(
recurrenceModel
.
model
===
'weekly'
&&
recurrenceModel
.
weekDayList
.
length
===
1
)
{
recurrenceModel
.
weekDayList
=
repeatWeek
[
new
Date
(
globalStore
.
data
.
startTime
).
getDay
()]
}
if
(
recurrenceModel
.
model
===
'absolute_Monthly'
)
{
recurrenceModel
.
daysOfMonth
=
[
new
Date
(
globalStore
.
data
.
startTime
).
getDate
()]
}
return
recurrenceModel
}
// 添加参会人
export
function
selectPeople
(
select
,
require
)
{
const
_that
=
this
return
new
Promise
((
resolve
)
=>
{
dd
.
complexChoose
({
title
:
"选择参会人"
,
//标题
multiple
:
true
,
//是否多选
pickedUsers
:
select
,
//已选用户 s
requiredUsers
:
require
,
//必选用户(不可取消选中状态)
responseUserOnly
:
true
,
//返回人,或者返回人和部门
success
:
function
(
res
)
{
resolve
(
res
)
},
fail
:
function
(
err
)
{
}
})
})
}
// 可选中去掉必选人
export
function
selectedelRequired
(
select
,
require
)
{
return
select
.
filter
(
it
=>
{
return
!
require
.
includes
(
it
.
userId
)
})
}
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