Commit 25148236 by xiexiaoqin

feat: 添加描述修改, 动态更新

parent f070a93d
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<view>{{item.creator.name}}: {{item.remark}}</view> <view>{{item.creator.name}}: {{item.remark}}</view>
<view>{{item.updateTime}}</view> <view>{{item.updateTime}}</view>
</view> </view>
<view class="delete-btn" onTap="deleteComment" data-commentId="{{item.commentId}}"> <view class="delete-btn" onTap="deleteComment" data-commentId="{{item.commentId}}" data-parentCommentId="{{parentCommentId}}">
删除 删除
</view> </view>
</view> </view>
......
...@@ -14,7 +14,7 @@ Component({ ...@@ -14,7 +14,7 @@ Component({
this.props.onGetComment(e.detail.value.textarea) this.props.onGetComment(e.detail.value.textarea)
}, },
deleteComment: function (e) { deleteComment: function (e) {
this.props.onDeleteComment(e.currentTarget.dataset.commentId) this.props.onDeleteComment(e.currentTarget.dataset.commentId, e.currentTarget.dataset.parentCommentId)
} }
}, },
}); });
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="desc" a:if='{{fileView.remark}}'> <view class="desc" a:if='{{fileView.remark}}'>
{{fileView.remark}} {{fileView.remark}}
</view> </view>
<view class="file-list" a:for="{{ fileView.fileInfos}}"> <view class="file-list" a:for="{{ fileView.fileDetailList}}">
<view class="file-box {{isCanDelete ? 'file-box-close': ''}}" catchTap="preview" data-file="{{item}}"> <view class="file-box {{isCanDelete ? 'file-box-close': ''}}" catchTap="preview" data-file="{{item}}">
<view class="file-icon {{item.mimeType}}"></view> <view class="file-icon {{item.mimeType}}"></view>
<view class="file-title"> <view class="file-title">
......
.notes {
border: 1rpx solid rgba(10, 10, 10, 0.14);
border-radius: 16rpx;
padding: 16rpx;
margin-top: 16rpx;
}
.notes-edit {
min-height: 400rpx;
padding: 32rpx;
margin-bottom: 16rpx;
}
\ No newline at end of file
<view>
<form onSubmit="complete">
<textarea value="{{remark ? remark.remark : ''}}" class="notes-edit" name="textarea" auto-height placeholder="输入描述内容"></textarea>
<button form-type="submit" class="picker-complete">完成</button>
</form>
</view>
\ No newline at end of file
import create from 'dd-store';
import pageStore from '../../pages/meetingDetail/store';
create.Component({
store: pageStore,
mixins: [],
data: {
remark: null //store
},
props: {},
didMount() { },
didUpdate() { },
didUnmount() { },
methods: {
complete: function (e) {
const value = e.detail.value.textarea;
if (!value) {
return dd.showToast({ content: '请输入描述内容' })
}
this.props.onGetRemark(e.detail.value.textarea)
},
},
});
{
"component": true
}
\ No newline at end of file
...@@ -12,6 +12,6 @@ ...@@ -12,6 +12,6 @@
<view>{{taskView.title}}</view> <view>{{taskView.title}}</view>
<view a:if="{{taskView.endTime}}" class="task-time">{{taskView.endTime}} 截止</view> <view a:if="{{taskView.endTime}}" class="task-time">{{taskView.endTime}} 截止</view>
</view> </view>
<template is="avater" a:if="{{taskView.executor}}" data="{{item: taskView.executor[0], split: 1}}"/> <template is="avater" a:if="{{taskView.executor && taskView.executor.length > 0}}" data="{{item: taskView.executor[0], split: 1}}"/>
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="task-column participator-top task-time" data-excutorId="{{currentTask.endTime}}" onTap="handleOpenTime"> <view class="task-column participator-top task-time" onTap="handleOpenTime">
<text class="iconicon_conflict iconfont icon"></text> <text class="iconicon_conflict iconfont icon"></text>
<text class="participator-title">{{currentTask.endTime ? `${currentTask.endTime} 截止`: '设置截止时间'}}</text> <text class="participator-title">{{currentTask.endTime ? `${currentTask.endTime} 截止`: '设置截止时间'}}</text>
</view> </view>
......
...@@ -54,13 +54,14 @@ create.Page({ ...@@ -54,13 +54,14 @@ create.Page({
return return
} }
this.setData({ limitClick: true }); this.setData({ limitClick: true });
const task = this.store.data.currentTask;
updateMeetingTask({ updateMeetingTask({
meetingId: this.data.meetingId, meetingId: this.data.meetingId,
platform: 'dingTalk', platform: 'dingTalk',
taskCreateModel: { taskCreateModel: {
endTime: this.store.data.currentTask.endTime.replace(/\//g, '-'), endTime: task.endTime ? task.endTime.replace(/\//g, '-') : '',
title: this.store.data.currentTask.title, title: task.title,
innerTaskExecutorList: [this.store.data.currentTask.excutor] innerTaskExecutorList: task.excutorId ? [task.excutor] : null
} }
}).then(res => { }).then(res => {
if (res.data.code == 0) { if (res.data.code == 0) {
...@@ -69,6 +70,38 @@ create.Page({ ...@@ -69,6 +70,38 @@ create.Page({
this.update(); this.update();
// 修改动态列表 // 修改动态列表
this.store.data.affairList.unshift({
"readFlag": 1,
"commentType": "task",
"creator": {
"identify": "xiexiaoqin@mingwork.club",
"name": "xiaoqin xie",
"avatar": "https://lh4.googleusercontent.com/-dTkgbJpeQjc/AAAAAAAAAAI/AAAAAAAAAAA/AMZuuckZAY9cef_56Gw_ZglfiXjMmP8pQw/photo.jpg",
"email": "xiexiaoqin@mingwork.club",
"platform": "google",
"userId": "1296022611180703745",
"orgId": null
},
"fileDetailList": null,
"meetingTaskSimpleViewModel": {
"title": "测试不要当真",
"processState": "undetermined",
"executor": [],
"taskId": "e9ec94ea7b7665551f295188fbf01409",
"createTime": "2020-09-27 16:40:09",
"startTime": null,
"endTime": null
},
"commentCategory": "task_create",
"remark": null,
"notes": null,
"replyCommentList": null,
"actionLog": null,
"commentId": "1c41d0c3ca611a79e82a124e04f31928",
"createTime": "2020-09-27 15:40:09",
"updateTime": "2020-09-27 15:40:09",
"parentId": "-1"
})
dd.navigateBack(); dd.navigateBack();
} }
this.setData({ limitClick: false }); this.setData({ limitClick: false });
......
...@@ -202,13 +202,13 @@ ...@@ -202,13 +202,13 @@
<view class="meeting-title" a:if="{{item.commentType === 'meeting'}}">创建了会议</view> <view class="meeting-title" a:if="{{item.commentType === 'meeting'}}">创建了会议</view>
</view> </view>
<view class="compose-column-operation"> <view class="compose-column-operation">
<text a:if="{{item.fileDetailList}}" onTap="editRemark">描述</text> <text a:if="{{item.fileDetailList}}" onTap="openRemarkModal" data-commentId="{{item.commentId}}" data-remark="{{item.remark}}">描述</text>
<text a:if="{{item.notes}}" onTap="editNotes" data-meetingNotes="{{item.notes}}" data-commentId="{{item.commentId}}">编辑</text> <text a:if="{{item.notes}}" onTap="editNotes" data-meetingNotes="{{item.notes}}" data-commentId="{{item.commentId}}">编辑</text>
<text onTap="handleDeleteMoment" data-commentId="{{item.commentId}}">删除</text>
<text data-commentId="{{item.commentId}}" onTap="openComentModal">评论</text> <text data-commentId="{{item.commentId}}" onTap="openComentModal">评论</text>
<text onTap="handleDeleteMoment" data-commentId="{{item.commentId}}">删除</text>
</view> </view>
<view class="compose-column"> <view class="compose-column">
<comment a:if="{{item.replyCommentList}}" replyCommentList="{{item.replyCommentList}}" onDeleteComment="deleteComment"/> <comment a:if="{{item.replyCommentList}}" replyCommentList="{{item.replyCommentList}}" onDeleteComment="deleteComment" parentCommentId="{{item.commentId}}"/>
</view> </view>
</block> </block>
<view class="affair-placeholder" a:if="{{!affairList || affairList.length == 0}}"> <view class="affair-placeholder" a:if="{{!affairList || affairList.length == 0}}">
...@@ -224,6 +224,7 @@ ...@@ -224,6 +224,7 @@
<list a:if="{{comType == 'meetingWayModel'}}" dataComList="{{relatedAppPlatform.includes('zoom') ? comListData.meetingWayList: [comListData.meetingWayList[0]] }}" onComSelectList="selectComList" comSelectListId="{{comListData.meetingWayModelId}}" iconType="{{comListData.iconType}}"></list> <list a:if="{{comType == 'meetingWayModel'}}" dataComList="{{relatedAppPlatform.includes('zoom') ? comListData.meetingWayList: [comListData.meetingWayList[0]] }}" onComSelectList="selectComList" comSelectListId="{{comListData.meetingWayModelId}}" iconType="{{comListData.iconType}}"></list>
<notes a:if="{{comType == 'notesModal'}}" isEdit="{{true}}" onGetNotes="getNotes"/> <notes a:if="{{comType == 'notesModal'}}" isEdit="{{true}}" onGetNotes="getNotes"/>
<comment a:if="{{comType == 'commentModal'}}" isEdit="{{true}}" onGetComment="getComment"/> <comment a:if="{{comType == 'commentModal'}}" isEdit="{{true}}" onGetComment="getComment"/>
<remark a:if="{{comType == 'remarkModal'}}" onGetRemark="getRemark"/>
</popup> </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> -->
......
...@@ -1877,12 +1877,7 @@ create.Page({ ...@@ -1877,12 +1877,7 @@ create.Page({
}, },
// 编辑笔记 // 编辑笔记
editNotes(e) { editNotes(e) {
this.store.data.notes = { this.store.data.notes = e.currentTarget.dataset;
meetingNotes: e.currentTarget.dataset.meetingNotes,
commentId: e.currentTarget.dataset.commentId,
notice: true,
meetingId: this.store.data.scheduleId
}
this.update(); this.update();
this.setData({ this.setData({
popupShow: true, popupShow: true,
...@@ -1896,7 +1891,9 @@ create.Page({ ...@@ -1896,7 +1891,9 @@ create.Page({
updateMoment({ updateMoment({
...this.store.data.notes, ...this.store.data.notes,
platform: 'dingTalk', platform: 'dingTalk',
meetingNotes: notes notice: true,
meetingNotes: notes,
meetingId: this.store.data.scheduleId
}).then(res => { }).then(res => {
if (res.data.code == 0) { if (res.data.code == 0) {
this.closePopup(); this.closePopup();
...@@ -1910,20 +1907,22 @@ create.Page({ ...@@ -1910,20 +1907,22 @@ create.Page({
//创建 //创建
updateMeetingTask({ updateMeetingTask({
platform: 'dingTalk', platform: 'dingTalk',
notice: true,
meetingId: this.store.data.scheduleId, meetingId: this.store.data.scheduleId,
notesModel: { notesModel: {
meetingNotes: notes meetingNotes: notes
} }
}).then(res => { }).then(res => {
if (res.data.code == 0) { if (res.data.code == 0) {
this.getAffairList(this.store.data.scheduleId);
this.closePopup(); this.closePopup();
} }
}) })
}, },
//添加评论 //添加评论
openComentModal(e) { openComentModal(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({
popupShow: true, popupShow: true,
popupTitle: '添加评论', popupTitle: '添加评论',
...@@ -1939,6 +1938,10 @@ create.Page({ ...@@ -1939,6 +1938,10 @@ create.Page({
meetingId: this.store.data.scheduleId, meetingId: this.store.data.scheduleId,
}).then(res => { }).then(res => {
if (res.data.code == 0) { if (res.data.code == 0) {
this.getAffairList(this.store.data.scheduleId);
// clear
this.store.data.parentCommentId = '';
this.update();
this.closePopup(); this.closePopup();
} }
}) })
...@@ -1947,8 +1950,8 @@ create.Page({ ...@@ -1947,8 +1950,8 @@ create.Page({
handleDeleteMoment(e) { handleDeleteMoment(e) {
this.deleteComment(e.currentTarget.dataset.commentId) this.deleteComment(e.currentTarget.dataset.commentId)
}, },
// 删除评论,删除动态 // 有parentCommentId删除评论,无则删除动态
deleteComment(commnetId) { deleteComment(commentId, parentCommentId) {
dd.confirm({ dd.confirm({
title: '删除', title: '删除',
content: '确认要删除吗?', content: '确认要删除吗?',
...@@ -1956,14 +1959,63 @@ create.Page({ ...@@ -1956,14 +1959,63 @@ create.Page({
cancelButtonText: '取消', cancelButtonText: '取消',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
deleteMoment(commnetId).then(res => { deleteMoment(commentId).then(res => {
if (res.code === 0) { if (res.data.code === 0) {
if (parentCommentId) {
const [index, childIndex] = this.getIndexFromAffairList(parentCommentId, commentId);
if (childIndex[1] !== -1) {
this.store.data.affairList[index].replyCommentList.splice(childIndex, 1);
} else {
this.store.data.affairList[index].splice(index, 1);
}
this.update();
}
} }
}) })
} }
} }
}) })
},
//修改描述
openRemarkModal(e) {
this.store.data.remark = e.currentTarget.dataset;
this.update();
this.setData({
popupShow: true,
popupTitle: '添加描述',
comType: 'remarkModal'
})
},
getRemark(remark) {
const commentId = this.store.data.remark.commentId;
updateMoment({
commentId,
remark,
platform: 'dingTalk',
notice: true,
}).then(res => {
if (res.data.code == 0) {
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());
}
// clear
this.store.data.remark = null;
this.update();
}
})
},
getIndexFromAffairList(parentCommentId, commentId) {
const index = this.store.data.affairList.findIndex(it => it.commentId === parentCommentId);
let childIndex = -1;
if (index !== -1) {
if (commentId) {
childIndex = this.store.data.affairList[index].replyCommentList.findIndex(it => it.commentId === commentId)
}
}
return [index, childIndex];
} }
}); });
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"task-list": "../../components/taskList/taskList", "task-list": "../../components/taskList/taskList",
"notes": "../../components/notes/notes", "notes": "../../components/notes/notes",
"comment": "../../components/comment/comment", "comment": "../../components/comment/comment",
"remark": "../../components/remark/remark",
"file-list": "../../components/fileList/fileList", "file-list": "../../components/fileList/fileList",
"task-panel": "../../components/taskPanel/taskPanel", "task-panel": "../../components/taskPanel/taskPanel",
"list": "../../components/list/list", "list": "../../components/list/list",
......
class Store { class Store {
data = { data = {
affairList: [], affairList: [],
currentTask: { currentTask: {}, // 任务 endTime, excutor, title, excutorId
endTime: '', notes: null, //{meetingNotes: '', commentId: ''}
excutor: null, parentCommentId: '', // 评论的动态Id
title: '', remark: null, //{remark: '', commentId: ''}
excutorId: ''
},
notes: null,
parentCommentId: '',
fileInfos: null, fileInfos: null,
description: '', description: '',
oldFileInfos: '', oldFileInfos: '',
......
...@@ -104,8 +104,11 @@ export function getInterTime(time) { ...@@ -104,8 +104,11 @@ export function getInterTime(time) {
// 判断是刚刚 60分钟以内 23小时以内 正常时间年月日 // 判断是刚刚 60分钟以内 23小时以内 正常时间年月日
export function getCreateShowTime(createdTime) { export function getCreateShowTime(createdTime) {
let creatTime = createdTime;
if (typeof createdTime === 'string') {
creatTime = createdTime.replace(/\-/g, "/")
}
let timeResule = '' let timeResule = ''
const creatTime = createdTime.replace(/\-/g, "/")
const year = new Date().getFullYear() const year = new Date().getFullYear()
const month = new Date().getMonth() + 1 const month = new Date().getMonth() + 1
const day = new Date().getDate() const day = new Date().getDate()
......
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