1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
export function getSelectRepeatId(recurrenceModel, repeatList) {
for (let i = 0; i < repeatList.length; i++) {
if (repeatList[i].recurrenceModel.model === recurrenceModel.model) {
if (recurrenceModel.model === "weekly" && recurrenceModel.weekDayList.length === repeatList[i].recurrenceModel.weekDayList.length) {
return repeatList[i].id
}
return repeatList[i].id
}
}
return 0
}
export function getInitialPsarticipants(participants) {
let people = {}
for (let i = 0; i < participants.length; i++) {
participants[i].participator.confirmAttendance = participants[i].confirmAttendance
people[participants[i].participator.userId] = participants[i].participator
}
return people
}
// 比较增减的人
export function handleChangePeople(originUsers, nowUsers) {
let originMap = new Map()
let nowMap = new Map()
for (let x of originUsers) {
originMap.set(x.userId, x)
}
for (let x of nowUsers) {
nowMap.set(x.userId, x)
}
const add = nowUsers.filter(it => !originMap.get(it.userId))
const del = originUsers.filter(it => !nowMap.get(it.userId))
return {
add: add,
del: del
}
}
// 保存成功以后 修改地点