store.js
2.41 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import { getCreateShowTime, dealRepeatModal } from '../../utils/utils';
import { updateMeetingTask } from '../../api/request';
import { fixSeperateIndex } from './meetingDetail';
class Store {
data = {
affairList: [],
separateIndex: -1,
currentTask: {}, // 任务 endTime, excutor, title, excutorId
notes: null, //{meetingNotes: '', commentId: ''}
parentCommentId: '', // 评论的动态Id
remark: null, //{remark: '', commentId: ''}
files: [],
tasks: [],
fileInfos: null,
description: '',
oldFileInfos: '',
oldDescription: '',
scheduleId: '',
groupId: '',
isNeedReloadList: false,
isNeedReloadIndexList: false,
logId: '',
relatedAppPlatform: null,
modifyDynamicId: ''
}
changeStatus(meetingId, taskModifyModel, callBack) {
const data = {
meetingId: meetingId,
platform: 'dingTalk',
taskModifyModel
};
// 修改详情列表
const index = this.data.affairList.findIndex(it => it.commentId === taskModifyModel.commentId);
if (index !== -1) {
const changeData = this.data.affairList[index];
changeData.meetingTaskSimpleViewModel.processState = taskModifyModel.processState;
changeData.updateTime = getCreateShowTime(new Date());
this.data.affairList.splice(index, 1);
this.data.affairList.unshift(changeData);
if (index > this.data.separateIndex && this.data.separateIndex !== -1) {
this.data.separateIndex += 1;
this.data.separateIndex = fixSeperateIndex(this.data.separateIndex, this.data.affairList)
}
this.update();
// 页面定位到最上面
if (callBack) {
callBack()
}
}
// 修改任务列表页面
const tasksIndex = this.data.tasks.findIndex(it => it.commentId === taskModifyModel.commentId);
if (tasksIndex !== -1) {
this.data.tasks[tasksIndex].processState = taskModifyModel.processState;
this.data.tasks[tasksIndex].updateTime = getCreateShowTime(new Date());
}
updateMeetingTask(data).then(res => {
if (res.data.code !== 0) {
dd.alert('操作失败,请重试')
}
});
}
}
export default new Store()