Commit 1721cd43 by fengzhaoyu

fix: 添加邮箱修改 地点全名 样式修改

parent 1a2417e2
const app = getApp();
import $http from "./http";
import $binding from "./binding";
// 区域标签树
export function getRoomTree() {
return $http({
method: "get",
url: "/admin/label/tree?scene=meeting_room_location"
});
}
// 获取预定会议室列表
export function getReserveRoomList(data) {
......
......@@ -3,7 +3,8 @@
width: 100%;
position: fixed;
top: 0;
background: rgba(0, 0, 0, 0.12)
background: rgba(0, 0, 0, 0.12);
z-index: 999;
}
.popupWindowCenter {
......@@ -15,6 +16,8 @@
border-radius: 10rpx;
top: 400rpx;
background: #fff;
animation: amplification 0.2s ease;
transform: none;
}
.list {
......
<view class="popupWindow" a:if="{{centerPopup}}">
<view class="popupWindowCenter">
<view class="list">
向参会者发送会议更新通知?
</view>
<view class="list" a:for="{{centerPopupList}}" onTap="selectSend" data-item="{{item}}">
{{item.text}}
</view>
......
......@@ -9,7 +9,7 @@
bottom: 0;
left: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.4);
background-color: rgba(0, 0, 0, 0.12);
opacity: 0;
pointer-events: none;
}
......@@ -41,6 +41,7 @@
}
.dm-popup-show .dm-popup-content {
animation: showAnimation 0.2s ease;
transform: none;
}
......
......@@ -14,6 +14,8 @@
left: 16rpx;
right: 16rpx;
overflow: hidden;
animation: showAnimation 0.2s ease;
transform: none;
}
.selectPopupItem {
......
<view class="createMeeting">
<view class="createMeeting ">
<!-- title remark 标题 描述 -->
<view class="createTitle">
<view class="title">
......
<block a:if="{{getData}}">
<view class=" {{forbiddenScroll ? 'metingDetail' : ''}}">
<view class=" {{(popupShow || show || centerPopup.showCenterPopup || conToastData.showToast || conSelectPopupData.showSelectPopup )? 'metingDetail' : ''}}">
<import src="../../template/deleteBtn/index.axml"/>
<view class="hideDetail" a:if="{{isExpand}}">
<view class="hideTitle">
......@@ -109,7 +109,7 @@
<view class="conflict iconicon_conflict iconfont" a:if="{{conflictPeople.includes(item.userId)}}">
</view>
</view>
<view class="name">{{item.name}}</view>
<!--<view class="name">{{item.name}}</view> -->
</view>
<view class="addPeople iconfont iconicon_add1" catchTap="showPopup" data-type='participator'></view>
</view>
......
......@@ -79,8 +79,7 @@ create.Page({
showCenterPopup: false,
centerPopupList: [
{ id: 0, text: '不发送通知' },
{ id: 1, text: '发送通知' },
{ id: -1, text: '取消编辑' }
{ id: 1, text: '发送通知' }
],
centerPopupId: ''
},
......@@ -107,7 +106,6 @@ create.Page({
editType: '',
confirmAttendance: null,
isExpand: false,
forbiddenScroll: false,
placeholder: ''
},
onShow() {
......@@ -155,7 +153,11 @@ create.Page({
editType: this.$store.data.updateInfo.updateType
})
} else {
this.isChange(this.$store.data.updateInfo.updateType, 'only')
this.setData({
editType: this.$store.data.updateInfo.updateType,
'centerPopup.showCenterPopup': true
})
// this.isChange(this.$store.data.updateInfo.updateType, 'only')
}
} else {
this.reSetLocation()
......@@ -164,22 +166,8 @@ create.Page({
updateType: ''
}
}
break;
}
} else {
// if (this.$store.data.updateInfo.updateType === 'operate_user') {
// this.reSetUsers()
// } else if (this.$store.data.updateInfo.updateType === 'modify_location') {
// this.reSetTime()
// this.reSetLocation()
// }
// this.$store.data.updateInfo = {
// isUpate: false,
// updateType: ''
// }
}
},
onLoad(event) {
......@@ -363,7 +351,10 @@ create.Page({
editType: 'modify_location'
})
} else {
this.isChange('modify_location', 'only')
this.setData({
editType: 'modify_location',
'centerPopup.showCenterPopup': true
})
}
break
case 'meetingWayModel':
......@@ -377,15 +368,11 @@ create.Page({
this.isChange('meeting_way', 'only')
}
}
this.setData({
forbiddenScroll: false
})
},
// 关闭popup 点击mark
closePopup() {
this.setData({
popupShow: false,
forbiddenScroll: false
})
},
// 选择循环机制 选择会议方式 选择时间 会前提醒 出现popup弹窗
......@@ -394,7 +381,6 @@ create.Page({
let complete = false
let multiple = false
let popupTitle = ''
let forbiddenScroll = false
switch (event.currentTarget.dataset.type) {
case 'meetingWayModel':
iconType = 'image',
......@@ -413,7 +399,6 @@ create.Page({
break
case 'time':
popupTitle = '选择会议时间'
forbiddenScroll = true
break
case 'aheadTime':
popupTitle = '选择会前提醒'
......@@ -423,7 +408,6 @@ create.Page({
break
}
this.setData({
forbiddenScroll: forbiddenScroll,
popupShow: true,
popupTitle: popupTitle,
comType: event.currentTarget.dataset.type,
......@@ -602,7 +586,6 @@ create.Page({
'conSelectPopupData.selectType': 'common',
week: this.data.weekList[new Date(this.$store.data.startTime).getDay()],
editType: '',
forbiddenScroll: false
})
this.resetRepeatList()
if (this.data.repeatable) {
......@@ -611,7 +594,11 @@ create.Page({
editType: 'modify_time'
})
} else {
this.isChange('modify_time', 'only')
this.setData({
editType: 'modify_time',
'centerPopup.showCenterPopup': true
})
// this.isChange('modify_time', 'only')
}
},
// 选择会前提醒时间
......@@ -717,7 +704,7 @@ create.Page({
const _that = this
switch (this.data.conSelectPopupData.selectType) {
case 'common':
if (this.data.editType === 'operate_user' || this.data.editType === 'modify_location' || this.data.editType === 'modify_time') {
if (this.data.editType === 'modify_location' || this.data.editType === 'modify_time') {
this.setData({
'centerPopup.showCenterPopup': true
})
......@@ -799,7 +786,11 @@ create.Page({
// 选择发不发通知
onSelectSend(event) {
if (event.currentTarget.dataset.item.id > -1) {
this.isChange(this.data.editType, this.data.conSelectPopupData.selectPopupId, event.currentTarget.dataset.item.id)
if (this.$store.data.originalData.repeatable === 1) {
this.isChange(this.data.editType, this.data.conSelectPopupData.selectPopupId, event.currentTarget.dataset.item.id)
} else {
this.isChange(this.data.editType, 'only', event.currentTarget.dataset.item.id)
}
} else {
switch (this.data.editType) {
case 'operate_user':
......@@ -1056,7 +1047,7 @@ create.Page({
endTime: this.$store.data.endTime.replace(/\//g, "-"),
modifyContent: 'modify_time'
}
this.isChange(dat2Time1)
this.isChange('modify_time', modifyModel, needNotice)
}
......@@ -1082,6 +1073,7 @@ create.Page({
this.update()
this.resetRepeatList()
if (this.data.recurrenceModel.model === 'weekly' && this.data.recurrenceModel.weekDayList.length === 1) {
let dataRepeat4 = {
startTime: this.$store.data.startTime.replace(/\//g, "-"),
endTime: this.$store.data.endTime.replace(/\//g, "-"),
......@@ -1111,7 +1103,7 @@ create.Page({
})
}
this.modifySchedule(data, needNotice)
// this.modifySchedule(data, needNotice)
})
break
case 'aheadTimes':
......@@ -1529,7 +1521,7 @@ create.Page({
})
},
//创建任务
complete() {
complete: throttle(function () {
const { currentTask } = this.store.data;
const postData = {
"groupId": this.data.scheduleItem.groupId,
......@@ -1562,7 +1554,13 @@ create.Page({
this.update();
}
})
},
}),
// throttle
// complete() {
// debugger
// },
//
expand() {
this.setData({
......
import {
getReserveRoomList,
getAllScheduleWithMeetingRoomByTime
getAllScheduleWithMeetingRoomByTime,
getRoomTree
} from "../../api/request";
import { EEXIST } from "constants";
import { getFormatDate, padZero } from "../../utils/utils";
import { getFlatTree } from '../../utils/flatTree.js'
import create from "dd-store";
create.Page({
data: {
......@@ -69,8 +71,10 @@ create.Page({
afterTomorrowTime: "",
customTime: ""
},
userId: ""
userId: "",
areaMap: null
},
parentStr: '',
onLoad(query) {
// let date = new Date(this.$store.data.startTime.replace(/-/g, "/"));
let date = new Date();
......@@ -97,7 +101,13 @@ create.Page({
)}/${padZero(afterTomorrowTime.getDate())}`,
userId: getApp().globalData.userid
});
this.getPageData();
getRoomTree().then(res => {
this.setData({
areaMap: getFlatTree(res.data.data)
})
this.getPageData();
// console.log(this.data.areaMap)
})
},
onShow() {
this.update();
......@@ -109,6 +119,10 @@ create.Page({
};
getReserveRoomList(data).then(res => {
if (res.data.data) {
for (let value of res.data.data) {
value.name = `${this.getParentStr("1250241601903665153")}${value.name}`
this.parentStr = ''
}
let reserveRoomList = res.data.data.map(item => {
let startTime = parseInt(
item.timeSlotWithMeetingVOS[0].reserveStartTime.substring(0, 2)
......@@ -160,6 +174,17 @@ create.Page({
}
});
},
// 获取当前id 的祖先
getParentStr(parentId) {
if (parentId !== '0') {
this.parentStr = this.data.areaMap.get(parentId).name + '-' + this.parentStr
// 此处一定return
return this.getParentStr(this.data.areaMap.get(parentId).parentId)
} else {
let parentStr = this.parentStr
return parentStr
}
},
// 弹出modal选择会议时间
changeRoomTime(e) {
let that = this;
......@@ -173,8 +198,8 @@ create.Page({
? "0" + modalDate.getHours()
: modalDate.getHours()
: modalDate.getHours() + 1 < 10
? "0" + (modalDate.getHours() + 1)
: modalDate.getHours() + 1;
? "0" + (modalDate.getHours() + 1)
: modalDate.getHours() + 1;
let num = "";
if (dateTime.replace(/-/g, "/") === this.data.TimeSlot.todayTime) {
num = "0";
......@@ -258,19 +283,19 @@ create.Page({
modalFooterTime.getMonth() < 9
? "0" + (modalFooterTime.getMonth() + 1)
: modalFooterTime.getMonth() + 1
}-${
}-${
modalFooterTime.getDate() < 10
? "0" + modalFooterTime.getDate()
: modalFooterTime.getDate()
} ${
} ${
modalFooterTime.getHours() < 10
? "0" + modalFooterTime.getHours()
: modalFooterTime.getHours()
}:${
}:${
modalFooterTime.getMinutes() < 10
? "0" + modalFooterTime.getMinutes()
: modalFooterTime.getMinutes()
}`,
}`,
"modalFooter.allMinutes": 30,
"modalFooter.isOneDay": true
});
......@@ -327,19 +352,19 @@ create.Page({
modalFooterTime.getMonth() < 9
? "0" + (modalFooterTime.getMonth() + 1)
: modalFooterTime.getMonth() + 1
}-${
}-${
modalFooterTime.getDate() < 10
? "0" + modalFooterTime.getDate()
: modalFooterTime.getDate()
} ${
} ${
modalFooterTime.getHours() < 10
? "0" + modalFooterTime.getHours()
: modalFooterTime.getHours()
}:${
}:${
modalFooterTime.getMinutes() < 10
? "0" + modalFooterTime.getMinutes()
: modalFooterTime.getMinutes()
}`,
}`,
"modalFooter.allMinutes": allMinutes,
"modalFooter.isOneDay": true
},
......@@ -376,19 +401,19 @@ create.Page({
modalFooterTime.getMonth() < 9
? "0" + (modalFooterTime.getMonth() + 1)
: modalFooterTime.getMonth() + 1
}-${
}-${
modalFooterTime.getDate() < 10
? "0" + modalFooterTime.getDate()
: modalFooterTime.getDate()
} ${
} ${
modalFooterTime.getHours() < 10
? "0" + modalFooterTime.getHours()
: modalFooterTime.getHours()
}:${
}:${
modalFooterTime.getMinutes() < 10
? "0" + modalFooterTime.getMinutes()
: modalFooterTime.getMinutes()
}`,
}`,
"modalFooter.allMinutes": allMinutes,
"modalFooter.isOneDay": false
},
......@@ -437,19 +462,19 @@ create.Page({
modalFooterTime.getMonth() < 9
? "0" + (modalFooterTime.getMonth() + 1)
: modalFooterTime.getMonth() + 1
}-${
}-${
modalFooterTime.getDate() < 10
? "0" + modalFooterTime.getDate()
: modalFooterTime.getDate()
} ${
} ${
modalFooterTime.getHours() < 10
? "0" + modalFooterTime.getHours()
: modalFooterTime.getHours()
}:${
}:${
modalFooterTime.getMinutes() < 10
? "0" + modalFooterTime.getMinutes()
: modalFooterTime.getMinutes()
}`,
}`,
"modalFooter.allMinutes": allMinutes,
"modalFooter.isOneDay": true
},
......@@ -485,19 +510,19 @@ create.Page({
modalFooterTime.getMonth() < 9
? "0" + (modalFooterTime.getMonth() + 1)
: modalFooterTime.getMonth() + 1
}-${
}-${
modalFooterTime.getDate() < 10
? "0" + modalFooterTime.getDate()
: modalFooterTime.getDate()
} ${
} ${
modalFooterTime.getHours() < 10
? "0" + modalFooterTime.getHours()
: modalFooterTime.getHours()
}:${
}:${
modalFooterTime.getMinutes() < 10
? "0" + modalFooterTime.getMinutes()
: modalFooterTime.getMinutes()
}`,
}`,
"modalFooter.allMinutes": allMinutes,
"modalFooter.isOneDay": false
},
......@@ -529,19 +554,19 @@ create.Page({
startTimeDate.getMonth() + 1 < 10
? "0" + (startTimeDate.getMonth() + 1)
: startTimeDate.getMonth() + 1
}-${
}-${
startTimeDate.getDate() < 10
? "0" + startTimeDate.getDate()
: startTimeDate.getDate()
} ${
} ${
startTimeDate.getHours() < 10
? "0" + startTimeDate.getHours()
: startTimeDate.getHours()
}:${
}:${
startTimeDate.getMinutes() < 10
? "0" + startTimeDate.getMinutes()
: startTimeDate.getMinutes()
}`;
}`;
if (meetingStartTime === this.data.meetingTime.endTime) {
let modalFooterTime = new Date(
that.data.meetingTime.endTime.replace(/-/g, "/")
......@@ -556,19 +581,19 @@ create.Page({
modalFooterTime.getMonth() < 9
? "0" + (modalFooterTime.getMonth() + 1)
: modalFooterTime.getMonth() + 1
}-${
}-${
modalFooterTime.getDate() < 10
? "0" + modalFooterTime.getDate()
: modalFooterTime.getDate()
} ${
} ${
modalFooterTime.getHours() < 10
? "0" + modalFooterTime.getHours()
: modalFooterTime.getHours()
}:${
}:${
modalFooterTime.getMinutes() < 10
? "0" + modalFooterTime.getMinutes()
: modalFooterTime.getMinutes()
}`,
}`,
"modalFooter.allMinutes": 30,
"modalFooter.isOneDay": true
},
......@@ -593,19 +618,19 @@ create.Page({
modalFooterTime.getMonth() < 9
? "0" + (modalFooterTime.getMonth() + 1)
: modalFooterTime.getMonth() + 1
}-${
}-${
modalFooterTime.getDate() < 10
? "0" + modalFooterTime.getDate()
: modalFooterTime.getDate()
} ${
} ${
modalFooterTime.getHours() < 10
? "0" + modalFooterTime.getHours()
: modalFooterTime.getHours()
}:${
}:${
modalFooterTime.getMinutes() < 10
? "0" + modalFooterTime.getMinutes()
: modalFooterTime.getMinutes()
}`,
}`,
"modalFooter.allMinutes": allMinutes
},
() => {
......@@ -624,19 +649,19 @@ create.Page({
endTimeDate.getMonth() + 1 < 10
? "0" + (endTimeDate.getMonth() + 1)
: endTimeDate.getMonth() + 1
}-${
}-${
endTimeDate.getDate() < 10
? "0" + endTimeDate.getDate()
: endTimeDate.getDate()
} ${
} ${
endTimeDate.getHours() < 10
? "0" + endTimeDate.getHours()
: endTimeDate.getHours()
}:${
}:${
endTimeDate.getMinutes() < 10
? "0" + endTimeDate.getMinutes()
: endTimeDate.getMinutes()
}`;
}`;
if (meetingEndTime === this.data.meetingTime.startTime) {
let modalFooterTime = new Date(
this.data.meetingTime.startTime.replace(/-/g, "/")
......@@ -650,19 +675,19 @@ create.Page({
modalFooterTime.getMonth() < 9
? "0" + (modalFooterTime.getMonth() + 1)
: modalFooterTime.getMonth() + 1
}-${
}-${
modalFooterTime.getDate() < 10
? "0" + modalFooterTime.getDate()
: modalFooterTime.getDate()
} ${
} ${
modalFooterTime.getHours() < 10
? "0" + modalFooterTime.getHours()
: modalFooterTime.getHours()
}:${
}:${
modalFooterTime.getMinutes() < 10
? "0" + modalFooterTime.getMinutes()
: modalFooterTime.getMinutes()
}`,
}`,
"modalFooter.allMinutes": 30
},
() => {
......@@ -686,19 +711,19 @@ create.Page({
modalFooterTime.getMonth() < 9
? "0" + (modalFooterTime.getMonth() + 1)
: modalFooterTime.getMonth() + 1
}-${
}-${
modalFooterTime.getDate() < 10
? "0" + modalFooterTime.getDate()
: modalFooterTime.getDate()
} ${
} ${
modalFooterTime.getHours() < 10
? "0" + modalFooterTime.getHours()
: modalFooterTime.getHours()
}:${
}:${
modalFooterTime.getMinutes() < 10
? "0" + modalFooterTime.getMinutes()
: modalFooterTime.getMinutes()
}`,
}`,
"modalFooter.allMinutes": allMinutes
},
() => {
......@@ -737,19 +762,19 @@ create.Page({
modalFooterTime.getMonth() < 9
? "0" + (modalFooterTime.getMonth() + 1)
: modalFooterTime.getMonth() + 1
}-${
}-${
modalFooterTime.getDate() < 10
? "0" + modalFooterTime.getDate()
: modalFooterTime.getDate()
} ${
} ${
modalFooterTime.getHours() < 10
? "0" + modalFooterTime.getHours()
: modalFooterTime.getHours()
}:${
}:${
modalFooterTime.getMinutes() < 10
? "0" + modalFooterTime.getMinutes()
: modalFooterTime.getMinutes()
}`,
}`,
"modalFooter.allMinutes": allMinutes,
"modalFooter.isOneDay": true
},
......@@ -783,19 +808,19 @@ create.Page({
modalFooterTime.getMonth() < 9
? "0" + (modalFooterTime.getMonth() + 1)
: modalFooterTime.getMonth() + 1
}-${
}-${
modalFooterTime.getDate() < 10
? "0" + modalFooterTime.getDate()
: modalFooterTime.getDate()
} ${
} ${
modalFooterTime.getHours() < 10
? "0" + modalFooterTime.getHours()
: modalFooterTime.getHours()
}:${
}:${
modalFooterTime.getMinutes() < 10
? "0" + modalFooterTime.getMinutes()
: modalFooterTime.getMinutes()
}`,
}`,
"modalFooter.allMinutes": allMinutes,
"modalFooter.isOneDay": false
},
......@@ -846,19 +871,19 @@ create.Page({
modalFooterTime2.getMonth() < 9
? "0" + (modalFooterTime2.getMonth() + 1)
: modalFooterTime2.getMonth() + 1
}-${
}-${
modalFooterTime2.getDate() < 10
? "0" + modalFooterTime2.getDate()
: modalFooterTime2.getDate()
} ${
} ${
modalFooterTime2.getHours() < 10
? "0" + modalFooterTime2.getHours()
: modalFooterTime2.getHours()
}:${
}:${
modalFooterTime2.getMinutes() < 10
? "0" + modalFooterTime2.getMinutes()
: modalFooterTime2.getMinutes()
}`,
}`,
"modalFooter.allMinutes": allMinutes,
"modalFooter.isOneDay": true
},
......@@ -892,19 +917,19 @@ create.Page({
modalFooterTime.getMonth() < 9
? "0" + (modalFooterTime.getMonth() + 1)
: modalFooterTime.getMonth() + 1
}-${
}-${
modalFooterTime.getDate() < 10
? "0" + modalFooterTime.getDate()
: modalFooterTime.getDate()
} ${
} ${
modalFooterTime.getHours() < 10
? "0" + modalFooterTime.getHours()
: modalFooterTime.getHours()
}:${
}:${
modalFooterTime.getMinutes() < 10
? "0" + modalFooterTime.getMinutes()
: modalFooterTime.getMinutes()
}`,
}`,
"modalFooter.allMinutes": allMinutes,
"modalFooter.isOneDay": false
},
......@@ -933,19 +958,19 @@ create.Page({
endTimeDate.getMonth() + 1 < 10
? "0" + (endTimeDate.getMonth() + 1)
: endTimeDate.getMonth() + 1
}-${
}-${
endTimeDate.getDate() < 10
? "0" + endTimeDate.getDate()
: endTimeDate.getDate()
} ${
} ${
endTimeDate.getHours() < 10
? "0" + endTimeDate.getHours()
: endTimeDate.getHours()
}:${
}:${
endTimeDate.getMinutes() < 10
? "0" + endTimeDate.getMinutes()
: endTimeDate.getMinutes()
}:00`
}:00`
};
return getAllScheduleWithMeetingRoomByTime(data).then(res => {
return res.data.data;
......@@ -1039,8 +1064,8 @@ create.Page({
e.currentTarget.dataset.num == "0"
? this.data.TimeSlot.todayTime
: e.currentTarget.dataset.num == "1"
? this.data.TimeSlot.tomorrowTime
: this.data.TimeSlot.afterTomorrowTime,
? this.data.TimeSlot.tomorrowTime
: this.data.TimeSlot.afterTomorrowTime,
dataNum: e.currentTarget.dataset.num
},
() => {
......@@ -1059,18 +1084,18 @@ create.Page({
? "0" + modalDate.getHours()
: modalDate.getHours()
: modalDate.getHours() + 1 < 10
? "0" + (modalDate.getHours() + 1)
: modalDate.getHours() + 1;
? "0" + (modalDate.getHours() + 1)
: modalDate.getHours() + 1;
let selectDate = new Date(this.data.meetingTime.date);
let meetingDate = `${selectDate.getFullYear()}-${
selectDate.getMonth() + 1 < 10
? "0" + (selectDate.getMonth() + 1)
: selectDate.getMonth() + 1
}-${
}-${
selectDate.getDate() < 10
? "0" + selectDate.getDate()
: selectDate.getDate()
}`;
}`;
let data = {
meetingRoomId: that.data.meetingTime.meetingRoomId,
startTime: meetingDate
......@@ -1173,19 +1198,19 @@ create.Page({
endTimeDate.getMonth() + 1 < 10
? "0" + (endTimeDate.getMonth() + 1)
: endTimeDate.getMonth() + 1
}/${
}/${
endTimeDate.getDate() < 10
? "0" + endTimeDate.getDate()
: endTimeDate.getDate()
} ${
} ${
endTimeDate.getHours() < 10
? "0" + endTimeDate.getHours()
: endTimeDate.getHours()
}:${
}:${
endTimeDate.getMinutes() < 10
? "0" + endTimeDate.getMinutes()
: endTimeDate.getMinutes()
}:00`;
}:00`;
this.$store.data.locationName = this.data.meetingTime.meetingRoomName;
this.$store.data.roomId = this.data.meetingTime.meetingRoomId;
this.update();
......@@ -1199,33 +1224,29 @@ create.Page({
endTimeDate.getMonth() + 1 < 10
? "0" + (endTimeDate.getMonth() + 1)
: endTimeDate.getMonth() + 1
}/${
}/${
endTimeDate.getDate() < 10
? "0" + endTimeDate.getDate()
: endTimeDate.getDate()
} ${
} ${
endTimeDate.getHours() < 10
? "0" + endTimeDate.getHours()
: endTimeDate.getHours()
}:${
}:${
endTimeDate.getMinutes() < 10
? "0" + endTimeDate.getMinutes()
: endTimeDate.getMinutes()
}:00`;
}:00`;
this.$store.data.locationName = this.data.meetingTime.meetingRoomName;
this.$store.data.roomId = this.data.meetingTime.meetingRoomId;
}
if (this.$store.data.originalData && this.$store.data.locationName) {
if (
this.$store.data.locationName !=
this.$store.data.originalData.location.locationName ||
this.$store.data.roomId != this.$store.data.originalData.meetingRoomId
) {
(this.$store.data.updateInfo = {
if ((this.$store.data.locationName != this.$store.data.originalData.location.locationName) || this.$store.data.roomId != this.$store.data.originalData.meetingRoomId) {
this.$store.data.updateInfo = {
updateType: "modify_location",
isUpate: true
}),
this.update();
}
this.update();
}
}
dd.navigateBack({
......@@ -1295,8 +1316,8 @@ create.Page({
}
);
},
onMonthChange() {},
onYearChange() {},
onMonthChange() { },
onYearChange() { },
onSelectHasDisableDate() {
my.alert({
content: "SelectHasDisableDate"
......
......@@ -131,6 +131,10 @@ create.Page({
this.$store.data.participatorUserId.push(...userId)
this.$store.data.participatorList = this.setArrary(this.$store.data.participatorList)
this.$store.data.participatorUserId = [...new Set(this.$store.data.participatorUserId)]
if (!this.data.toPage) {
this.$store.data.updateInfo.isUpate = true
this.$store.data.updateInfo.updateType = 'operate_user'
}
} else {
this.store.data.contactPeople.push(...userList)
this.store.data.contactPeopleId.push(...userId)
......
......@@ -49,6 +49,9 @@ create.Page({
endTime: this.$store.data.endTime.replace(/\//g, "-")
}
queryAvailableMeetingRoomByTime(data).then(res => {
for (let value of res.data.data) {
value.meetingRoomFullName = `${value.meetingRoomFullName}-${value.name}`
}
that.setData({
availableMeetingRoom: res.data.data
})
......
import { RRule } from "rrule";
import {
getDynamicList,
meetingCollection,
updateMeetingTask,
getHomeUserSchedule1
} from "../../api/request";
import {
getDateMap,
getExcludeDate,
getNextDateList,
getWeekNumber,
getBlankList,
toLocaleDateString
} from "./schedule.js";
import {
getFormatDate,
throttle,
padZero,
getCreateShowTime
} from "../../utils/utils";
const currentDate = new Date();
const minYear = 2020;
const maxYear = currentDate.getFullYear() + 1;
let DateMap = getDateMap(minYear, maxYear);
const weekList = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
import create from "dd-store";
let maxClickCount = 5;
create.Page({
data: {
$data: null,
iconDay: currentDate.getDate(),
scheduleList: [],
todayStr: toLocaleDateString(currentDate),
currentData: toLocaleDateString(currentDate),
currentDataIndex: 0,
offset: "stop",
show: false,
loading: true,
traceTime: "1970-03-01 00:00:00",
isStopBodyScroll: false,
dynamicList: [],
current: 1,
pages: 1,
listLoading: true,
isFullscreen: false
},
scrollTop: 0,
pageSize: 10,
totalPages: 1,
currentPage: 1,
firstPage: 1,
scheduleList: [],
timer: null,
isFirstLoad: true,
blankDataLength: 0,
blankDataLengthAfter: 0,
minYear: minYear,
maxYear: maxYear,
todayIndex: 0,
onShow() {
//如果是重复会议重新算
if (this.$store.data.indexNeedUpdate) {
dd.setNavigationBar({
title: "日程"
});
DateMap = getDateMap(this.minYear, this.maxYear);
this.getData();
this.isFirstLoad = true;
this.$store.data.indexNeedUpdate = false;
this.update();
}
//单次会议往DateMap中添加
if (this.$store.data.onceMeetingContent) {
this.getScheduleList(this.$store.data.onceMeetingContent, "once");
this.$store.data.onceMeetingContent = null;
this.update();
}
//刷新动态列表
if (this.$store.data.isIndexAffairListNeedUpdate) {
this.getPages(1);
this.$store.data.isIndexAffairListNeedUpdate = false;
this.update();
}
},
onLoad() {
this.setData({
isFullscreen: getApp().globalData.isFullscreen
});
dd.setNavigationBar({
title: "动态"
});
//获取动态列表
this.getPages(1);
//获取日程列表
this.getData();
this.isFirstLoad = true;
},
//动态列表侧滑的时候禁止页面上下滑动
setBodyDisableScroll(isStopBodyScroll) {
this.setData({
isStopBodyScroll
});
},
//点击页面关闭侧滑模块
closeSwipe() {
if (this.$store.closeActiveSwipe) {
this.$store.closeActiveSwipe();
}
},
getPages(current, callBack) {
getDynamicList({
current,
size: 10
}).then(res => {
if (!res.data.data) {
this.setData({
listLoading: false
});
return;
}
const dynamicList = res.data.data.records.map((item, index) => {
for (let i = 0; i < item.meetingLogDataList.length; i++) {
if (item.meetingLogDataList[i].creatorInfo) {
item.meetingLogDataList[i].creatorInfo = JSON.parse(
item.meetingLogDataList[i].creatorInfo
);
}
if (item.meetingLogDataList[i].createTime) {
item.meetingLogDataList[i].createTime = getCreateShowTime(
item.meetingLogDataList[i].createTime
);
}
let itemData = item.meetingLogDataList[i].meetingLogResource;
if (itemData) {
itemData.groupId = item.groupId;
if (itemData.taskInfos || itemData.fileInfos) {
if (itemData.creatorInfo) {
itemData.creatorInfo = JSON.parse(itemData.creatorInfo);
}
if (itemData.fileInfos) {
itemData.fileInfos = JSON.parse(itemData.fileInfos);
}
if (itemData.taskInfos) {
itemData.taskInfos = JSON.parse(itemData.taskInfos);
}
if (itemData.acceptorInfo) {
itemData.acceptorInfo = JSON.parse(itemData.acceptorInfo);
}
}
}
}
return item;
});
//第一页数据会重新请求需要替换
if (current === 1) {
this.setData({
dynamicList
});
} else {
const newDynamicList = this.data.dynamicList.concat(dynamicList);
this.setData({
dynamicList: newDynamicList
});
}
this.setData({
listLoading: false,
current: res.data.data.current,
pages: res.data.data.pages
});
if (callBack) {
callBack();
}
});
},
//动态置顶
changeCollection(e) {
const { index, scheduleId, collection } = e.target.dataset;
meetingCollection({
scheduleId,
collection
}).then(res => {
//取消置顶
if (collection === "N") {
// 重新获取第一页的数据
this.getPages(1, () => {
dd.showToast({
content: "取消成功"
});
});
} else {
//置顶
const dynamicList = this.data.dynamicList;
const replaceItem = dynamicList[index];
dynamicList[index].traceTime = res.data.data;
dynamicList.splice(index, 1);
dynamicList.unshift(replaceItem);
this.setData(
{
dynamicList: dynamicList
},
() => {
dd.showToast({
content: "置顶成功"
});
}
);
}
});
},
//动态上拉加载分页数据
onScrollToLower() {
if (this.data.current < this.data.pages) {
this.getPages(this.data.current + 1);
}
},
//动态修改状态
onChangeTaskStatusOnList(e) {
const data = {
groupId: e.groupId,
scheduleId: e.scheduleId,
resourceType: "task",
creatorId: getApp().globalData.userid,
creatorInfo: getApp().globalData.userInfo,
id: e.id,
logType: "task_status_modify",
taskStatus: e.status
};
updateMeetingTask(data).then(res => {
if (res.data.code === 0) {
let dataIndex1 = "";
let dataIndex2 = "";
this.data.dynamicList.forEach((item, index) => {
if (item.scheduleId === e.scheduleId) {
dataIndex1 = index;
item.meetingLogDataList.forEach((it, index2) => {
if (it.meetingLogResource.id == e.id) {
dataIndex2 = index2;
}
});
}
});
const setData = `dynamicList[${dataIndex1}].meetingLogDataList[${dataIndex2}].meetingLogResource.taskStatus`;
this.setData({
[setData]: e.status
});
}
});
},
//日程获取分页数据
getPagination(scheduleList = []) {
this.totalPages = Math.ceil(scheduleList.length / this.pageSize);
for (let i = 0; i < scheduleList.length; i++) {
if (scheduleList[i].dateStr == toLocaleDateString(currentDate)) {
const centerPage = Math.floor(i / this.pageSize);
this.todayIndex = i;
this.setData({
currentDataIndex: i
})
// firstPage转为4的倍数,一次下拉加载40条
const firstPage = centerPage - 2;
this.firstPage =
firstPage % 4 == 0 ? firstPage : firstPage - (firstPage % 4);
this.currentPage = centerPage + 2;
break;
}
}
},
getData() {
getHomeUserSchedule1({
startTime: "2020-01-01 00:00:00",
endTime: "2025-12-30 23:59:59"
}).then(res => {
this.getScheduleList(res.data.data);
});
},
//生成DateMap值
setDateMapValue(startTime, endTime, item, type) {
const pushItem = {
endTime: endTime,
startTime: startTime,
planDate: getFormatDate(startTime, "yyyyMMdd", "-"),
thisDayStartTime: getFormatDate(startTime, "HH:mm"),
thisDayEndTime: getFormatDate(endTime, "HH:mm"),
confirmAttendance: item.confirmAttendance,
title: item.title,
id: item.id,
isBeOverdue: currentDate.getTime() > endTime.getTime() ? true : false
};
//模板会议id为空
if (type == "repeat") {
pushItem.scheduleTemplateId = item.id;
pushItem.id = "";
}
// 如果是跨天会议,需要手动在起始天以后的其他天 添加会议日程
const nextDateList = getNextDateList(startTime, endTime); //返回日期包括起始天
if (nextDateList.length > 1) {
pushItem.isDaySpan = true;
pushItem.isFewDays = 1;
pushItem.isfirstDayOrEndDay = "0"; // 0 第一天,1中间的天,2结束的天
pushItem.duration = nextDateList.length;
for (let i = 1; i < nextDateList.length; i++) {
if (DateMap.has(nextDateList[i])) {
DateMap.get(nextDateList[i]).unshift({
...pushItem,
isFewDays: i + 1,
isfirstDayOrEndDay: nextDateList.length - 1 === i ? "2" : "1" // 0 第一天,1中间的天,2结束的天
});
}
}
}
if (DateMap.has(toLocaleDateString(startTime))) {
DateMap.get(toLocaleDateString(startTime)).push(pushItem);
}
},
// 根据接口返回数据生成填充DateMap
setDateMapByResponse(response) {
if (response) {
// 处理单次会议 scheduleList
const scheduleListWithTemplateId = [];
response.scheduleList.forEach(item => {
// 有scheduleTemplateId则是虚拟会议转成实体会议,需要替换rrule生成的模板会议
if (item.scheduleTemplateId) {
scheduleListWithTemplateId.push(item);
} else {
this.setDateMapValue(
new Date(item.startTime.replace(/-/g, "/")),
new Date(item.endTime.replace(/-/g, "/")),
item
);
}
});
// 处理重复会议 templateList
response.templateList.forEach(item => {
//日程会议
const itemScheduleList = scheduleListWithTemplateId.filter(
it => it.scheduleTemplateId == item.id
);
// 生成rrules规则
const initialTimeList = item.initialTime.split("-");
const startTimeList = item.startTime.split(":");
const DTSTART = `${initialTimeList[0]}${initialTimeList[1]}${initialTimeList[2]}T${startTimeList[0]}${startTimeList[1]}00Z`;
const rule = RRule.fromString(
`${item.recurrenceModel.recurrenceRule};DTSTART=${DTSTART}`
);
const setDateMapValueAll = (startTime, endTime, item) => {
//如果有日程会议则用日程会议替换
let replaceItem = [];
if (itemScheduleList.length > 0) {
replaceItem = itemScheduleList.filter(
it => it.planDate == getFormatDate(startTime, "yyyyMMdd", "-")
);
}
if (replaceItem.length > 0) {
this.setDateMapValue(
new Date(replaceItem[0].startTime.replace(/-/g, "/")),
new Date(replaceItem[0].endTime.replace(/-/g, "/")),
replaceItem[0]
);
} else {
this.setDateMapValue(startTime, endTime, item, "repeat");
}
};
// 需要剔除某一天
if (item.excludePlanDates) {
const excludeData = getExcludeDate(item.excludePlanDates.split(","));
rule.all().forEach(startTime => {
//修正时间(时间有8小时时差)
startTime.setHours(startTime.getHours() - 8);
// 生成结束时间
const endTime = new Date(startTime);
endTime.setMinutes(
endTime.getMinutes() + item.recurrenceModel.duration
);
// 剔除规则: 时间小于futureTime 时间不在单个排除日期里面
if (
startTime.getTime() < excludeData.minFutureTime &&
!excludeData.excludeDateList.includes(
getFormatDate(startTime, "yyyyMMdd", "-")
)
) {
setDateMapValueAll(startTime, endTime, item);
}
});
}
// 正常生成数据
else {
rule.all().forEach(startTime => {
//修正时间(时间有8小时时差)
startTime.setHours(startTime.getHours() - 8);
// 生成结束时间
const endTime = new Date(startTime);
endTime.setMinutes(
endTime.getMinutes() + item.recurrenceModel.duration
);
setDateMapValueAll(startTime, endTime, item);
});
}
});
}
},
//日程数据
getScheduleList(response, type) {
if (type == "once") {
this.setDateMapValue(response.startTime, response.endTime, response);
} else {
this.setDateMapByResponse(response);
}
// 取出DateMap的value值平铺到DateList
const DateList = [];
DateMap.forEach(function (value, key) {
const keyDate = new Date(key);
const year = keyDate.getFullYear();
const month = keyDate.getMonth();
const date = keyDate.getDate();
const day = keyDate.getDay();
// 生成年
if (month === 0 && date === 1) {
DateList.push({
type: "year",
value: year,
dateStr: `${year}`
});
}
//生成月
if (date === 1) {
DateList.push({
type: "month",
value: month + 1,
dateStr: `${year}/${month + 1}`
});
}
//生成周
if (day === 0) {
const rangeDate = new Date(year, month, date + 6);
const rangeMonth2 = new Date(rangeDate).getMonth();
const rangeDay2 = new Date(rangeDate).getDate();
DateList.push({
type: "week",
value: `第${getWeekNumber(year, month, date)}周,${month +
1}${date}日 - ${
rangeMonth2 == month ? "" : rangeMonth2 + 1 + "月"
}${rangeDay2}日`,
dateStr: `${year}/${month + 1}/${date}-week`
});
}
// 有日程长度
if (value.length !== 0) {
value.forEach((item, index) => {
if (index === 0) {
DateList.push({
type: key !== toLocaleDateString(currentDate) ? "day" : "today",
week: weekList[day],
hasDateLabel: padZero(date),
value: item,
dateStr: `${key}`
});
} else {
DateList.push({
type: "day",
value: item,
dateStr: `${key}/${item.id || item.scheduleTemplateId}`
});
}
});
} else if (
value.length === 0 &&
key === toLocaleDateString(currentDate)
) {
DateList.push({
type: "thisday",
value: "",
hasDateLabel: padZero(date),
week: weekList[day],
dateStr: key
});
}
});
this.scheduleList = DateList;
this.getPagination(this.scheduleList);
// 第一次加载
this.setData({
scheduleList: this.scheduleList.slice(
this.firstPage * this.pageSize,
this.currentPage * this.pageSize
),
loading: false
});
},
//日程上拉加载
lower() {
if (this.currentPage < this.totalPages) {
this.currentPage++;
this.setData({
scheduleList: this.scheduleList.slice(
this.firstPage * this.pageSize,
this.currentPage * this.pageSize
)
});
} else {
//超出加载一年的数据
this.maxYear++;
const yearData = getBlankList(this.maxYear);
this.blankDataLengthAfter += yearData.length;
this.scheduleList.push(...yearData);
this.setData({
scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize)
});
}
},
onPullDownRefresh() {
if (this.$store.data.tabBarIndex == "0") {
this.getPages(1);
dd.stopPullDownRefresh();
return;
}
//日程页面到顶部的时候才下拉加载数据,否则定位距离太长
if (this.$store.data.tabBarIndex == "1" && this.scrollTop !== 0) {
dd.stopPullDownRefresh();
return;
}
// const todayStr = this.data.scheduleList[0].dateStr;
if (this.firstPage > 0) {
this.firstPage -= 4;
this.currentPage -= 4;
this.setData(
{
todayStr: "",
scheduleList: this.scheduleList.slice(
this.firstPage * this.pageSize,
this.currentPage * this.pageSize
)
},
() => {
this.setData({
todayStr: this.data.scheduleList[this.pageSize * 4 - 1].dateStr
});
dd.stopPullDownRefresh();
}
);
} else {
this.minYear--;
const yearData = getBlankList(this.minYear);
this.blankDataLength += yearData.length;
this.todayIndex += yearData.length;
this.scheduleList.unshift(...yearData);
this.totalPages = Math.ceil(this.scheduleList.length / this.pageSize);
this.currentPage = Math.floor((yearData.length * 2) / this.pageSize);
this.setData(
{
todayStr: "",
scheduleList: this.scheduleList.slice(0, yearData.length * 2)
},
() => {
this.setData({
//加载一年的数据重定位可能会有点问题,重置一下
currentData: this.scheduleList[yearData.length - 1].dateStr,
currentDataIndex: yearData.length - 1,
todayStr: this.scheduleList[yearData.length - 1].dateStr
});
dd.stopPullDownRefresh();
}
);
}
},
scroll(e) {
// 一次性惯性拉到顶速度跟不上,重置
if (e.detail.scrollTop == 0) {
this.setData({
currentData: this.data.scheduleList[0].dateStr,
currentDataIndex: 0
});
}
//每次计算偏移值
const offset = this.getScrollOffset(e.detail.scrollTop);
dd.createSelectorQuery().selectAll('.li').boundingClientRect().exec((rect) => {
//日程的上下箭头
if (rect[0]) {
this.setScrollOffset(rect);
}
if (offset == 'next') {
for (let i = this.data.currentDataIndex; i < rect[0].length; i++) {
if (rect[0][i].top > 0) {
if (this.data.scheduleList[i].dateStr.split('/')[1] !== this.data.currentData.split('/')[1]) {
this.setData({
currentData: this.data.scheduleList[i].dateStr,
currentDataIndex: i
})
}
break;
}
}
} else if (offset == "before") {
let i = Math.min(this.data.currentDataIndex, this.data.scheduleList.length - 1);
for (; i > 0; i--) {
if (rect[0][i].top < 50) {
if (this.data.scheduleList[i].dateStr.split("/")[1] !== this.data.currentData.split("/")[1]) {
this.setData({
currentData: this.data.scheduleList[i].dateStr,
currentDataIndex: i
});
}
break;
}
}
}
});
},
//判断滚动方向
getScrollOffset(scrollTop) {
let offset = "stop";
if (scrollTop > this.scrollTop) {
//向下滚动
offset = "next";
} else {
//向上滚动
offset = "before";
}
this.scrollTop = scrollTop;
return offset;
},
setScrollOffset(rect) {
if (rect[0][this.todayIndex]) {
if (rect[0][this.todayIndex].top <= 60 && rect[0][this.todayIndex].top >= 30) {
if (this.data.offset !== 'stop') {
this.setData({ offset: 'stop' })
}
} else if (rect[0][this.todayIndex].top < 60) {
if (this.data.offset !== 'next') {
this.setData({ offset: 'next' })
}
} else if (rect[0][this.todayIndex].top > 30) {
if (this.data.offset !== 'before') {
this.setData({ offset: 'before' })
}
}
} else {
if (this.data.offset !== 'before') {
this.setData({ offset: 'before' })
}
}
},
closePop() {
this.setData({
show: false
});
},
changesidebar() {
this.setData({
show: true
});
},
createMeeting() {
dd.navigateTo({ url: "./../createMeeting/createMeeting" });
},
nextDetail: throttle(function (e) {
dd.navigateTo({
url: `./../meetingDetail/meetingDetail?scheduleItem=${encodeURIComponent(
JSON.stringify(e.target.dataset.item)
)}`
});
}, 1000),
backToToday(type) {
if (!type) {
//如果当前的日期还没加载出来点击无效
const isFindArr = this.data.scheduleList.filter(it => it.dateStr == toLocaleDateString(currentDate));
if (isFindArr.length == 0) {
//去掉头部空数据
if (this.minYear < minYear) {
this.scheduleList.splice(0, this.blankDataLength);
this.minYear = minYear;
}
//去掉尾部数据
if (this.maxYear > maxYear) {
this.scheduleList.splice(-this.blankDataLengthAfter);
this.maxYear = maxYear;
}
this.getPagination(this.scheduleList);
this.setData({
scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize, this.currentPage * this.pageSize)
});
}
}
//需要先清空todayStr再设置才有效
this.setData(
{
todayStr: ""
},
() => {
this.setData({
todayStr: toLocaleDateString(currentDate)
});
}
);
},
// 修改tabBar
changeTabBar(e) {
const { tabbar, title } = e.currentTarget.dataset;
const lastTimeTabBarIndex = this.$store.data.tabBarIndex;
this.$store.data.tabBarIndex = tabbar;
this.update();
dd.setNavigationBar({
title: title
});
if (this.isFirstLoad) {
this.backToToday("first");
this.isFirstLoad = false;
}
if (lastTimeTabBarIndex == tabbar) {
if (tabbar == "1") {
this.backToToday();
}
} else {
//切换到动态页面时,日程重置成当前日期
if (tabbar == "0") {
this.lastOffset = this.data.offset;
this.setData({
offset: 'stop'
})
} else if (!this.isFirstLoad) {
this.setData({
offset: this.lastOffset
})
}
}
},
onTitleClick() {
maxClickCount--;
if (maxClickCount == 0) {
dd.alert({
content: "版本号199"
});
maxClickCount = 5;
}
}
});
......@@ -21,7 +21,6 @@ class Store {
relatedAppNeedUpdate: false,
}
resetData() {
this.data.indexNeedUpdate = false;
this.data.roomId = ''
this.data.participatorList = []
this.data.participatorUserId = []
......@@ -32,8 +31,6 @@ class Store {
this.update();
}
resetEditData() {
this.data.onceMeetingContent = null
this.data.indexNeedUpdate = false;
this.data.roomId = ''
this.data.participatorList = []
this.data.originUsers = []
......
let flatTreeMap = new Map()
export function getFlatTree(treeData) {
for (let value of treeData) {
if (value.children.length) {
flatTreeMap.set(value.id, value)
getFlatTree(value.children)
} else {
flatTreeMap.set(value.id, value)
}
}
console.log(flatTreeMap)
return flatTreeMap
}
\ No newline at end of file
......@@ -2,10 +2,10 @@
# yarn lockfile v1
dd-store@^1.8.4:
version "1.8.4"
resolved "https://registry.yarnpkg.com/dd-store/-/dd-store-1.8.4.tgz#6a8e58d4f8acf60259f7357caf0d5c6e74e5f8ef"
integrity sha512-UKA9nrW5biJ1Pt7c4fKtFZ+4cgLyWuBMHao7PDigbUkVBug6aXDB5VvCZHqwDwf2ofiOa7e9wp5C1OVNaUEDzA==
dd-store@^1.9.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/dd-store/-/dd-store-1.9.0.tgz#8f531e28b6991919bc60a17148fa9e1bba142397"
integrity sha512-bhIkQMcHjNTDGG03riSeLp4UfdOBqWqg+qFfqqwAvgBiARrYbrEWU/YVE5tOV6XOqyfozp+MpZP3SaFyOtuUrw==
luxon@^1.21.3:
version "1.22.2"
......
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