Commit 4424e79b by fengzhaoyu

还没有改完

parent 4fc73dc5
......@@ -2,7 +2,7 @@
<view class="desc" a:if='{{fileView.remark}}'>
{{fileView.remark}}
</view>
<view class="file-list" a:for="{{ fileView.fileDetailList}}">
<view class="file-list" a:for="{{fileInfos}}">
<view class="file-box {{isCanDelete ? 'file-box-close': ''}}" catchTap="preview" data-file="{{item}}">
<view class="file-icon {{item.mimeType}}"></view>
<view class="file-title">
......
import create from 'dd-store';
import pageStore from '../../pages/meetingDetail/store';
import { previewPermissions, previewOss } from '../../api/request.js'
import { previewPermissions, previewOss, uploadPermissions } from '../../api/request.js'
import openLink from "dingtalk-jsapi/api/biz/util/openLink";
create.Component({
......@@ -38,14 +38,23 @@ create.Component({
return
}
const file = e.target.dataset.file
console.log(file)
let data = {
ddUserId: getApp().globalData.userid,
type: 'download',
projectName: 'MING_MEETING',
fileIds: file.fileId
}
uploadPermissions(data).then(res => {
dd.previewFileInDingTalk({
corpId: dd.corpId,
spaceId: file.spaceId,
spaceId: res.data.data,
fileId: file.fileId,
fileName: file.name,
fileSize: file.size,
fileType: file.mimeType,
})
})
},
//显示操作框
showOperate(e) {
......
......@@ -142,6 +142,10 @@ create.Page({
})
this.closePopup()
},
// 保存重复
handleSaveRepeat() {
},
// 关闭popup
......@@ -198,7 +202,7 @@ create.Page({
endTime: this.$store.data.endTime.replace(/\//g, "-"),
meetingRoomId: this.$store.data.roomId,
scheduleType: this.$store.data.roomId ? 'meeting' : 'common',
participatorList: !!this.$store.data.participatorList.length ? this.$store.data.participatorList : [{ userId: getApp().globalData.userid, username: getApp().globalData.name, headUrl: getApp().globalData.avatar, platform: 'dingtalk' }],
participatorList: !!this.$store.data.showParticipatorList.length ? this.$store.data.showParticipatorList : [{ userId: getApp().globalData.userid, username: getApp().globalData.name, headUrl: getApp().globalData.avatar, platform: 'dingtalk' }],
repeatable: this.data.repeat.repeatable,
remark: this.data.remark,
recurrenceModel: this.data.repeat.recurrenceModel,
......
......@@ -17,12 +17,12 @@
<view class="permissionContant">
<view class="createTitle">
<view class="title">
<input placeholder-class="placeholder" placeholder="{{placeholder}}" class="text" onInput="onInput" data-type="title" data-selectType="common" value="{{title}}" onConfirm="onConfirm" focus="{{false}}" onBlur="onBlur"/>
<view class="icon iconfont iconicon_description1" a:if="{{!isShowRemark}}" onTap="addRemark">
<input placeholder-class="placeholder" placeholder="{{placeholder}}" class="text" onInput="handleChangeTitle" value="{{title}}" onConfirm="handleTitleSave" focus="{{false}}" onBlur="handleTitleSave"/>
<view class="icon iconfont iconicon_description1" a:if="{{!isShowRemark}}" onTap="handleOpenRemark">
</view>
</view>
<view class="remark" a:if="{{isShowRemark}}">
<input placeholder-class="placeholder" placeholder="请添加描述" class="text" onInput="onInput" data-type="remark" value="{{remark}}" onConfirm="onConfirm" onBlur="onBlur" focus="{{false}}"/>
<input placeholder-class="placeholder" placeholder="请添加描述" onInput="handleChangeRemark" value="{{meetingRemark}}" onConfirm="handleRemarkSave" onBlur="handleRemarkSave" focus="{{false}}"/>
</view>
</view>
<view class="permission" a:if="{{currentPeople != organizer}}">
......@@ -38,13 +38,13 @@
<view class="iconicon_location1 iconfont icon {{$data.locationName ? '' : 'noValueIcon'}}" a:else>
</view>
<view class="placeContaint">
<view class="noPlace" a:if="{{!$data.locationName}}" onTap="nextPage" data-nextPage="location">
<view class="noPlace" a:if="{{!$data.locationName}}" onTap="goSelectPlace">
添加地点
</view>
<view class="hasplace {{mrReserveStatus === 'Y' ? 'lineThrough' : ''}} " onTap="nextPage" data-nextPage="location" a:else>
<view class="hasplace {{mrReserveStatus === 'Y' ? 'lineThrough' : ''}}" onTap="goSelectPlace" a:else>
{{$data.locationName}}
</view>
<view class=" icon iconfont iconicon_close close" a:if="{{!!$data.locationName&&(currentPeople == organizer)}}" data-close="location" catchTap="close">
<view class=" icon iconfont iconicon_close close" a:if="{{!!$data.locationName&&(currentPeople == organizer)}}" catchTap="handleDeletePlace">
</view>
</view>
</view>
......@@ -56,15 +56,14 @@
</view>
<view class="timeContaint">
<view>
<view class="timeText" catchTap="showPopup" data-type='time'>
<view class="timeText" catchTap="handleTime" data-type='time'>
{{showTime}}
<!-- 3月1日 周日 14:00-16:00 -->
</view>
<view class="repeatModal" a:if="{{comListData.comSelectListId !== 0}}" catchTap="showPopup" data-type='repeat'>
{{comListData.repeatList[comListData.comSelectListId].text}}重复
<view class="repeatModal" a:if="{{repeat.repeatable !== 0}}" catchTap="handleRepeatModal">
{{repeat.repeatList[repeat.selectRepeatId].text}}重复
</view>
</view>
<view class="icon iconfont iconicon_repeat1" catchTap="showPopup" data-type='repeat' a:if="{{comListData.comSelectListId == 0}}">
<view class="icon iconfont iconicon_repeat1" catchTap="handleRepeatModal" a:if="{{repeat.repeatable == 0}}">
</view>
</view>
</view>
......@@ -73,26 +72,21 @@
</view>
<!-- participatorList participatorUserId 参会人 -->
<view class="participator">
<view class="iconicon_attender iconfont icon {{$data.participatorList.length>1 ? '' : 'noValueIcon'}}">
<view class="iconicon_attender iconfont icon {{$data.showParticipatorList.length>1 ? '' : 'noValueIcon'}}">
</view>
<view class="participatorContaint">
<view class="participatorText" a:if="{{$data.participatorList.length < 2}}" catchTap="showPopup" data-type='participator'>
<view class="participatorText" a:if="{{$data.showParticipatorList.length < 2}}" catchTap="handleAddParticipator">
添加参会人
</view>
<view class="participatorList" a:else>
<view class="participatorListTop">
<view class="participatorText">
<view>
{{$data.participatorList.length}}位参会人
</view>
<view class="conflictStatus" a:if="{{conflictPeople.length}}">
{{conflictPeople.length}}人日程安排冲突
</view>
{{$data.showParticipatorList.length}}位参会人
</view>
<view class="iconright iconfont icon" style=" vertical-align: middle" catchTap="nextPage" data-nextPage="participantsDetail"></view>
<view class="iconright iconfont icon" style=" vertical-align: middle" catchTap="goParticipantsDetail"></view>
</view>
<view class="participatorListBottom" catchTap="nextPage" data-nextPage="participantsDetail">
<view class="people" a:for="{{$data.participatorList.length > 10 ? [...$data.participatorList].splice(0, 11) : $data.participatorList}}">
<view class="participatorListBottom" catchTap="goParticipantsDetail">
<view class="people" a:for="{{$data.showParticipatorList.length > 10 ? [...$data.showParticipatorList].splice(0, 11) : $data.showParticipatorList}}">
<view class="headUrl">
<image a:if="{{item.headUrl}}" mode="scaleToFill" src="{{item.headUrl}}" />
<text a:else>{{item.platform==="outlook" ? item.username.substring(0, 2) : item.username.substring(item.username.length-2, item.username.length)}}
......@@ -102,13 +96,12 @@
</view>
<!--<view class="name">{{item.name}}</view> -->
</view>
<view class="addPeople iconfont iconicon_add1" catchTap="showPopup" data-type='participator'></view>
<view class="addPeople iconfont iconicon_add1" catchTap="handleAddParticipator" data-type='participator'></view>
</view>
</view>
</view>
</view>
<view onTap="goTasksPage">{{tasks.length}} 个任务</view>
<view onTap="goFilesPage">{{files.length}} 个附件</view>
<!--<view onTap="goTasksPage">{{tasks.length}} 个任务</view><view onTap="goFilesPage">{{files.length}} 个附件</view> -->
<!-- 删除该会议 -->
<template is="deleteBtn" onhandleDelete="" data="{{title: '删除该会议' }}"/>
</view>
......@@ -190,7 +183,7 @@
<text>{{item.updateTime}}</text>
</view>
<task-list a:if="{{item.meetingTaskSimpleViewModel}}" onChangeTaskStatusOnList="changeTaskStatus" taskView="{{item.meetingTaskSimpleViewModel}}" commentId="{{item.commentId}}" isCanEdit="{{false}}"/>
<file-list a:if="{{item.fileDetailList}}" fileView="{{item}}"/>
<file-list a:if="{{item.fileDetailList}}" fileInfos="{{item.fileDetailList}}"/>
<notes a:if="{{item.notes}}" meetingNotes="{{item.notes}}"/>
<view class="meeting-title" a:if="{{item.commentType === 'meeting'}}">创建了会议</view>
</view>
......@@ -210,11 +203,11 @@
<view class="loading-more" onTap="loadAffairMore" a:if="{{current < pages}}">点击加载更多动态...</view>
</block>
<view a:else></view>
<popup title="{{popup.title}}" show="{{popup.show}}" mask="true" onClose="closePopup1">
<list a:if="{{popup.type=='repeat'}}" dataComList="{{repeat.repeatList}}" onComSelectList="selectRepeatListItem"></list>
<meeting-time-picker a:if="{{'time' === popup.type}}" startTime="{{$data.startTime}}" endTime="{{$data.endTime}}" onComplete="onComplete" isIPX="{{isIPX}}"></meeting-time-picker></popup>
<popup a:show="{{popupShow}}" title="{{popupTitle}}" show="{{popupShow}}" mask="true" onClose="closePopup">
<meeting-time-picker a:if="{{'time' === comType}}" onComplete="onComplete" startTime="{{$data.startTime}}" endTime="{{$data.endTime}}" isIPX="{{isIPX}}"></meeting-time-picker>
<hlist a:if="{{'participator' === comType}}" dataComList="{{comHListData.contactData}}" onSelectComHList="selectComHList"></hlist>
<list multiple="{{comListData.multiple}}" onCompelete="selectAheadtimes" comSelectList="{{comListData.aheadTimesListId}}" complete="{{comType=='aheadTime' ? true : false}}" a:if="{{comType=='repeat' || comType=='aheadTime'}}" dataComList="{{comType=='repeat' ? comListData.repeatList : comListData.aheadTimesList}}" onComSelectList="selectComList" comSelectListId="{{comType=='repeat' ? comListData.comSelectListId : comListData.aheadTimesListId}}" 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"/>
<comment a:if="{{comType == 'commentModal'}}" isEdit="{{true}}" onGetComment="getComment"/>
<remark a:if="{{comType == 'remarkModal'}}" onGetRemark="getRemark"/>
......
......@@ -3,13 +3,13 @@ import { checkFullScren } from "../../utils/checkFullScren";
import pageStore from './store';
import { saveFileInfo, getMeetingRoomAffairs, createMeetingTask, deleteMeetingTask, updateMeetingTask, uploadPermissions } from '../../api/request';
import { getOssPermission, getuploadResource, isParticipate, deleteSchedule, getScheduleDetail, getUserScheduleInTime, modifySchedule, getMeetingRoomRepeatAffairs, updateMoment, deleteMoment } from '../../api/request.js'
import { getShowTime, throttle, getCreateShowTime, dealRepeatModal } from './../../utils/utils.js'
import { selectPeople, getShowTime, modifyTimeImpactRepeat, throttle, getCreateShowTime, dealRepeatModal } from './../../utils/utils.js'
import { observer } from '/utils/observer.js'
import { resolve } from 'path';
import { getFileInfo, getFileInfoFromOss } from './uploadFile.js';
import { comShareData } from './const.js';
import { repeatList } from '../createMeeting/constant'
import { getSelectRepeatId } from './utils'
import { getSelectRepeatId, getInitialPsarticipants, handleChangePeople } from './utils'
create.Page({
store: pageStore,
useAll: true,
......@@ -29,17 +29,6 @@ create.Page({
loading: false,
// 传给组件list 的所有数据 comListData
comListData: {
repeatList: [
{ id: 0, text: '不重复', icon: 'iconicon_cycle', repeatable: 0, recurrenceModel: { model: 'no_repeat' } },
{ id: 1, text: '每天', icon: '', repeatable: 1, recurrenceModel: { model: 'daily', interval: 1, initialTime: `2020-03-23`, terminateTime: `2022-03-23`, weekDayList: null } },
{ id: 2, text: '每周', icon: '', repeatable: 1, recurrenceModel: { model: 'weekly', interval: 1, initialTime: `2020-03-23`, terminateTime: `2022-03-23`, weekDayList: ['MO'] } },
{ id: 3, text: '每周的工作日', icon: '', repeatable: 1, recurrenceModel: { model: 'weekly', interval: 1, initialTime: `2020-03-23`, terminateTime: `2022-03-23`, weekDayList: ['MO', 'TU', 'WE', 'TH', 'FR'] } },
{ id: 4, text: '每月', icon: '', repeatable: 1, recurrenceModel: { model: 'absolute_Monthly', daysOfMonth: ['23'], interval: 1, initialTime: `2020-03-23`, terminateTime: `2022-03-23`, weekDayList: null } }
],
meetingWayList: [
{ id: 0, text: '钉钉', imageUrl: '../../assests/dingding.png', meetingWayModel: { model: 'dingtalk' } },
{ id: 1, text: 'Zoom Meeting', imageUrl: '../../assests/Zoom.png', meetingWayModel: { model: 'zoom' } }
],
aheadTimesList: [
{ id: -1, text: '不提醒', icon: 'iconicon_cycle' },
{ id: 0, text: '会议开始时提醒', icon: '' },
......@@ -58,14 +47,6 @@ create.Page({
meetingWayModelId: null,
iconType: 'icon'
},
// 传给组件 hList 水平排列 所有数据 comHListData
comHListData: {
contactData: [
{ id: 0, text: '钉钉联系人', imageUrl: '../../assests/dingContact.png' },
{ id: 1, text: '手动添加邮箱', imageUrl: '../../assests/emailContact.png' }
]
},
// 传递给组件toast的所有数据
conToastData: {
showToast: false,
title: '保存成功'
......@@ -92,14 +73,14 @@ create.Page({
comShareData: comShareData, //来自const.js 只做demo展示,没有实际功能
title: ``,
remark: '',
meetingRemark: '',
isShowRemark: false,
showTime: '',
repeat: {
repeatList: repeatList,
recurrenceModel: { model: 'no_repeat' },
repeatable: 0,
selectRepeatId: ''
selectRepeatId: 0
},
popup: {
show: false,
......@@ -107,9 +88,13 @@ create.Page({
mask: '',
type: ''
},
organizer: '',
currentPeople: '',
scheduleItem: '',
repeatable: 0,
recurrenceModel: { model: 'no_repeat' },
repeatWeek: ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'],
popupTitle: '会议重复',
popupShow: false,
......@@ -119,12 +104,8 @@ create.Page({
weekList: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
week: '',
conflictPeople: [],
isAcrossDay: false,
scheduleItem: '',
lock: false,
aheadTimes: [15],
organizer: '',
currentPeople: '',
editType: '',
confirmAttendance: null,
isExpand: false,
......@@ -133,15 +114,8 @@ create.Page({
id: ''
},
onShow() {
console.log(this.$store.data.originUsers)
console.log(this.$store.data.participatorList)
// this.conflictPeople()
// this.store.data.fileInfos = []
// this.store.data.description = ''
// this.update()
setTimeout(() => {
this.update()
}, 100)
if (this.store.data.isNeedReloadList) {
this.loadAffairList();
this.setData({
......@@ -153,58 +127,11 @@ create.Page({
}
if (this.$store.data.updateInfo.isUpate) {
switch (this.$store.data.updateInfo.updateType) {
case 'operate_user':
if (JSON.stringify(this.$store.data.participatorList) !== JSON.stringify(this.$store.data.originUsers)) {
if (this.data.repeatable === 1) {
this.setData({
'conSelectPopupData.selectType': 'common',
'conSelectPopupData.showSelectPopup': true,
editType: this.$store.data.updateInfo.updateType
})
} else {
this.isChange(this.$store.data.updateInfo.updateType, 'only')
}
} else {
this.reSetUsers()
this.$store.data.updateInfo = {
isUpate: false,
updateType: ''
}
}
break;
case 'modify_location':
if (
(this.$store.data.locationName !== this.$store.data.originalData.locationName)
|| (this.$store.data.roomId !== this.$store.data.originalData.meetingRoomId)
|| (this.$store.data.startTime != this.$store.data.originalData.startTime)
|| (this.$store.data.endTime != this.$store.data.originalData.endTime)
) {
if (this.data.repeatable === 1) {
this.setData({
'conSelectPopupData.selectType': 'common',
'conSelectPopupData.showSelectPopup': true,
editType: this.$store.data.updateInfo.updateType
})
} else {
if (this.$store.data.participatorList.length < 2) {
this.isChange(this.$store.data.updateInfo.updateType, 'only')
} else {
this.setData({
editType: this.$store.data.updateInfo.updateType,
'centerPopup.showCenterPopup': true
})
}
// this.isChange(this.$store.data.updateInfo.updateType, 'only')
}
} else {
this.reSetLocation()
this.$store.data.updateInfo = {
isUpate: false,
updateType: ''
if (this.$store.data.updateInfo.updateType === "modify_location") {
this.handlePlaceSave()
}
}
break;
if (this.$store.data.updateInfo.updateType === 'operate_user') {
this.handleParticipatorSave()
}
}
......@@ -222,6 +149,7 @@ create.Page({
currentPeople: getApp().globalData.userid
})
this.getDetail()
let scheduleItem = this.data.scheduleItem
const _that = this
observer.register({
......@@ -247,25 +175,37 @@ create.Page({
console.log('详情接口scheduleId不存在')
return
}
this.setData({
scheduleItem: {
id: res.data.data.id,
scheduleTemplateId: res.data.data.scheduleTemplateId,
planDate: res.data.data.planDate,
},
title: res.data.data.title,
remark: res.data.data.remark,
isShowRemark: !!res.data.data.remark,
meetingRemark: res.data.data.remark,
isShowRemark: res.data.data.remark ? true : false,
showTime: getShowTime(res.data.data.startTime.replace(/-/g, "/"), res.data.data.endTime.replace(/-/g, "/")),
repeat: {
repeatable: res.data.data.repeatable,
repeatList: repeatList,
recurrenceModel: res.data.data.repeatable ? res.data.data.recurrenceModel : { model: 'no_repeat' },
selectRepeatId: res.data.data.repeatable ? 0 : getSelectRepeatId(res.data.data.recurrenceModel, repeatList)
}
selectRepeatId: res.data.data.repeatable === 0 ? 0 : getSelectRepeatId(res.data.data.recurrenceModel, repeatList)
},
// organizer: res.data.data.organizer,
organizer: getApp().globalData.userid,
})
this.store.dats.scheduleId = res.data.data.uuid
this.$store.data.locationName = 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.uuid
this.$store.data.startTime = res.data.data.startTime.replace(/-/g, "/")
this.$store.data.endTime = res.data.data.endTime.replace(/-/g, "/")
this.$store.data.participatorList = getInitialPsarticipants(res.data.data.userList)
this.$store.data.showParticipatorList = Object.values(this.$store.data.participatorList)
this.$store.data.originUsers = [...Object.values(this.$store.data.participatorList)]
this.update()
this.loadAffairList();
})
// getScheduleDetail(data).then(res => {
......@@ -342,125 +282,277 @@ create.Page({
// }
// })
},
// 添加描述
addRemark() {
// 添加标题
handleChangeTitle(event) {
this.setData({
isShowRemark: true
title: event.detail.value
})
this.update()
},
// 输入框输入事件
onInput(event) {
switch (event.target.dataset.type) {
case 'title':
// 保存标题
handleTitleSave() {
const modifyModel = "only"
let dataTitle = {
title: this.data.title,
modifyModel: modifyModel,
modifyContent: 'title'
}
if (this.data.repeat.repeatable) {
dataTitle.modifyModel = "future"
}
this.modifySchedule(dataTitle)
},
// 打开添加描述
handleOpenRemark() {
this.setData({
title: event.detail.value
isShowRemark: true
})
break
case 'remark':
},
// 添加描述
handleChangeRemark(event) {
this.setData({
remark: event.detail.value
meetingRemark: event.detail.value
})
break
},
// 保存添加描述
handleRemarkSave() {
const modifyModel = "only"
let dataRemark = {
remark: this.data.meetingRemark,
modifyModel: modifyModel,
modifyContent: 'remark'
}
if (this.data.repeat.repeatable) {
dataTitle.modifyModel = "future"
}
this.modifySchedule(dataRemark)
},
// input 点击换行 时
onConfirm(event) {
this.editInput(event)
// 跳转选择地点
goSelectPlace() {
dd.navigateTo({
url: `./../place/place?scheduleItem=${encodeURIComponent(JSON.stringify(this.data.scheduleItem))}`
})
},
// 删除地点
handleDeletePlace() {
this.$store.data.locationName = ''
this.$store.data.roomId = ''
this.update()
this.handlePlaceSave()
},
// input 失去焦点
onBlur(event) {
this.editInput(event)
// 保存地点
handlePlaceSave() {
const modifyModel = "only"
let dataLocation = {
modifyModel: modifyModel,
modifyContent: 'modify_location',
location: {
longitude: '-999',
latitude: '-999',
locationName: this.$store.data.locationName
},
// 编辑Input
editInput(event) {
switch (event.target.dataset.type) {
case 'title':
if (this.data.repeatable) {
this.isChange('title', 'future')
} else {
this.isChange('title', 'only')
meetingRoomId: !!this.$store.data.roomId ? this.$store.data.roomId : -1
}
break
case 'remark':
if (this.data.repeatable) {
this.isChange('remark', 'future')
} else {
this.isChange('remark', 'only')
if (this.data.repeat.repeatable == 0) {
this.modifySchedule(dataLocation).then(res => {
this.$store.data.updateInfo = {
updateType: '',
isUpate: false
}
break
})
}
},
// 初始化
reset() {
this.$store.resetEditData()
this.resetRepeatList()
this.store.data.affairList = [];
this.acrossDay(this.$store.data.startTime, this.$store.data.endTime)
},
// 跳转下一页
nextPage(event) {
const scheduleItem = {
id: this.data.scheduleItem.id,
scheduleTemplateId: this.data.scheduleTemplateId,
planDate: this.data.planDate
}
switch (event.target.dataset.nextPage) {
case 'location':
this.$store.data.updateInfo.updateType = 'modify_location'
this.update()
dd.navigateTo({ url: `./../place/place?scheduleItem=${encodeURIComponent(JSON.stringify(scheduleItem))}&repeatable=${this.data.repeatable}` })
break
case 'participantsDetail':
this.$store.data.updateInfo.updateType = 'operate_user'
this.update()
dd.navigateTo({ url: `./../participantsDetail/participantsDetail?scheduleItem=${encodeURIComponent(JSON.stringify(scheduleItem))}` })
break
// 选择时间 打开popup
handleTime() {
this.setData({
popup: {
show: true,
title: "选择会议时间",
mask: true,
type: 'time'
}
})
},
// 所有的关闭操作
close(event) {
switch (event.target.dataset.close) {
case 'location':
this.$store.data.locationName = ''
this.$store.data.roomId = ''
// 选择时间点击完成
onComplete(event) {
this.$store.data.startTime = `${event.startTime}:00`
this.$store.data.endTime = `${event.endTime}:00`
this.update()
if (this.data.repeatable) {
this.setData({
'conSelectPopupData.selectType': 'common',
'conSelectPopupData.showSelectPopup': true,
editType: 'modify_location'
showTime: getShowTime(this.$store.data.startTime, this.$store.data.endTime)
})
} else {
if (this.$store.data.participatorList.length < 2) {
this.isChange('modify_location', 'only')
} else {
this.closePopup1()
this.handleTimeSave()
/*
改时间 改掉重复规则
先选重复规则 再改时间 重复规则也要改变
暂时修改每周 每月重复问题
*/
if (this.data.repeat.repeatable !== 0) {
let recurrenceModel = modifyTimeImpactRepeat(this.data.repeat.recurrenceModel)
this.setData({
editType: 'modify_location',
'centerPopup.showCenterPopup': true
'repeat.recurrenceModel': recurrenceModel
})
}
},
// 保存时间
handleTimeSave() {
const modifyModel = "only"
let data = {
modifyModel: modifyModel,
startTime: this.$store.data.startTime.replace(/\//g, "-"),
endTime: this.$store.data.endTime.replace(/\//g, "-"),
modifyContent: 'modify_time'
}
if (this.data.repeat.repeatable === 0) {
this.modifySchedule(data)
}
break
case 'meetingWayModel':
},
// 选择重复规则 打开popup
handleRepeatModal() {
this.setData({
'comListData.meetingWayModelId': null,
meetingWayModel: { model: null }
popup: {
show: true,
title: "重复规则",
mask: true,
type: 'repeat'
}
})
if (this.data.repeatable) {
this.isChange('meeting_way', 'future')
} else {
this.isChange('meeting_way', 'only')
},
// 选择重复
selectRepeatListItem(event) {
const item = event.currentTarget.dataset.item
const repeat = dealRepeatModal(item)
this.setData({
'repeat.repeatable': repeat.repeatable,
'repeat.recurrenceModel': repeat.recurrenceModel,
'repeat.selectRepeatId': repeat.selectRepeatId,
})
this.closePopup1()
this.handleRepeatSave()
},
//保存重复
handleRepeatSave() {
},
// 关闭popup
closePopup1() {
this.setData({
popup: {
show: false,
title: "",
mask: true,
type: ''
}
})
},
// 添加参会人
handleAddParticipator: throttle(async function () {
const select = []
const require = Object.keys(this.$store.data.participatorList)
const showParticipatorList = this.$store.data.showParticipatorList
selectPeople(select, require).then(res => {
let participatorList = {}
for (let i = 0; i < this.$store.data.showParticipatorList.length; i++) {
participatorList[showParticipatorList[i].userId] = { userId: showParticipatorList[i].userId, username: showParticipatorList[i].username, headUrl: showParticipatorList[i].headUrl, platform: 'dingtalk' }
}
for (let i = 0; i < res.users.length; i++) {
participatorList[res.users[i].userId] = { userId: res.users[i].userId, username: res.users[i].name, headUrl: res.users[i].avatar, platform: 'dingtalk' }
}
this.$store.data.participatorList = participatorList
this.$store.data.showParticipatorList = Object.values(participatorList)
this.update()
this.handleParticipatorSave()
})
}),
//保存参会人
handleParticipatorSave() {
const modifyModel = "only"
const changePeople = handleChangePeople(this.$store.data.originUsers, this.$store.data.participatorList)
let dataUser = {
addUserList: changePeople.add,
deleteUserList: changePeople.del,
modifyModel: modifyModel,
modifyContent: 'operate_user'
}
if (this.data.repeat.repeatable === 0) {
this.modifySchedule(dataUser).then(res => {
this.$store.data.originUsers = Object.keys(this.$store.data.participatorList)
})
}
},
// 关闭popup 点击mark
closePopup() {
this.setData({
popupShow: false,
// 参会人详情
goParticipantsDetail() {
dd.navigateTo({ url: `./../participantsDetail/participantsDetail?scheduleItem=${this.store.data.scheduleItem}` })
},
// 保存编辑
modifySchedule(data, needNotice = "N") {
let that = this
let obj = {
needNotice: needNotice,
scheduleId: this.data.scheduleItem.id,
templateId: this.data.scheduleItem.scheduleTemplateId,
planDate: this.data.scheduleItem.planDate
}
return new Promise((resolve) => {
modifySchedule(Object.assign(data, obj)).then(res => {
if (res.data.code !== 0) {
dd.alert({
content: '保存失败'
})
return
}
if (this.$store.modifyErpeatMeeting) {
this.$store.modifyErpeatMeeting()
}
// if (data.modifyContent !== 'title') {
// if (this.$store.modifyErpeatMeeting) {
// this.$store.modifyErpeatMeeting()
// }
// }
if (this.data.repeat.repeatable === 1 && !!res.data.data) {
observer.notice(res.data.data)
}
// if (data.modifyContent == 'modify_time' || data.modifyContent == ' modify_location') {
// this.setData({
// mrReserveStatus: res.data.extra
// })
// this.$store.data.originalData.mrReserveStatus = res.data.extra
// this.update()
// }
resolve(res)
})
})
},
// 初始化
reset() {
this.$store.resetEditData()
this.store.data.affairList = [];
},
// 选择循环机制 选择会议方式 选择时间 会前提醒 出现popup弹窗
showPopup(event) {
......@@ -503,27 +595,6 @@ create.Page({
'comListData.multiple': multiple
})
},
resetRepeatList() {
let index = 0
let repeatList = []
for (let value of this.data.comListData.repeatList) {
if (index) {
value.recurrenceModel.initialTime = this.$store.data.startTime.replace(/\//g, "-").substring(0, 10)
value.recurrenceModel.terminateTime = this.getTwoYearToday(this.$store.data.startTime)
if (index === 2) {
value.recurrenceModel.weekDayList = [this.data.repeatWeek[new Date(this.$store.data.startTime).getDay()]]
} else if (index === 4) {
value.recurrenceModel.daysOfMonth = [this.$store.data.startTime.replace(/\//g, "-").substring(8, 10)]
}
}
repeatList.push(value)
index++
}
this.setData({
'comListData.repeatList': repeatList,
week: this.data.weekList[new Date(this.$store.data.startTime).getDay()]
})
},
// 选择完comList后的回调 重复 会议方式
selectComList(event) {
switch (this.data.comType) {
......@@ -572,139 +643,8 @@ create.Page({
break;
}
},
// 选择完水平 HList 的回调
selectComHList(event) {
switch (event.currentTarget.dataset.item.id) {
case 0:
this.addParticipator()
this.setData({
popupShow: false
})
break;
case 1:
this.setData({
popupShow: false
})
const scheduleItem = {
id: this.data.scheduleItem.id,
scheduleTemplateId: this.data.scheduleTemplateId,
planDate: this.data.planDate
}
dd.navigateTo({ url: `./../outLookContact/outLookContact?scheduleItem=${JSON.stringify(scheduleItem)}` })
break;
}
},
// 获取两年后的今天
getTwoYearToday(startTime) {
let date = new Date(startTime)
date.setYear(date.getFullYear() + 2)
let year = date.getFullYear();
let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
return year + '-' + month + '-' + day
},
// 添加参会人
addParticipator() {
const _that = this
let require = []
let select = []
let outLookConcat = []
for (let participator of _that.$store.data.participatorList) {
if (participator.platform === 'outlook') {
outLookConcat.push(participator)
}
}
if (this.data.organizer === getApp().globalData.userid) {
select = this.$store.data.participatorUserId
require = [getApp().globalData.userid]
} else {
select = []
require = [...this.$store.data.originUsersId]
}
select = _that.selectedelRequired(require, select).pickedUsers
dd.complexChoose({
title: "选择参会人", //标题
multiple: true, //是否多选
pickedUsers: select, //已选用户
requiredUsers: require, //必选用户(不可取消选中状态)
responseUserOnly: true, //返回人,或者返回人和部门
success: function (res) {
let participatorList = []
let participatorUserId = []
if (_that.data.organizer === getApp().globalData.userid) {
participatorList.push({ userId: getApp().globalData.userid, username: getApp().globalData.name, headUrl: getApp().globalData.avatar, platform: 'dingtalk' })
participatorUserId.push(getApp().globalData.userid)
res.users.forEach((item, index) => {
participatorList.push({ userId: item.userId, username: item.name, headUrl: item.avatar, platform: 'dingtalk' })
participatorUserId.push(item.userId)
})
} else {
_that.$store.data.originUsers.forEach((item, index) => {
participatorList.push(item)
participatorUserId.push(item.userId)
})
res.users.forEach((item, index) => {
participatorList.push({ userId: item.userId, username: item.name, headUrl: item.avatar, platform: 'dingtalk' })
participatorUserId.push(item.userId)
})
}
participatorList = _that.setArrary(participatorList.concat(outLookConcat))
participatorUserId = [...new Set(participatorUserId)]
_that.$store.data.participatorList = participatorList
_that.$store.data.participatorUserId = participatorUserId
_that.update()
_that.conflictPeople()
if (_that.data.repeatable) {
_that.setData({
'conSelectPopupData.showSelectPopup': true,
editType: 'operate_user'
})
} else {
_that.isChange('operate_user', 'only')
}
},
fail: function (err) {
}
})
},
// 数组 去重
setArrary(arr) {
let containt = {}
for (let x of arr) {
containt['id' + x.userId] = x
}
return Object.values(containt)
},
// 选择时间 点击完成
onComplete(event) {
this.$store.data.startTime = `${event.startTime}:00`
this.$store.data.endTime = `${event.endTime}:00`
this.update()
this.acrossDay(this.$store.data.startTime, this.$store.data.endTime)
this.setData({
popupShow: false,
'conSelectPopupData.selectType': 'common',
week: this.data.weekList[new Date(this.$store.data.startTime).getDay()],
editType: '',
})
this.resetRepeatList()
if (this.data.repeatable) {
this.setData({
'conSelectPopupData.showSelectPopup': true,
editType: 'modify_time'
})
} else {
if (this.$store.data.participatorList.length < 2) {
this.isChange('modify_time', 'only')
} else {
this.setData({
editType: 'modify_time',
'centerPopup.showCenterPopup': true
})
}
// this.isChange('modify_time', 'only')
}
},
// 选择会前提醒时间
selectAheadtimes(event) {
this.setData({
......@@ -721,93 +661,9 @@ create.Page({
this.isChange('aheadTimes', 'only')
}
},
// 保存编辑
modifySchedule(data, needNotice = 0) {
let that = this
let obj = {
needNotice: needNotice,
scheduleId: this.data.scheduleItem.id,
templateId: this.data.scheduleItem.scheduleTemplateId,
planDate: this.data.scheduleItem.planDate
}
return new Promise((resolve, rejects) => {
modifySchedule(Object.assign(data, obj)).then(res => {
if (res.data.code === 0) {
if (data.modifyContent !== 'title') {
if (this.$store.modifyErpeatMeeting) {
this.$store.modifyErpeatMeeting()
}
}
if (data.modifyContent == 'modify_time' || data.modifyContent == ' modify_location') {
this.setData({
mrReserveStatus: res.data.extra
})
this.$store.data.originalData.mrReserveStatus = res.data.extra
this.update()
}
if (this.$store.data.originalData.repeatable === 1 && !!res.data.data) {
observer.notice(res.data.data)
}
return resolve(res)
} else {
return rejects(res)
}
}).catch(err => {
return rejects(err)
})
})
},
// 获取时间参数
getTimes(time = new Date()) {
let date = new Date(time)
let year = date.getFullYear()
let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
let hour = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
let miunutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
return `${year}/${month}/${day} ${hour}:${miunutes}:00`
},
// 是否跨天
acrossDay(time1, time2) {
let isAcrossDay = ''
if (JSON.stringify(this.getTimes(time1).substring(0, 10)) === JSON.stringify(this.getTimes(time2).substring(0, 10))) {
isAcrossDay = false
} else {
isAcrossDay = true
}
this.setData({
isAcrossDay: isAcrossDay
})
},
// 人员冲突
conflictPeople() {
let userIds = []
for (let value of this.$store.data.participatorList) {
userIds.push(value.userId)
}
let data = {
startTime: this.$store.data.startTime.replace(/\//g, "-"),
endTime: this.$store.data.endTime.replace(/\//g, "-"),
userIds: userIds
}
getUserScheduleInTime(data).then(res => {
let conflictPeople = []
for (let value in res.data.data) {
const arr = res.data.data[value].filter(function (item) {
return item.confirmAttendance === 1
})
if (arr.length > 1) {
conflictPeople.push(value)
}
}
this.setData({
conflictPeople: conflictPeople
})
})
},
// toast 消失之后的回调
onToastHidden() {
this.setData({
......@@ -977,41 +833,6 @@ create.Page({
break
}
},
// 重置时间
reSetTime() {
this.$store.data.startTime = this.$store.data.originalData.startTime.replace(/-/g, "/")
this.$store.data.endTime = this.$store.data.originalData.endTime.replace(/-/g, "/")
this.update()
this.setData({
week: this.data.weekList[new Date(this.$store.data.originalData.startTime).getDay()],
})
},
// 重置地点
reSetLocation() {
this.$store.data.locationName = this.$store.data.originalData.location.locationName
this.$store.data.roomId = this.$store.data.originalData.meetingRoomId === -1 ? '' : this.$store.data.originalData.meetingRoomId
this.update()
},
// 重置人物
reSetUsers() {
this.$store.data.participatorList = [...this.$store.data.originUsers]
this.$store.data.participatorUserId = [...this.$store.data.originUsersId]
this.update()
},
// 重置循环
reSetRepeat() {
let repeatListMap = new Map()
for (let item of this.data.comListData.repeatList) {
if (item.recurrenceModel.recurrenceModel !== 'weekly') {
repeatListMap.set(item.recurrenceModel.model, item.id)
}
}
this.setData({
'comListData.comSelectListId': this.$store.data.originalData.recurrenceModel.model === 'weekly' ? (this.$store.data.originalData.recurrenceModel.weekDayList.length > 1 ? 3 : 2) : repeatListMap.get(this.$store.data.originalData.recurrenceModel.model),
repeatable: this.$store.data.originalData.repeatable,
recurrenceModel: this.$store.data.originalData.repeatable ? { model: this.$store.data.originalData.recurrenceModel.model, daysOfMonth: this.$store.data.originalData.recurrenceModel.daysOfMonth, interval: 1, initialTime: this.$store.data.originalData.recurrenceModel.initialTime, terminateTime: this.$store.data.originalData.recurrenceModel.terminateTime, weekDayList: this.$store.data.originalData.recurrenceModel.weekDayList } : { model: 'no_repeat' },
})
},
// 判断数据发生改变 发生改变 请求
isChange(value, modifyModel, needNotice = 0) {
let modifyContent = ''
......@@ -1065,31 +886,7 @@ create.Page({
})
}
break
case 'meeting_way':
let dataWay = {
meetingWayModel: this.data.meetingWayModel,
modifyModel: modifyModel,
modifyContent: 'meeting_way'
}
this.modifySchedule(dataWay).then(res => {
this.$store.data.originalData.meetingWay = !!this.data.comListData.meetingWayModelId ? this.data.comListData.meetingWayList[this.data.comListData.meetingWayModelId] : null
this.update()
if (dataWay.meetingWayModel.model === 'zoom' && this.store.data.relatedAppPlatform.includes('zoom')) {
const scheduleDetailData = {
id: !!this.data.scheduleItem.scheduleId ? this.data.scheduleItem.scheduleId : this.data.scheduleItem.id,
scheduleTemplateId: this.data.scheduleItem.scheduleTemplateId,
planDate: !!this.data.scheduleItem.planDate ? this.data.scheduleItem.planDate.replace(/\//g, '-') : null
}
getScheduleDetail(scheduleDetailData).then(success => {
meetingWayModelData: success.data.data.meetingWayModel
})
}
}).catch(err => {
this.setData({
'comListData.meetingWayModelId': this.$store.data.originalData.meetingWayModel === null ? null : (this.$store.data.originalData.meetingWayModel.model === 'dingtalk' ? 0 : 1)
})
})
break
case 'operate_user':
if (JSON.stringify(this.$store.data.originUsers) != JSON.stringify(this.$store.data.participatorList)) {
let addUserList = this.arrayPoor(this.$store.data.originUsers, this.$store.data.participatorList).addUserList
......@@ -1299,48 +1096,6 @@ create.Page({
break
}
},
// 数组取差值 原先的数组与现在的比较 增加与减少
arrayPoor(origin, now) {
let originMap = new Map()
let nowMap = new Map()
let add = []
let del = []
for (let x of origin) {
originMap.set(x.userId, x)
}
for (let x of now) {
nowMap.set(x.userId, x)
let status1 = originMap.get(x.userId)
if (!status1) {
add.push(x)
}
}
for (let x of origin) {
let status2 = nowMap.get(x.userId)
if (!status2) {
del.push(x)
}
}
return {
addUserList: add,
deleteUserList: del
}
},
// 已选用户去中去掉必选用户
selectedelRequired(req, pic) {
for (let i = 0; i < req.length; i++) {
for (let m = 0; m < pic.length; m++) {
if (req[i] == pic[m]) {
pic.splice(m, 1)
m--;
}
}
}
return {
requiredUsers: req,
pickedUsers: pic
}
},
// 删除 日程
handleDelete() {
const _that = this
......@@ -1494,7 +1249,7 @@ create.Page({
// this.store.data.isNeedReloadList = false;
// this.update();
this.getAffairList(this.data.scheduleItem.id)
this.getAffairList(this.store.data.scheduleId)
},
......@@ -1716,7 +1471,7 @@ create.Page({
this.store.data.fileInfos = data
this.update()
dd.navigateTo({ url: `./../uploadFile/uploadFile?id=${this.data.id}` })
dd.navigateTo({ url: `./../uploadFile/uploadFile?id=${this.store.data.scheduleId}` })
},
//隐藏文件操作浮窗
......
export function getSelectRepeatId(recurrenceModel, repeatList) {
for (let i = 0; i < repeatList.length; i++) {
if (repeatList[i].recurrenceModel.model === recurrenceModel.model) {
if (recurrenceModel.model === "weekly" && recurrenceModel.weekDayList.length === repeatList[i].recurrenceModel.weekDayList.length) {
return repeatList[i].id
}
return repeatList[i].id
}
}
return 0
}
export function getInitialPsarticipants(participants) {
let people = {}
for (let i = 0; i < participants.length; i++) {
people[participants[i].participator.userId] = participants[i].participator
}
return people
}
export function handleChangePeople(originUsers, nowUsers) {
const add = nowUsers.filter(it => !originUsers.includes(it))
const del = originUsers.filter(it => !nowUsers.includes(it))
return {
add: add,
del: del
}
}
\ No newline at end of file
......@@ -16,24 +16,22 @@ create.Page({
isIPX: false
},
onLoad(event) {
// this.reset()
if (event.scheduleItem) {
event.scheduleItem = decodeURIComponent(event.scheduleItem)
let scheduleItem = JSON.parse(event.scheduleItem)
this.setData({
scheduleItem: scheduleItem
})
// // this.reset()
// if (event.scheduleItem) {
// this.setData({
// scheduleItem: event.scheduleItem
// })
let contactPeople = []
let contactPeopleId = []
for (let value of this.$store.data.participatorList) {
contactPeople.push(value)
contactPeopleId.push(value.userId)
}
this.store.data.contactPeople = contactPeople
this.store.data.contactPeopleId = contactPeopleId
this.update()
}
// let contactPeople = []
// let contactPeopleId = []
// for (let value of this.$store.data.participatorList) {
// contactPeople.push(value)
// contactPeopleId.push(value.userId)
// }
// this.store.data.contactPeople = contactPeople
// this.store.data.contactPeopleId = contactPeopleId
// this.update()
// }
this.setData({
isIPX: checkFullScren(),
currentPeople: getApp().globalData.userid
......
......@@ -33,6 +33,7 @@ create.Page({
},
},
onLoad(e) {
debugger
if (e.scheduleItem) {
e.scheduleItem = decodeURIComponent(e.scheduleItem)
this.setData({
......
......@@ -2,7 +2,7 @@
<view class="describe">
<textarea value="{{description}}" class="textarea" onInput="inputChange" placeholder="添加文件描述..." maxlength="-1" />
</view>
<file-list fileView="{{{fileInfos: fileInfos}}}" isCanEdit="{{false}}" isPreview="{{false}}" isCanDelete="{{true}}"/>
<file-list fileInfos="{{fileInfos}}" isCanEdit="{{false}}" isPreview="{{false}}" isCanDelete="{{true}}"/>
<view class="addText" onTap="add">继续添加</view>
</view>
<view class="saveButton" onTap="saveUpload">
......
......@@ -44,15 +44,18 @@ create.Page({
}
let data = []
res.data.map(it => {
data.push({
this.store.data.fileInfos.push({
fileId: it.fileId,
name: it.fileName,
size: it.fileSize,
spaceId: it.spaceId,
platform: "dingTalk",
mimeType: it.fileType
})
})
this.store.data.fileInfos.push(data)
console.log(this.store.data.fileInfos)
this.update();
},
......@@ -83,8 +86,9 @@ create.Page({
fileList: fileInfos
}
}
console.log(data)
updateMeetingTask(data).then(res => {
console.log(res)
this.store.data.isNeedReloadList = true;
this.store.data.fileInfos = []
this.store.data.description = ''
......
......@@ -7,8 +7,8 @@ class Store {
roomId: '',
startTime: '',
endTime: '',
currentPeople: '',
originUsers: [],
originUsersId: [],
originalData: null,
indexNeedUpdate: false,
isIndexAffairListNeedUpdate: false,
......@@ -24,16 +24,14 @@ class Store {
this.data.roomId = ''
this.data.participatorList = {}
this.data.showParticipatorList = []
// this.data.originUsers = []
// this.data.originUsersId = []
this.data.originUsers = []
this.data.locationName = ''
this.data.onceMeetingContent = null
this.update();
}
resetEditData() {
this.data.roomId = ''
// this.data.originUsers = []
// this.data.originUsersId = []
this.data.originUsers = []
this.data.participatorList = {}
this.data.showParticipatorList = []
this.data.locationName = ''
......
......@@ -174,7 +174,6 @@ endTime 结束时间
*/
export function getShowTime(startTime, endTime) {
debugger
const weekList = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
const weekIndex = new Date(startTime).getDay()
let isAcrossDay = 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