Commit b2dfa931 by xiexiaoqin

feat: 重复会议动态修改

parent 64670f4c
...@@ -138,7 +138,13 @@ export function isParticipate(data) { ...@@ -138,7 +138,13 @@ export function isParticipate(data) {
url: `/meet/schedule/confirm` 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) { export function getMeetingRoomAffairs(id) {
return $http({ return $http({
......
...@@ -28,6 +28,7 @@ export default function xFetch({ url, method, data, type }) { ...@@ -28,6 +28,7 @@ export default function xFetch({ url, method, data, type }) {
} }
}, },
fail: function (err) { fail: function (err) {
console.log(err)
alertOnce('网络异常,请重试', rejects); alertOnce('网络异常,请重试', rejects);
} }
}); });
......
...@@ -20,6 +20,7 @@ App({ ...@@ -20,6 +20,7 @@ App({
userid: "", userid: "",
name: "", name: "",
userInfo: "", userInfo: "",
// globalUrl: "http://192.168.1.101:9999", //beta地址
globalUrl: "https://gateway-beta.mingwork.com", //beta地址 globalUrl: "https://gateway-beta.mingwork.com", //beta地址
globalUrl2: "https://third-authentication-beta.mingwork.com" globalUrl2: "https://third-authentication-beta.mingwork.com"
// globalUrl: "https://gateway2.mingwork.com", // 线上地址 // globalUrl: "https://gateway2.mingwork.com", // 线上地址
......
...@@ -34,6 +34,11 @@ ...@@ -34,6 +34,11 @@
font-size: 34rpx; font-size: 34rpx;
} }
.iconicon_attender {
position: relative;
top: 4rpx;
}
.participator-title { .participator-title {
color: rgba(25, 31, 37, 1); color: rgba(25, 31, 37, 1);
font-size: 34rpx; font-size: 34rpx;
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
.affair-list { .affair-list {
background: #fff; background: #fff;
padding: 48rpx 32rpx 220rpx 32rpx; padding: 48rpx 32rpx 220rpx 32rpx;
/* height: calc(100vh - 200rpx); */
} }
.affair-list-margin-top { .affair-list-margin-top {
...@@ -113,7 +114,9 @@ page { ...@@ -113,7 +114,9 @@ page {
background: #fff; background: #fff;
z-index: 1; z-index: 1;
position: relative; position: relative;
width: 100%;
padding-bottom: 0; padding-bottom: 0;
height: 200rpx;
} }
.hideTitle { .hideTitle {
...@@ -614,3 +617,13 @@ input { ...@@ -614,3 +617,13 @@ input {
.lineThrough { .lineThrough {
text-decoration: line-through; 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 @@ ...@@ -202,10 +202,10 @@
<!-- 动态列表 --> <!-- 动态列表 -->
<import src="../../template/avater/index.axml"/> <import src="../../template/avater/index.axml"/>
<import src="../../template/affairBlank/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> <view a:if="{{!isExpand}}" class="affair-list-title">会议动态</view>
<block a:if="{{!affairLoading}}"> <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 a:if="{{item.category == '3' && item.taskViewList && item.taskViewList.length > 0}}" class='compose-column'>
<view class="avater task-avater"> <view class="avater task-avater">
<text class="iconfont iconicon_task1"></text> <text class="iconfont iconicon_task1"></text>
...@@ -226,6 +226,7 @@ ...@@ -226,6 +226,7 @@
</view> </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> <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> </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'}}"> <view class="affair-placeholder" a:if="{{affairList.length == 1 && affairList[0].logType == 'create_schedule'}}">
<template is="affair-placeholder" data="{{title: '添加文件', tip: '我们不开无准备的会,快来上传会议文件吧。'}}"/> <template is="affair-placeholder" data="{{title: '添加文件', tip: '我们不开无准备的会,快来上传会议文件吧。'}}"/>
</view> </view>
...@@ -243,7 +244,7 @@ ...@@ -243,7 +244,7 @@
<!-- 任务修改弹出框 --> <!-- 任务修改弹出框 -->
<task-panel a:if="{{pop.type === 'updateTask'}}" action='update' onDeleteTask="deleteTask"/> <task-panel a:if="{{pop.type === 'updateTask'}}" action='update' onDeleteTask="deleteTask"/>
</popup> </popup>
</view> </scroll-view>
</view> </view>
</block> </block>
<view class="loading" a:if="{{loading || !getData}}"> <view class="loading" a:if="{{loading || !getData}}">
......
...@@ -2,7 +2,7 @@ import create from 'dd-store'; ...@@ -2,7 +2,7 @@ import create from 'dd-store';
import { checkFullScren } from "../../utils/checkFullScren"; import { checkFullScren } from "../../utils/checkFullScren";
import pageStore from './store'; import pageStore from './store';
import { getMeetingRoomAffairs, createMeetingTask, deleteMeetingTask, updateMeetingTask, uploadPermissions } from '../../api/request'; 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 { throttle, getCreateShowTime } from './../../utils/utils.js'
import { observer } from '/utils/observer.js' import { observer } from '/utils/observer.js'
import { resolve } from 'path'; import { resolve } from 'path';
...@@ -10,6 +10,8 @@ create.Page({ ...@@ -10,6 +10,8 @@ create.Page({
store: pageStore, store: pageStore,
useAll: true, useAll: true,
data: { data: {
current: 1,
pages: 1,
isIPX: false, isIPX: false,
$data: null, $data: null,
affairLoading: true, affairLoading: true,
...@@ -115,7 +117,7 @@ create.Page({ ...@@ -115,7 +117,7 @@ create.Page({
this.update() this.update()
}, 100) }, 100)
if (this.store.data.isNeedReloadList) { if (this.store.data.isNeedReloadList) {
this.reload(this.data.scheduleItem.id); this.loadAffairList();
this.setData({ this.setData({
'conToastData.showToast': true, 'conToastData.showToast': true,
'conToastData.title': '保存成功', 'conToastData.title': '保存成功',
...@@ -261,7 +263,7 @@ create.Page({ ...@@ -261,7 +263,7 @@ create.Page({
this.store.data.scheduleId = res.data.data.id; this.store.data.scheduleId = res.data.data.id;
this.store.data.groupId = res.data.data.groupId; this.store.data.groupId = res.data.data.groupId;
this.update(); this.update();
this.reload(this.data.scheduleItem.id); this.loadAffairList();
this.resetRepeatList() this.resetRepeatList()
} else { } else {
...@@ -322,6 +324,7 @@ create.Page({ ...@@ -322,6 +324,7 @@ create.Page({
reset() { reset() {
this.$store.resetEditData() this.$store.resetEditData()
this.resetRepeatList() this.resetRepeatList()
this.store.data.affairList = [];
this.acrossDay(this.$store.data.startTime, this.$store.data.endTime) this.acrossDay(this.$store.data.startTime, this.$store.data.endTime)
}, },
// 跳转下一页 // 跳转下一页
...@@ -1280,11 +1283,114 @@ create.Page({ ...@@ -1280,11 +1283,114 @@ create.Page({
// 页面被关闭 // 页面被关闭
observer.unregister() 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 => { getMeetingRoomAffairs(id).then(res => {
const affairList = res.data.data || []; const newAffairList = this.dealAffairData(res.data.data || []);
const newAffairList = affairList.map(it => { this.store.data.affairList = newAffairList;
this.update();
this.setData({
affairLoading: 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
}
]
}
// 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) { if (it.createTime) {
it.createTime = getCreateShowTime(it.createTime); it.createTime = getCreateShowTime(it.createTime);
} }
...@@ -1314,15 +1420,6 @@ create.Page({ ...@@ -1314,15 +1420,6 @@ create.Page({
} }
return it return it
}) })
this.store.data.affairList = newAffairList;
this.setData({
affairLoading: false
});
//重置
this.store.data.isNeedReloadList = false;
this.update();
})
}, },
showPop(e) { showPop(e) {
this.setData({ this.setData({
...@@ -1363,7 +1460,7 @@ create.Page({ ...@@ -1363,7 +1460,7 @@ create.Page({
//刷新列表,这里为什么不在promie后执行 //刷新列表,这里为什么不在promie后执行
setTimeout(() => { setTimeout(() => {
if (this.store.data.isNeedReloadList) { if (this.store.data.isNeedReloadList) {
this.reload(this.data.scheduleItem.id); this.loadAffairList();
this.setData({ this.setData({
'conToastData.showToast': true, 'conToastData.showToast': true,
'conToastData.title': '编辑成功', 'conToastData.title': '编辑成功',
...@@ -1433,7 +1530,7 @@ create.Page({ ...@@ -1433,7 +1530,7 @@ create.Page({
"resourceType": "accessory", "resourceType": "accessory",
"id": id "id": id
}, () => { }, () => {
this.reload(this.data.scheduleItem.id); this.loadAffairList();
this.$store.data.isIndexAffairListNeedUpdate = true; this.$store.data.isIndexAffairListNeedUpdate = true;
this.update(); this.update();
}) })
...@@ -1469,6 +1566,21 @@ create.Page({ ...@@ -1469,6 +1566,21 @@ create.Page({
"taskInfos": JSON.stringify(this.store.data.currentTask.taskInfos) "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) { changeTaskStatusOnList(task) {
this.updateTask({ this.updateTask({
...@@ -1476,7 +1588,11 @@ create.Page({ ...@@ -1476,7 +1588,11 @@ create.Page({
"taskStatus": task.status, "taskStatus": task.status,
'id': task.id '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.$store.data.isIndexAffairListNeedUpdate = true;
this.update(); this.update();
}) })
...@@ -1486,6 +1602,12 @@ create.Page({ ...@@ -1486,6 +1602,12 @@ create.Page({
this.updateTask({ this.updateTask({
"logType": "task_status_modify", "logType": "task_status_modify",
"taskStatus": this.store.data.currentTask.taskStatus "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({ ...@@ -1494,7 +1616,7 @@ create.Page({
"logType": "task_remove", "logType": "task_remove",
}, () => { }, () => {
this.closePop(); this.closePop();
this.reload(this.data.scheduleItem.id); this.loadAffairList();
this.$store.data.isIndexAffairListNeedUpdate = true; this.$store.data.isIndexAffairListNeedUpdate = true;
this.update(); this.update();
}) })
...@@ -1541,7 +1663,7 @@ create.Page({ ...@@ -1541,7 +1663,7 @@ create.Page({
} }
createMeetingTask(postData).then(res => { createMeetingTask(postData).then(res => {
if (res.data.code == 0) { if (res.data.code == 0) {
this.reload(this.data.scheduleItem.id); this.loadAffairList();
this.closePop(); this.closePop();
this.setData({ this.setData({
'conToastData.showToast': true, 'conToastData.showToast': true,
...@@ -1555,14 +1677,7 @@ create.Page({ ...@@ -1555,14 +1677,7 @@ create.Page({
this.update(); this.update();
} }
}) })
}), }),
// throttle
// complete() {
// debugger
// },
//
expand() { expand() {
this.setData({ this.setData({
isExpand: false 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