Commit b2dfa931 by xiexiaoqin

feat: 重复会议动态修改

parent 64670f4c
......@@ -138,7 +138,13 @@ export function isParticipate(data) {
url: `/meet/schedule/confirm`
});
}
//会议室详情的获取重复会议动态列表
export function getMeetingRoomRepeatAffairs(groupId, page) {
return $http({
method: "get",
url: `/meet/meeting-log/scheduleTemplateMeetingLogPage?category=2,3&groupId=${groupId}&size=10&current=${page}`
});
}
//会议室详情的获取动态列表
export function getMeetingRoomAffairs(id) {
return $http({
......
......@@ -28,6 +28,7 @@ export default function xFetch({ url, method, data, type }) {
}
},
fail: function (err) {
console.log(err)
alertOnce('网络异常,请重试', rejects);
}
});
......
......@@ -20,6 +20,7 @@ App({
userid: "",
name: "",
userInfo: "",
// globalUrl: "http://192.168.1.101:9999", //beta地址
globalUrl: "https://gateway-beta.mingwork.com", //beta地址
globalUrl2: "https://third-authentication-beta.mingwork.com"
// globalUrl: "https://gateway2.mingwork.com", // 线上地址
......
......@@ -34,6 +34,11 @@
font-size: 34rpx;
}
.iconicon_attender {
position: relative;
top: 4rpx;
}
.participator-title {
color: rgba(25, 31, 37, 1);
font-size: 34rpx;
......
......@@ -2,6 +2,7 @@
.affair-list {
background: #fff;
padding: 48rpx 32rpx 220rpx 32rpx;
/* height: calc(100vh - 200rpx); */
}
.affair-list-margin-top {
......@@ -113,7 +114,9 @@ page {
background: #fff;
z-index: 1;
position: relative;
width: 100%;
padding-bottom: 0;
height: 200rpx;
}
.hideTitle {
......@@ -613,4 +616,14 @@ input {
.lineThrough {
text-decoration: line-through;
}
.loading-more {
color: rgba(234, 12, 40, 1);
font-size: 24rpx;
text-align: center;
width: 400rpx;
border-top: 1px solid rgba(239, 242, 245, 1);
padding-top: 32rpx;
margin: 0 auto 50rpx;
}
\ No newline at end of file
......@@ -202,10 +202,10 @@
<!-- 动态列表 -->
<import src="../../template/avater/index.axml"/>
<import src="../../template/affairBlank/index.axml"/>
<view class="affair-list {{isExpand? '' : 'affair-list-margin-top'}} {{!isExpand&&$data.participatorList.length>1 ? 'addPadding' : ''}}" onTap="hideFileOperate">
<scroll-view class="affair-list {{isExpand? '' : 'affair-list-margin-top'}} {{!isExpand&&$data.participatorList.length>1 ? 'addPadding' : ''}}" onTap="hideFileOperate" scroll-y="{{true}}" lower-threshold="{{400}}" onScrollToLower="onScrollToLower">
<view a:if="{{!isExpand}}" class="affair-list-title">会议动态</view>
<block a:if="{{!affairLoading}}">
<block a:for="{{affairList}}">
<block a:for="{{affairList}}" key="{{item.id}}">
<view a:if="{{item.category == '3' && item.taskViewList && item.taskViewList.length > 0}}" class='compose-column'>
<view class="avater task-avater">
<text class="iconfont iconicon_task1"></text>
......@@ -226,6 +226,7 @@
</view>
<view a:if="{{item.content && ((item.category == 1 || item.taskViewList && item.taskViewList.length > 0) || ( item.fileView && item.fileView.fileInfos && item.fileView.fileInfos.length > 0 ))}}" class='simple-column'>{{item.content}} {{item.createTime}}</view>
</block>
<view class="loading-more" onTap="loadAffairMore" a:if="{{current < pages}}">加载更多动态...</view>
<view class="affair-placeholder" a:if="{{affairList.length == 1 && affairList[0].logType == 'create_schedule'}}">
<template is="affair-placeholder" data="{{title: '添加文件', tip: '我们不开无准备的会,快来上传会议文件吧。'}}"/>
</view>
......@@ -243,7 +244,7 @@
<!-- 任务修改弹出框 -->
<task-panel a:if="{{pop.type === 'updateTask'}}" action='update' onDeleteTask="deleteTask"/>
</popup>
</view>
</scroll-view>
</view>
</block>
<view class="loading" a:if="{{loading || !getData}}">
......
......@@ -2,7 +2,7 @@ import create from 'dd-store';
import { checkFullScren } from "../../utils/checkFullScren";
import pageStore from './store';
import { getMeetingRoomAffairs, createMeetingTask, deleteMeetingTask, updateMeetingTask, uploadPermissions } from '../../api/request';
import { isParticipate, deleteSchedule, getScheduleDetail, getUserScheduleInTime, modifySchedule } from '../../api/request.js'
import { isParticipate, deleteSchedule, getScheduleDetail, getUserScheduleInTime, modifySchedule, getMeetingRoomRepeatAffairs } from '../../api/request.js'
import { throttle, getCreateShowTime } from './../../utils/utils.js'
import { observer } from '/utils/observer.js'
import { resolve } from 'path';
......@@ -10,6 +10,8 @@ create.Page({
store: pageStore,
useAll: true,
data: {
current: 1,
pages: 1,
isIPX: false,
$data: null,
affairLoading: true,
......@@ -115,7 +117,7 @@ create.Page({
this.update()
}, 100)
if (this.store.data.isNeedReloadList) {
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.setData({
'conToastData.showToast': true,
'conToastData.title': '保存成功',
......@@ -261,7 +263,7 @@ create.Page({
this.store.data.scheduleId = res.data.data.id;
this.store.data.groupId = res.data.data.groupId;
this.update();
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.resetRepeatList()
} else {
......@@ -322,6 +324,7 @@ create.Page({
reset() {
this.$store.resetEditData()
this.resetRepeatList()
this.store.data.affairList = [];
this.acrossDay(this.$store.data.startTime, this.$store.data.endTime)
},
// 跳转下一页
......@@ -1280,48 +1283,142 @@ create.Page({
// 页面被关闭
observer.unregister()
},
//获取动态列表
reload(id) {
loadAffairList(current = 1) {
if (this.data.repeatable == 1) {
this.getRepeatAffairList(this.data.scheduleItem.groupId, current)
} else {
this.getAffairList(this.data.scheduleItem.id)
}
//重置
this.store.data.isNeedReloadList = false;
this.update();
},
//获取单次会议动态列表
getAffairList(id) {
getMeetingRoomAffairs(id).then(res => {
const affairList = res.data.data || [];
const newAffairList = affairList.map(it => {
if (it.createTime) {
it.createTime = getCreateShowTime(it.createTime);
}
if (it.category == '2' && it.fileView) {
if (it.fileView.creatorInfo) {
it.fileView.creatorInfo = JSON.parse(it.fileView.creatorInfo);
}
if (it.fileView.fileInfos) {
it.fileView.fileInfos = JSON.parse(it.fileView.fileInfos)
}
return it
}
else if (it.category === '3' && it.taskViewList) {
it.taskViewList.map(o => {
if (o.acceptorInfo) {
o.acceptorInfo = JSON.parse(o.acceptorInfo)
}
if (o.creatorInfo) {
o.creatorInfo = JSON.parse(o.creatorInfo)
}
if (o.taskInfos) {
o.taskInfos = JSON.parse(o.taskInfos)
}
return o
})
return it
}
return it
})
const newAffairList = this.dealAffairData(res.data.data || []);
this.store.data.affairList = newAffairList;
this.update();
this.setData({
affairLoading: false
});
//重置
this.store.data.isNeedReloadList = false;
})
},
//获取重复会议动态列表
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);
}
},
//处理重复会议动态数据
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
};
}
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
}
]
}
this.update();
// 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])
// }
// console.log(newAffairList)
// return newAffairList.sort((a, b) => a.sort - b.sort);
},
//处理会议动态数据
dealAffairData(affairList) {
return affairList.map(it => {
if (it.createTime) {
it.createTime = getCreateShowTime(it.createTime);
}
if (it.category == '2' && it.fileView) {
if (it.fileView.creatorInfo) {
it.fileView.creatorInfo = JSON.parse(it.fileView.creatorInfo);
}
if (it.fileView.fileInfos) {
it.fileView.fileInfos = JSON.parse(it.fileView.fileInfos)
}
return it
}
else if (it.category === '3' && it.taskViewList) {
it.taskViewList.map(o => {
if (o.acceptorInfo) {
o.acceptorInfo = JSON.parse(o.acceptorInfo)
}
if (o.creatorInfo) {
o.creatorInfo = JSON.parse(o.creatorInfo)
}
if (o.taskInfos) {
o.taskInfos = JSON.parse(o.taskInfos)
}
return o
})
return it
}
return it
})
},
showPop(e) {
......@@ -1363,7 +1460,7 @@ create.Page({
//刷新列表,这里为什么不在promie后执行
setTimeout(() => {
if (this.store.data.isNeedReloadList) {
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.setData({
'conToastData.showToast': true,
'conToastData.title': '编辑成功',
......@@ -1433,7 +1530,7 @@ create.Page({
"resourceType": "accessory",
"id": id
}, () => {
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
})
......@@ -1469,6 +1566,21 @@ create.Page({
"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`;
this.store.data[setData] = task.status;
this.store.data[setData2] = task.status;
this.update();
},
//列表修改任务状态
changeTaskStatusOnList(task) {
this.updateTask({
......@@ -1476,7 +1588,11 @@ create.Page({
"taskStatus": task.status,
'id': task.id
}, () => {
this.reload(this.data.scheduleItem.id);
if (this.data.repeatable == 1) {
this.dealRepeatStatus(task);
} else {
this.loadAffairList();
}
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
})
......@@ -1486,6 +1602,12 @@ create.Page({
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();
})
},
//删除任务
......@@ -1494,7 +1616,7 @@ create.Page({
"logType": "task_remove",
}, () => {
this.closePop();
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
})
......@@ -1541,7 +1663,7 @@ create.Page({
}
createMeetingTask(postData).then(res => {
if (res.data.code == 0) {
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.closePop();
this.setData({
'conToastData.showToast': true,
......@@ -1555,14 +1677,7 @@ create.Page({
this.update();
}
})
}),
// throttle
// complete() {
// debugger
// },
//
expand() {
this.setData({
isExpand: false
......
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