Commit df8dcb75 by xiexiaoqin

fix: 修改动态列表的操作

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