Commit 4fc73dc5 by fengzhaoyu

Merge branch 'release/2.0.0' of http://gitlab.roboming.com/fengzhaoyu/schedule into release/2.0.0

parents 0391326d e9f76179
......@@ -12,7 +12,9 @@
"pages/participantsDetail/participantsDetail",
"pages/applicationDetails/applicationDetails",
"pages/attendeeList/attendeeList",
"pages/createTask/createTask"
"pages/createTask/createTask",
"pages/files/files",
"pages/tasks/tasks"
],
"window": {
"allowsBounceVertical": "YES"
......
page {
background: #Fff;
}
.file-container {
padding: 0 32rpx;
}
\ No newline at end of file
<view class="file-container" a:for="{{files}}">
<file-list fileView="{{item}}"/>
</view>
\ No newline at end of file
import create from 'dd-store';
import pageStore from '../../pages/meetingDetail/store';
create.Page({
store: pageStore,
data: {
meetingId: '',
files: null //store
},
onLoad(query) {
this.setData({
meetingId: query.meetingId
})
},
});
{
"defaultTitle": "文件",
"usingComponents": {
"file-list": "../../components/fileList/fileList"
}
}
\ No newline at end of file
......@@ -765,7 +765,6 @@ create.Page({
dd.navigateTo({ url: "./../createMeeting/createMeeting" });
},
nextDetail: throttle(function (e) {
console.log(e.target.dataset)
const { item } = e.target.dataset;
const scheduleItem = { scheduleId: item.meetingId || item.id, scheduleTemplateId: item.scheduleTemplateId, planDate: item.planDate }
dd.navigateTo({
......
......@@ -107,6 +107,8 @@
</view>
</view>
</view>
<view onTap="goTasksPage">{{tasks.length}} 个任务</view>
<view onTap="goFilesPage">{{files.length}} 个附件</view>
<!-- 删除该会议 -->
<template is="deleteBtn" onhandleDelete="" data="{{title: '删除该会议' }}"/>
</view>
......
......@@ -1477,28 +1477,31 @@ create.Page({
//获取动态列表
loadAffairList(current = 1) {
if (this.data.repeatable == 1) {
if (!this.data.scheduleItem.groupId) {
console.log(`groupId不存在`)
return
}
this.getRepeatAffairList(this.data.scheduleItem.groupId, current)
} else {
if (!this.data.scheduleItem.id) {
console.log(`scheduleItem.id不存在`)
return
}
// if (this.data.repeatable == 1) {
// if (!this.data.scheduleItem.groupId) {
// console.log(`groupId不存在`)
// return
// }
// this.getRepeatAffairList(this.data.scheduleItem.groupId, current)
// } else {
// if (!this.data.scheduleItem.id) {
// console.log(`scheduleItem.id不存在`)
// return
// }
// this.getAffairList(this.data.scheduleItem.id)
// }
// //重置
// this.store.data.isNeedReloadList = false;
// this.update();
this.getAffairList(this.data.scheduleItem.id)
}
//重置
this.store.data.isNeedReloadList = false;
this.update();
},
//获取单次会议动态列表
getAffairList(id) {
getMeetingRoomAffairs(id).then(res => {
this.getTaskAndFiles(res.data.data);
const newAffairList = this.dealAffairData(res.data.data || []);
this.store.data.affairList = newAffairList;
this.update();
......@@ -1508,87 +1511,103 @@ create.Page({
})
},
//获取重复会议动态列表
getRepeatAffairList(groupId, current) {
getMeetingRoomRepeatAffairs(groupId, current).then(res => {
const newAffairList = this.dealRepeatAffairs(res.data.data.records || []);
//第一页数据会重新请求需要替换
if (current === 1) {
this.store.data.affairList = newAffairList;
this.update();
} else {
const newDynamicList = this.store.data.affairList.concat(newAffairList);
this.store.data.affairList = newDynamicList;
this.update();
}
this.setData({
affairLoading: false,
current: res.data.data.current,
pages: res.data.data.pages
});
})
},
// getRepeatAffairList(groupId, current) {
// getMeetingRoomRepeatAffairs(groupId, current).then(res => {
// const newAffairList = this.dealRepeatAffairs(res.data.data.records || []);
// //第一页数据会重新请求需要替换
// if (current === 1) {
// this.store.data.affairList = newAffairList;
// this.update();
// } else {
// const newDynamicList = this.store.data.affairList.concat(newAffairList);
// this.store.data.affairList = newDynamicList;
// this.update();
// }
// this.setData({
// affairLoading: false,
// current: res.data.data.current,
// pages: res.data.data.pages
// });
// })
// },
//加载之前的会议动态
loadAffairMore() {
if (this.data.current < this.data.pages) {
this.loadAffairList(this.data.current + 1);
}
},
// loadAffairMore() {
// if (this.data.current < this.data.pages) {
// this.loadAffairList(this.data.current + 1);
// }
// },
//处理重复会议动态数据
dealRepeatAffairs(affairList, type) {
// const newAffairData = {};
// const newAffairList = [];
// affairList.forEach(it => {
// if (it.meetingLogResource) {
// newAffairData[it.resourceId] = []
// dealRepeatAffairs(affairList, type) {
// // const newAffairData = {};
// // const newAffairList = [];
// // affairList.forEach(it => {
// // if (it.meetingLogResource) {
// // newAffairData[it.resourceId] = []
// // }
// // })
// return affairList.map(item => {
// let itemData = item.meetingLogResource;
// if (itemData) {
// if (item.createTime) {
// item.sort1 = item.createTime
// item.sort = new Date(item.createTime.replace(/-/g, '/')).getTime();
// item.createTime = getCreateShowTime(item.createTime);
// }
// if (itemData.acceptorInfo) {
// itemData.acceptorInfo = JSON.parse(itemData.acceptorInfo);
// }
// if (itemData.creatorInfo) {
// itemData.creatorInfo = JSON.parse(itemData.creatorInfo);
// }
// if (itemData.fileInfos) {
// item.fileView = {
// fileInfos: JSON.parse(itemData.fileInfos),
// creatorInfo: itemData.creatorInfo,
// id: itemData.id,
// description: itemData.description
// };
// }
// if (itemData.taskInfos) {
// item.taskViewList = [
// {
// acceptorInfo: itemData.acceptorInfo,
// acceptorId: itemData.acceptorId,
// creatorInfo: itemData.creatorInfo,
// creatorId: itemData.creatorId,
// taskInfos: JSON.parse(itemData.taskInfos),
// taskStatus: itemData.taskStatus,
// id: itemData.id
// }
// ]
// }
// })
return affairList.map(item => {
let itemData = item.meetingLogResource;
if (itemData) {
if (item.createTime) {
item.sort1 = item.createTime
item.sort = new Date(item.createTime.replace(/-/g, '/')).getTime();
item.createTime = getCreateShowTime(item.createTime);
}
if (itemData.acceptorInfo) {
itemData.acceptorInfo = JSON.parse(itemData.acceptorInfo);
}
if (itemData.creatorInfo) {
itemData.creatorInfo = JSON.parse(itemData.creatorInfo);
}
if (itemData.fileInfos) {
item.fileView = {
fileInfos: JSON.parse(itemData.fileInfos),
creatorInfo: itemData.creatorInfo,
id: itemData.id,
description: itemData.description
};
}
if (itemData.taskInfos) {
item.taskViewList = [
{
acceptorInfo: itemData.acceptorInfo,
acceptorId: itemData.acceptorId,
creatorInfo: itemData.creatorInfo,
creatorId: itemData.creatorId,
taskInfos: JSON.parse(itemData.taskInfos),
taskStatus: itemData.taskStatus,
id: itemData.id
}
]
}
// newAffairData[item.resourceId].push(item);
}
return item
});
// console.log(newAffairData);
// for (let i in newAffairData) {
// newAffairData[i].sort((a, b) => a.sort - b.sort);
// newAffairList.push(newAffairData[i][0])
// // newAffairData[item.resourceId].push(item);
// }
// console.log(newAffairList)
// return newAffairList.sort((a, b) => a.sort - b.sort);
// return item
// });
// // console.log(newAffairData);
// // for (let i in newAffairData) {
// // newAffairData[i].sort((a, b) => a.sort - b.sort);
// // newAffairList.push(newAffairData[i][0])
// // }
// // console.log(newAffairList)
// // return newAffairList.sort((a, b) => a.sort - b.sort);
// },
// 获取所有的任务和文件
getTaskAndFiles(affairList) {
const files = [];
const tasks = [];
affairList.forEach(it => {
if (it.commentType === 'task') {
tasks.push(it)
} else if (it.commentType === 'file') {
files.push(it)
}
})
this.store.data.files = files;
this.store.data.tasks = tasks;
this.update();
},
//处理会议动态数据
dealAffairData(affairList) {
......@@ -1611,65 +1630,65 @@ create.Page({
show: true
})
},
closePop() {
this.setData({
show: false
});
// closePop() {
// this.setData({
// show: false
// });
if (this.data.pop.type == 'updateTask') {
const { currentTask } = this.store.data;
const { oldTask } = this.data;
// if (this.data.pop.type == 'updateTask') {
// const { currentTask } = this.store.data;
// const { oldTask } = this.data;
//添加执行人
if (!oldTask.acceptorId && currentTask.acceptorId) {
this.addTaskExcutor();
}
///删除执行人
else if (oldTask.acceptorId && !currentTask.acceptorId) {
this.deleteTaskExcutor();
}
//修改执行人
else if ((oldTask.acceptorId && currentTask.acceptorId) && (oldTask.acceptorId !== currentTask.acceptorId)) {
this.updateTaskExcutor();
}
//修改任务标题
if (currentTask.taskInfos.taskTitle && currentTask.taskInfos.taskTitle !== oldTask.taskInfos.taskTitle) {
this.editTaskTitle();
}
//修改任务状态
if (currentTask.taskStatus !== oldTask.taskStatus) {
this.changeTaskStatus();
}
// //添加执行人
// if (!oldTask.acceptorId && currentTask.acceptorId) {
// this.addTaskExcutor();
// }
// ///删除执行人
// else if (oldTask.acceptorId && !currentTask.acceptorId) {
// this.deleteTaskExcutor();
// }
// //修改执行人
// else if ((oldTask.acceptorId && currentTask.acceptorId) && (oldTask.acceptorId !== currentTask.acceptorId)) {
// this.updateTaskExcutor();
// }
// //修改任务标题
// if (currentTask.taskInfos.taskTitle && currentTask.taskInfos.taskTitle !== oldTask.taskInfos.taskTitle) {
// this.editTaskTitle();
// }
// //修改任务状态
// if (currentTask.taskStatus !== oldTask.taskStatus) {
// this.changeTaskStatus();
// }
//刷新列表,这里为什么不在promie后执行
setTimeout(() => {
if (this.store.data.isNeedReloadList) {
this.loadAffairList();
this.setData({
'conToastData.showToast': true,
'conToastData.title': '编辑成功',
})
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
}
}, 500)
}
},
// //刷新列表,这里为什么不在promie后执行
// setTimeout(() => {
// if (this.store.data.isNeedReloadList) {
// this.loadAffairList();
// this.setData({
// 'conToastData.showToast': true,
// 'conToastData.title': '编辑成功',
// })
// this.$store.data.isIndexAffairListNeedUpdate = true;
// this.update();
// }
// }, 500)
// }
// },
//出现任务弹窗
showCreateTask(e) {
//重置
this.store.data.currentTask = {};
this.update();
this.showPop(e)
},
// showCreateTask(e) {
// //重置
// this.store.data.currentTask = {};
// this.update();
// this.showPop(e)
// },
//设置修改任务弹框中当前任务
setCurrentTask(currentTask) {
this.setData({
oldTask: JSON.parse(JSON.stringify(currentTask))
})
this.store.data.currentTask = currentTask;
this.update();
},
// setCurrentTask(currentTask) {
// this.setData({
// oldTask: JSON.parse(JSON.stringify(currentTask))
// })
// this.store.data.currentTask = currentTask;
// this.update();
// },
// 上传文件
async handleAddFile() {
......@@ -1701,149 +1720,149 @@ create.Page({
},
//隐藏文件操作浮窗
hideFileOperate() {
this.store.data.logId = '';
this.update();
},
// hideFileOperate() {
// this.store.data.logId = '';
// this.update();
// },
// 删除文件
deleteMeetingFile(id) {
this.updateTask({
"logType": "schedule_accessory_remove",
"resourceType": "accessory",
"id": id
}, () => {
this.loadAffairList();
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
})
},
// deleteMeetingFile(id) {
// this.updateTask({
// "logType": "schedule_accessory_remove",
// "resourceType": "accessory",
// "id": id
// }, () => {
// this.loadAffairList();
// this.$store.data.isIndexAffairListNeedUpdate = true;
// this.update();
// })
// },
// 删除执行人
deleteTaskExcutor() {
this.updateTask({
"logType": "task_remove_acceptor",
acceptorInfo: JSON.stringify(this.data.oldTask.acceptorInfo),
acceptorId: this.data.oldTask.acceptorId
})
},
// deleteTaskExcutor() {
// this.updateTask({
// "logType": "task_remove_acceptor",
// acceptorInfo: JSON.stringify(this.data.oldTask.acceptorInfo),
// acceptorId: this.data.oldTask.acceptorId
// })
// },
// 添加执行人
addTaskExcutor() {
this.updateTask({
"logType": "task_add_acceptor",
acceptorInfo: JSON.stringify(this.store.data.currentTask.acceptorInfo),
acceptorId: this.store.data.currentTask.acceptorId
})
},
// addTaskExcutor() {
// this.updateTask({
// "logType": "task_add_acceptor",
// acceptorInfo: JSON.stringify(this.store.data.currentTask.acceptorInfo),
// acceptorId: this.store.data.currentTask.acceptorId
// })
// },
//修改执行人
updateTaskExcutor() {
this.updateTask({
"logType": "task_modify_acceptor",
acceptorInfo: JSON.stringify(this.store.data.currentTask.acceptorInfo),
acceptorId: this.store.data.currentTask.acceptorId
})
},
// updateTaskExcutor() {
// this.updateTask({
// "logType": "task_modify_acceptor",
// acceptorInfo: JSON.stringify(this.store.data.currentTask.acceptorInfo),
// acceptorId: this.store.data.currentTask.acceptorId
// })
// },
//修改任务标题
editTaskTitle(value) {
this.updateTask({
"logType": "task_modify_title",
"taskInfos": JSON.stringify(this.store.data.currentTask.taskInfos)
})
},
// editTaskTitle(value) {
// this.updateTask({
// "logType": "task_modify_title",
// "taskInfos": JSON.stringify(this.store.data.currentTask.taskInfos)
// })
// },
//重复任务状态处理
dealRepeatStatus(task) {
let dataIndex = "";
this.data.affairList.forEach((item, index) => {
if (item.meetingLogResource.id == task.id) {
dataIndex = index;
}
});
const setData = `affairList[${dataIndex}].taskViewList[0].taskStatus`;
const setData2 = `affairList[${dataIndex}].meetingLogResource.taskStatus`;
// dealRepeatStatus(task) {
// let dataIndex = "";
// this.data.affairList.forEach((item, index) => {
// if (item.meetingLogResource.id == task.id) {
// dataIndex = index;
// }
// });
// const setData = `affairList[${dataIndex}].taskViewList[0].taskStatus`;
// const setData2 = `affairList[${dataIndex}].meetingLogResource.taskStatus`;
this.store.data[setData] = task.status;
this.store.data[setData2] = task.status;
this.update();
},
// this.store.data[setData] = task.status;
// this.store.data[setData2] = task.status;
// this.update();
// },
//弹窗修改任务状态
changeTaskStatus() {
this.updateTask({
"logType": "task_status_modify",
"taskStatus": this.store.data.currentTask.taskStatus
}, () => {
if (this.data.repeatable == 1) {
this.dealRepeatStatus({ status: this.store.data.currentTask.taskStatus, id: this.store.data.currentTask.id });
}
this.store.data.isNeedReloadList = true;
this.update();
})
},
// changeTaskStatus() {
// this.updateTask({
// "logType": "task_status_modify",
// "taskStatus": this.store.data.currentTask.taskStatus
// }, () => {
// if (this.data.repeatable == 1) {
// this.dealRepeatStatus({ status: this.store.data.currentTask.taskStatus, id: this.store.data.currentTask.id });
// }
// this.store.data.isNeedReloadList = true;
// this.update();
// })
// },
//删除任务
deleteTask(id) {
this.updateTask({
"logType": "task_remove",
}, () => {
this.closePop();
this.loadAffairList();
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
})
},
// deleteTask(id) {
// this.updateTask({
// "logType": "task_remove",
// }, () => {
// this.closePop();
// this.loadAffairList();
// this.$store.data.isIndexAffairListNeedUpdate = true;
// this.update();
// })
// },
//修改任务
updateTask(taskData, callBack) {
const postData = {
"groupId": this.data.scheduleItem.groupId,
"scheduleId": this.data.scheduleItem.id,
"resourceType": "task",
"creatorId": getApp().globalData.userid,
"creatorInfo": getApp().globalData.userInfo,
"id": this.store.data.currentTask.id,
...taskData
}
updateMeetingTask(postData).then(res => {
if (res.data.code == 0) {
if (callBack) {
callBack();
} else {
this.store.data.isNeedReloadList = true;
this.update();
}
}
})
},
// updateTask(taskData, callBack) {
// const postData = {
// "groupId": this.data.scheduleItem.groupId,
// "scheduleId": this.data.scheduleItem.id,
// "resourceType": "task",
// "creatorId": getApp().globalData.userid,
// "creatorInfo": getApp().globalData.userInfo,
// "id": this.store.data.currentTask.id,
// ...taskData
// }
// updateMeetingTask(postData).then(res => {
// if (res.data.code == 0) {
// if (callBack) {
// callBack();
// } else {
// this.store.data.isNeedReloadList = true;
// this.update();
// }
// }
// })
// },
//创建任务
complete: throttle(function () {
const { currentTask } = this.store.data;
const postData = {
"groupId": this.data.scheduleItem.groupId,
"scheduleId": this.data.scheduleItem.id,
"resourceType": "task",
"creatorId": getApp().globalData.userid,
"creatorInfo": getApp().globalData.userInfo,
"logType": "task_add",
"taskInfos": JSON.stringify(currentTask.taskInfos),
"taskStatus": '0',
"description": ""
}
if (currentTask.acceptorId) {
postData.acceptorId = currentTask.acceptorId;
postData.acceptorInfo = JSON.stringify(currentTask.acceptorInfo);
}
createMeetingTask(postData).then(res => {
if (res.data.code == 0) {
this.loadAffairList();
this.closePop();
this.setData({
'conToastData.showToast': true,
'conToastData.title': '保存成功',
})
//重置
this.store.data.currentTask = {};
this.update();
// complete: throttle(function () {
// const { currentTask } = this.store.data;
// const postData = {
// "groupId": this.data.scheduleItem.groupId,
// "scheduleId": this.data.scheduleItem.id,
// "resourceType": "task",
// "creatorId": getApp().globalData.userid,
// "creatorInfo": getApp().globalData.userInfo,
// "logType": "task_add",
// "taskInfos": JSON.stringify(currentTask.taskInfos),
// "taskStatus": '0',
// "description": ""
// }
// if (currentTask.acceptorId) {
// postData.acceptorId = currentTask.acceptorId;
// postData.acceptorInfo = JSON.stringify(currentTask.acceptorInfo);
// }
// createMeetingTask(postData).then(res => {
// if (res.data.code == 0) {
// this.loadAffairList();
// this.closePop();
// this.setData({
// 'conToastData.showToast': true,
// 'conToastData.title': '保存成功',
// })
// //重置
// this.store.data.currentTask = {};
// this.update();
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
}
})
}),
// this.$store.data.isIndexAffairListNeedUpdate = true;
// this.update();
// }
// })
// }),
expand() {
this.setData({
isExpand: false
......@@ -2066,6 +2085,12 @@ create.Page({
}
}
return [index, childIndex];
},
goTasksPage() {
dd.navigateTo({ url: '/pages/tasks/tasks?meetingId=' + this.store.data.scheduleId })
},
goFilesPage() {
dd.navigateTo({ url: '/pages/files/files?meetingId=' + this.store.data.scheduleId })
}
});
......@@ -5,6 +5,8 @@ class Store {
notes: null, //{meetingNotes: '', commentId: ''}
parentCommentId: '', // 评论的动态Id
remark: null, //{remark: '', commentId: ''}
files: [],
tasks: [],
fileInfos: null,
description: '',
oldFileInfos: '',
......
page {
background: #Fff;
}
\ No newline at end of file
<block a:for="{{tasks}}">
<task-list onChangeTaskStatusOnList="changeTaskStatus" taskView="{{item.meetingTaskSimpleViewModel}}" commentId="{{item.commentId}}" isCanEdit="{{false}}"/>
</block>
\ No newline at end of file
import create from 'dd-store';
import pageStore from '../../pages/meetingDetail/store';
create.Page({
store: pageStore,
data: {
meetingId: '',
tasks: null //store
},
onLoad(query) {
this.setData({
meetingId: query.meetingId
})
},
});
{
"defaultTitle": "子任务",
"usingComponents": {
"task-list": "../../components/taskList/taskList"
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment