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
41
42
43
44
45
46
47
48
49
50
51
52
53
export function getSelectRepeatId(recurrenceModel, repeatList) {
let id = 0;
for (let i = 0; i < repeatList.length; i++) {
if (repeatList[i].recurrenceModel.model === recurrenceModel.model) {
if (recurrenceModel.model === "weekly") {
if (recurrenceModel.weekDayList.length === repeatList[i].recurrenceModel.weekDayList.length) {
id = repeatList[i].id;
}
} else {
id = repeatList[i].id;
}
}
}
return id;
}
export function getInitialPsarticipants(participants) {
let people = {}
for (let i = 0; i < participants.length; i++) {
// if (i < 11 && participants[i].participator && participants[i].participator.headUrl) {
// console.log(participants[i].participator.headUrl)
// // console.log(new Image)
// // let img = new Image()
// // img.onload = function () {
// // // console.log(participants[i].participator.headUrl)
// // img.src = participants[i].participator.headUrl
// // };
// }
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
}
}
// 保存成功以后 修改地点