Commit df8dcb75 by xiexiaoqin

fix: 修改动态列表的操作

parent ec8c52ed
......@@ -53,4 +53,11 @@ view {
height: 68rpx;
width: 100%;
background: #fff;
}
.desc {
color: rgba(10, 10, 10, 1);
font-size: 28rpx;
line-height: 48rpx;
margin-top: 10rpx;
}
\ No newline at end of file
......@@ -3,6 +3,7 @@
width: 48rpx;
height: 48rpx;
margin-right: 16rpx;
line-height: 48rpx;
}
.notes-edit {
......
<view class="{{fileView.commentId == logId ? 'file-box-mask' : ''}}" data-logId="{{fileView.commentId}}" catchLongTap="showOperate">
<view>
<view class="desc" a:if='{{fileView.remark}}'>
{{fileView.remark}}
</view>
......
import create from 'dd-store';
import pageStore from '../meetingDetail/store';
import { debounce } from '../../utils/utils';
import { debounce, getCreateShowTime } from '../../utils/utils';
import { checkFullScren } from "../../utils/checkFullScren";
import { updateMeetingTask } from '../../api/request';
......@@ -70,11 +70,12 @@ create.Page({
this.update();
// 修改动态列表
for (let i = 0; i < res.data.data.length; i++) {
this.store.data.affairList.unshift(res.data.data[i].commentListDataModelList[i])
if (res.data.data.length) {
const addData = res.data.data[0].commentListDataModelList[0];
addData.updateTime = getCreateShowTime(addData.updateTime);
this.store.data.affairList.unshift(addData)
dd.navigateBack();
}
dd.navigateBack();
}
this.setData({ limitClick: false });
})
......
......@@ -26,7 +26,8 @@
<text>{{dynamicItem.actionLog}}</text>
<text>{{dynamicItem.createTime}}</text>
</view>
<file-list a:if="{{dynamicItem.fileDetailList}}" fileView="{{dynamicItem}}" isCanEdit="{{false}}"/>
<view class="desc" a:if="{{dynamicItem.remark}}">{{dynamicItem.remark}}</view>
<file-list a:if="{{dynamicItem.fileDetailList}}" fileInfos="{{dynamicItem.fileDetailList}}" isCanEdit="{{false}}"/>
<task-list a:if="{{dynamicItem.meetingTaskSimpleViewModel}}" onChangeTaskStatusOnList="onChangeTaskStatusOnList" taskView="{{dynamicItem.meetingTaskSimpleViewModel}}" commentId="{{dynamicItem.commentId}}" meetingId="{{item.meetingId}}" isCanEdit="{{false}}"/>
<notes a:if="{{dynamicItem.notes}}" meetingNotes="{{dynamicItem.notes}}"/>
</view>
......
......@@ -131,14 +131,12 @@ create.Page({
dd.onSocketOpen((res) => {
dd.alert({ content: '连接已打开!' });
setInterval(() => {
dd.sendSocketMessage({
data: 'heartbeat', // 需要发送的内容
success: (res) => {
dd.alert({ content: '数据发送!' + 'heartbeat' });
},
});
}, 1000)
dd.sendSocketMessage({
data: 'heartbeat', // 需要发送的内容
success: (res) => {
dd.alert({ content: '数据发送!' + 'heartbeat' });
},
});
});
......@@ -759,10 +757,10 @@ create.Page({
backToToday(type) {
if (!type) {
//如果当前的日期还没加载出来点击无效
const isFindArr = this.data.scheduleList.filter(
const isFind = this.data.scheduleList.findIndex(
it => it.dateStr == toLocaleDateString(currentDate)
);
if (isFindArr.length == 0) {
if (isFind == -1) {
//去掉头部空数据
if (this.minYear < minYear) {
this.scheduleList.splice(0, this.blankDataLength);
......
<!--<block a:if="{{getData}}"> -->
<import src="../../template/loading/loading.axml"/>
<block>
<view class=" {{(popupShow || show || centerPopup.showCenterPopup || conToastData.showToast || conSelectPopupData.showSelectPopup || comShareData.isShow )? 'metingDetail' : ''}}">
<import src="../../template/deleteBtn/index.axml"/>
......@@ -183,6 +184,9 @@
{{item.creator.name}}
<text>{{item.updateTime}}</text>
</view>
<view a:if="{{item.remark}}" class="desc">
{{item.remark}}
</view>
<task-list a:if="{{item.meetingTaskSimpleViewModel}}" onChangeTaskStatusOnList="changeTaskStatus" taskView="{{item.meetingTaskSimpleViewModel}}" commentId="{{item.commentId}}" isCanEdit="{{false}}"/>
<file-list a:if="{{item.fileDetailList}}" fileInfos="{{item.fileDetailList}}"/>
<notes a:if="{{item.notes}}" meetingNotes="{{item.notes}}"/>
......@@ -203,17 +207,17 @@
</view>
<view class="loading-more" onTap="loadAffairMore" a:if="{{current < pages}}">点击加载更多动态...</view>
</block>
<view a:else></view>
<template is="loading" a:else>
</template>
<popup title="{{popup.title}}" show="{{popup.show}}" mask="true" onClose="closePopup">
<remark a:if="{{popup.type == 'remarkModal'}}" onGetRemark="getRemark"/>
<comment a:if="{{popup.type == 'commentModal'}}" isEdit="{{true}}" onGetComment="getComment"/>
<list a:if="{{popup.type=='repeat'}}" dataComList="{{repeat.repeatList}}" onComSelectList="selectRepeatListItem"></list>
<notes a:if="{{popup.type == 'notesModal'}}" isEdit="{{true}}" onGetNotes="getNotes"/>
<meeting-time-picker a:if="{{'time' === popup.type}}" startTime="{{$data.startTime}}" endTime="{{$data.endTime}}" onComplete="onComplete" isIPX="{{isIPX}}"></meeting-time-picker>
<list a:if="{{popup.type=='aheadTime'}}" onClose="closePopup" multiple="{{true}}" onCompelete="handleAheadTimeSave" complete="{{true}}" dataComList="{{aheadTime.aheadTimeList}}" onComSelectList="selectComList" comSelectList="{{aheadTime.aheadTimesListId}}" iconType="{{aheadTime.iconType}}"></list>
</popup>
<popup a:show="{{popupShow}}" title="{{popupTitle}}" show="{{popupShow}}" mask="true" onClose="closePopup">
<comment a:if="{{comType == 'commentModal'}}" isEdit="{{true}}" onGetComment="getComment"/>
</popup>
<!--<popup a:show="{{popupShow}}" title="{{popupTitle}}" show="{{popupShow}}" mask="true" onClose="closePopup"><comment a:if="{{comType == 'commentModal'}}" isEdit="{{true}}" onGetComment="getComment"/></popup> -->
<!-- 分享的弹窗 -->
<!--<popup a:if="{{comShareData.isShow}}" show="{{comShareData.isShow}}" title="{{comShareData.shareTitle}}" mask="{{true}}" onClose="closeShare"><sharelist dataComList="{{comShareData.shareDataList}}" onSelectComHList="closeShare"></sharelist></popup> -->
<!--<popup show="{{show}}" onClose="closePop" title="{{pop.title}}">
......
......@@ -225,7 +225,7 @@ create.Page({
})
this.$store.data.originalData = res.data.data
this.$store.data.locationName = res.data.data.location.locationName
this.$store.data.locationName = res.data.data.location ? res.data.data.location.locationName : ''
this.$store.data.roomId = res.data.data.meetingRoomId < 0 ? '' : res.data.data.meetingRoomId
this.store.data.scheduleId = res.data.data.groupId
this.$store.data.startTime = res.data.data.startTime.replace(/-/g, "/")
......@@ -235,7 +235,7 @@ create.Page({
this.$store.data.originUsers = [...this.$store.data.showParticipatorList]
this.update()
this.loadAffairList();
this.loadAffairList(res.data.data.groupId);
})
// getScheduleDetail(data).then(res => {
......@@ -1379,7 +1379,7 @@ create.Page({
},
//获取动态列表
loadAffairList(current = 1) {
loadAffairList(id) {
// if (this.data.repeatable == 1) {
// if (!this.data.scheduleItem.groupId) {
// console.log(`groupId不存在`)
......@@ -1396,10 +1396,10 @@ create.Page({
// //重置
// this.store.data.isNeedReloadList = false;
// this.update();
this.getAffairList(this.store.data.scheduleId)
if (!id) {
id = this.store.data.scheduleId;
}
this.getAffairList(id)
},
//获取单次会议动态列表
getAffairList(id) {
......@@ -1810,8 +1810,21 @@ create.Page({
if (res.data.code === 0) {
const [index] = this.getIndexFromAffairList(e.commentId);
if (index !== -1) {
this.store.data.affairList[index].meetingTaskSimpleViewModel.processState = e.status;
this.store.data.affairList[index].updateTime = getCreateShowTime(new Date());
const changeData = this.store.data.affairList[index];
changeData.meetingTaskSimpleViewModel.processState = e.status;
changeData.updateTime = getCreateShowTime(new Date());
this.store.data.affairList.splice(index, 1);
this.store.data.affairList.unshift(changeData);
dd.pageScrollTo({
scrollTop: 0
})
// 停留一会再挪上去
// setTimeout(() => {
// this.store.data.affairList.splice(index, 1);
// this.store.data.affairList.unshift(changeData);
// this.update();
// }, 1000)
}
this.update();
}
......@@ -1831,11 +1844,6 @@ create.Page({
type: 'notesModal'
}
})
// this.setData({
// popupShow: true,
// popupTitle: '创建会议笔记',
// comType: 'notesModal'
// })
},
// 编辑笔记
editNotes(e) {
......@@ -1854,18 +1862,29 @@ create.Page({
getNotes(notes) {
//编辑
if (this.store.data.notes) {
updateMoment({
...this.store.data.notes,
platform: 'dingTalk',
notice: true,
meetingNotes: notes,
meetingId: this.store.data.scheduleId
}).then(res => {
if (res.data.code == 0) {
this.closePopup1();
// clear
this.store.data.notes = null;
this.update();
//是否发送通知
dd.confirm({
title: '通知',
content: '是否更新动态列表通知其他成员?',
confirmButtonText: '更新',
cancelButtonText: '不更新',
success: (res) => {
if (res.confirm) {
this.updateNotes(notes, true, (index) => {
const changeData = this.store.data.affairList[index];
changeData.notes = notes;
changeData.updateTime = getCreateShowTime(new Date());
this.store.data.affairList.splice(index, 1);
this.store.data.affairList.unshift(changeData);
dd.pageScrollTo({
scrollTop: 0
})
})
} else {
this.updateNotes(notes, false, (index) => {
this.store.data.affairList[index].notes = notes;
})
}
}
})
return
......@@ -1881,13 +1900,34 @@ create.Page({
}).then(res => {
if (res.data.code == 0) {
this.getAffairList(this.store.data.scheduleId);
this.closePopup1();
this.closePopup();
}
})
},
//更新笔记
updateNotes(notes, notice, callBack) {
updateMoment({
...this.store.data.notes,
platform: 'dingTalk',
notice: notice,
meetingNotes: notes,
meetingId: this.store.data.scheduleId
}).then(res => {
if (res.data.code == 0) {
this.closePopup();
// 修改列表数据
const [index] = this.getIndexFromAffairList(this.store.data.notes.commentId);
if (index !== -1) {
callBack(index);
}
// clear
this.store.data.notes = null;
this.update();
}
})
},
//添加评论
openComentModal(e) {
console.log(e)
this.store.data.parentCommentId = e.currentTarget.dataset.commentId;
this.update();
this.setData({
......@@ -1895,7 +1935,7 @@ create.Page({
show: true,
title: '添加评论',
mask: true,
type: 'remarkModal'
type: 'commentModal'
}
})
},
......@@ -1912,15 +1952,15 @@ create.Page({
// clear
this.store.data.parentCommentId = '';
this.update();
this.closePopup1();
this.closePopup();
}
})
},
// 删除动态
handleDeleteMoment(e) {
this.deleteComment(e.currentTarget.dataset.commentId)
this.deleteComment('', e.currentTarget.dataset.commentId)
},
// 有parentCommentId删除评论,无则删除动态
// 有commentId删除评论,无则删除动态
deleteComment(commentId, parentCommentId) {
dd.confirm({
title: '删除',
......@@ -1929,16 +1969,19 @@ create.Page({
cancelButtonText: '取消',
success: (res) => {
if (res.confirm) {
deleteMoment(commentId).then(res => {
deleteMoment(commentId || parentCommentId).then(res => {
if (res.data.code === 0) {
if (parentCommentId) {
const [index, childIndex] = this.getIndexFromAffairList(parentCommentId, commentId);
if (childIndex[1] !== -1) {
const [index, childIndex] = this.getIndexFromAffairList(parentCommentId, commentId);
if (commentId) {
if (childIndex !== -1) {
this.store.data.affairList[index].replyCommentList.splice(childIndex, 1);
} else {
this.store.data.affairList[index].splice(index, 1);
}
this.update();
} else {
if (index !== -1) {
this.store.data.affairList.splice(index, 1);
this.update();
}
}
}
})
......@@ -1951,25 +1994,54 @@ create.Page({
this.store.data.remark = e.currentTarget.dataset;
this.update();
this.setData({
popupShow: true,
popupTitle: '添加描述',
comType: 'remarkModal'
popup: {
show: true,
title: '添加描述',
mask: true,
type: 'remarkModal'
}
})
},
getRemark(remark) {
//是否发送通知
dd.confirm({
title: '通知',
content: '是否更新动态列表通知其他成员?',
confirmButtonText: '更新',
cancelButtonText: '不更新',
success: (res) => {
if (res.confirm) {
this.updateRemark(remark, true, (index) => {
const changeData = this.store.data.affairList[index];
changeData.remark = remark;
changeData.updateTime = getCreateShowTime(new Date());
this.store.data.affairList.splice(index, 1);
this.store.data.affairList.unshift(changeData);
dd.pageScrollTo({
scrollTop: 0
})
})
} else {
this.updateRemark(remark, false, (index) => {
this.store.data.affairList[index].remark = remark;
})
}
}
})
},
updateRemark(remark, notice, callBack) {
const commentId = this.store.data.remark.commentId;
updateMoment({
commentId,
remark,
platform: 'dingTalk',
notice: true,
notice: notice,
}).then(res => {
if (res.data.code == 0) {
this.closePopup1();
this.closePopup();
const [index] = this.getIndexFromAffairList(commentId);
if (index !== -1) {
this.store.data.affairList[index].remark = remark;
this.store.data.affairList[index].updateTime = getCreateShowTime(new Date());
callBack(index);
}
// clear
this.store.data.remark = null;
......
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