Commit 25148236 by xiexiaoqin

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

parent f070a93d
......@@ -12,7 +12,7 @@
<view>{{item.creator.name}}: {{item.remark}}</view>
<view>{{item.updateTime}}</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>
......
......@@ -14,7 +14,7 @@ Component({
this.props.onGetComment(e.detail.value.textarea)
},
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 @@
<view class="desc" a:if='{{fileView.remark}}'>
{{fileView.remark}}
</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-icon {{item.mimeType}}"></view>
<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 @@
<view>{{taskView.title}}</view>
<view a:if="{{taskView.endTime}}" class="task-time">{{taskView.endTime}} 截止</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>
\ No newline at end of file
......@@ -15,7 +15,7 @@
</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="participator-title">{{currentTask.endTime ? `${currentTask.endTime} 截止`: '设置截止时间'}}</text>
</view>
......
......@@ -54,13 +54,14 @@ create.Page({
return
}
this.setData({ limitClick: true });
const task = this.store.data.currentTask;
updateMeetingTask({
meetingId: this.data.meetingId,
platform: 'dingTalk',
taskCreateModel: {
endTime: this.store.data.currentTask.endTime.replace(/\//g, '-'),
title: this.store.data.currentTask.title,
innerTaskExecutorList: [this.store.data.currentTask.excutor]
endTime: task.endTime ? task.endTime.replace(/\//g, '-') : '',
title: task.title,
innerTaskExecutorList: task.excutorId ? [task.excutor] : null
}
}).then(res => {
if (res.data.code == 0) {
......@@ -69,6 +70,38 @@ create.Page({
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();
}
this.setData({ limitClick: false });
......
......@@ -202,13 +202,13 @@
<view class="meeting-title" a:if="{{item.commentType === 'meeting'}}">创建了会议</view>
</view>
<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 onTap="handleDeleteMoment" data-commentId="{{item.commentId}}">删除</text>
<text data-commentId="{{item.commentId}}" onTap="openComentModal">评论</text>
<text onTap="handleDeleteMoment" data-commentId="{{item.commentId}}">删除</text>
</view>
<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>
</block>
<view class="affair-placeholder" a:if="{{!affairList || affairList.length == 0}}">
......@@ -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>
<notes a:if="{{comType == 'notesModal'}}" isEdit="{{true}}" onGetNotes="getNotes"/>
<comment a:if="{{comType == 'commentModal'}}" isEdit="{{true}}" onGetComment="getComment"/>
<remark a:if="{{comType == 'remarkModal'}}" onGetRemark="getRemark"/>
</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({
},
// 编辑笔记
editNotes(e) {
this.store.data.notes = {
meetingNotes: e.currentTarget.dataset.meetingNotes,
commentId: e.currentTarget.dataset.commentId,
notice: true,
meetingId: this.store.data.scheduleId
}
this.store.data.notes = e.currentTarget.dataset;
this.update();
this.setData({
popupShow: true,
......@@ -1896,7 +1891,9 @@ create.Page({
updateMoment({
...this.store.data.notes,
platform: 'dingTalk',
meetingNotes: notes
notice: true,
meetingNotes: notes,
meetingId: this.store.data.scheduleId
}).then(res => {
if (res.data.code == 0) {
this.closePopup();
......@@ -1910,19 +1907,21 @@ create.Page({
//创建
updateMeetingTask({
platform: 'dingTalk',
notice: true,
meetingId: this.store.data.scheduleId,
notesModel: {
meetingNotes: notes
}
}).then(res => {
if (res.data.code == 0) {
this.getAffairList(this.store.data.scheduleId);
this.closePopup();
}
})
},
//添加评论
openComentModal(e) {
this.store.data.parentCommentId = e.currentTarget.dataset.commentId,
this.store.data.parentCommentId = e.currentTarget.dataset.commentId;
this.update();
this.setData({
popupShow: true,
......@@ -1939,6 +1938,10 @@ create.Page({
meetingId: this.store.data.scheduleId,
}).then(res => {
if (res.data.code == 0) {
this.getAffairList(this.store.data.scheduleId);
// clear
this.store.data.parentCommentId = '';
this.update();
this.closePopup();
}
})
......@@ -1947,8 +1950,8 @@ create.Page({
handleDeleteMoment(e) {
this.deleteComment(e.currentTarget.dataset.commentId)
},
// 删除评论,删除动态
deleteComment(commnetId) {
// 有parentCommentId删除评论,无则删除动态
deleteComment(commentId, parentCommentId) {
dd.confirm({
title: '删除',
content: '确认要删除吗?',
......@@ -1956,14 +1959,63 @@ create.Page({
cancelButtonText: '取消',
success: (res) => {
if (res.confirm) {
deleteMoment(commnetId).then(res => {
if (res.code === 0) {
deleteMoment(commentId).then(res => {
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 @@
"task-list": "../../components/taskList/taskList",
"notes": "../../components/notes/notes",
"comment": "../../components/comment/comment",
"remark": "../../components/remark/remark",
"file-list": "../../components/fileList/fileList",
"task-panel": "../../components/taskPanel/taskPanel",
"list": "../../components/list/list",
......
class Store {
data = {
affairList: [],
currentTask: {
endTime: '',
excutor: null,
title: '',
excutorId: ''
},
notes: null,
parentCommentId: '',
currentTask: {}, // 任务 endTime, excutor, title, excutorId
notes: null, //{meetingNotes: '', commentId: ''}
parentCommentId: '', // 评论的动态Id
remark: null, //{remark: '', commentId: ''}
fileInfos: null,
description: '',
oldFileInfos: '',
......
......@@ -104,8 +104,11 @@ export function getInterTime(time) {
// 判断是刚刚 60分钟以内 23小时以内 正常时间年月日
export function getCreateShowTime(createdTime) {
let creatTime = createdTime;
if (typeof createdTime === 'string') {
creatTime = createdTime.replace(/\-/g, "/")
}
let timeResule = ''
const creatTime = createdTime.replace(/\-/g, "/")
const year = new Date().getFullYear()
const month = new Date().getMonth() + 1
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