Commit 91dd8c3a by xiexiaoqin

fix:conflit

parents 153cf0a3 a788256f
......@@ -21,6 +21,7 @@
"pages/participantsDetail/participantsDetail",
"pages/createOrEditSchedule/createOrEditSchedule",
"pages/applicationDetails/applicationDetails",
"pages/attendeeList/attendeeList"
"pages/attendeeList/attendeeList",
"pages/scheduleList/scheduleList"
]
}
\ No newline at end of file
.popupWindow {
height: 100%;
width: 100%;
position: fixed;
top: 0;
background: rgba(0, 0, 0, 0.12)
}
.popupWindowCenter {
width: 587rpx;
left: 50%;
margin-left: -293rpx;
height: auto;
position: absolute;
border-radius: 10rpx;
top: 400rpx;
background: #fff;
}
.list {
height: 96rpx;
text-align: center;
line-height: 96rpx;
text-align: center;
border-bottom: 1rpx solid rgba(25, 31, 37, 0.12);
}
.list:nth-child(2) {
color: #3296FA;
}
.listBg {
position: fixed;
top: 0;
height: 100%;
width: 100%;
background: rgba(0, 0, 0, 0.12);
font-family: 'PingFangSC-Regular';
font-size: 40rpx;
color: #191F25;
text-align: center;
z-index: 9999;
}
.listContent {
padding: 0 20rpx;
position: fixed;
bottom: 18rpx;
width: 710rpx;
}
.listItemCont {
background: #FFFFFF;
border-radius: 26rpx;
width: 100%;
}
.listItem {
height: 112rpx;
line-height: 112rpx;
border-bottom: 1rpx solid rgba(25, 31, 37, 0.12);
}
.listItem:last-child {
border: none;
}
\ No newline at end of file
<view class="popupWindow" a:if="{{centerPopup}}">
<view class="popupWindowCenter">
<view class="list" a:for="{{popupWindowList}}" onTap="selectSend" data-item="{{item}}">
{{item.text}}
</view>
</view>
</view>
\ No newline at end of file
Component({
mixins: [],
data: {},
props: {},
didMount() {},
didUpdate() {},
didUnmount() {},
methods: {},
});
{
"component": true
}
\ No newline at end of file
......@@ -34,9 +34,18 @@
.com-list .com-list-item-select {
color: #3070F2;
}
.com-list-item-image>image {
width: 46rpx;
height: 46rpx;
vertical-align: top;
margin-right: 34rpx;
}
.compelete {
position: absolute;
color: rgb(10, 10, 10);
font-size: 32rpx;
right: 32rpx;
top: 32rpx;
}
\ No newline at end of file
{{comSelectList}}
<view class="com-list">
<view class="picker-complete" onTap='complete' a:if="{{complete}}" onTap='complete'>完成</view>
<view class=" com-list-item" catchTap="comSelectList" data-item="{{item}}" a:for="{{dataComList}}">
<view class="iconfont {{item.icon}}" a:if="{{iconType === 'icon'}}">
</view>
......@@ -8,7 +10,9 @@
<view class="com-list-item-text">
{{item.text}}
</view>
<view class="iconfont iconicon_ok com-list-item-selectStaus {{comSelectListId == item.id ? 'com-list-item-select' : ''}}">
<view a:if="{{!multiple}}" class="iconfont iconicon_ok com-list-item-selectStaus {{comSelectListId == item.id ? 'com-list-item-select' : ''}}">
</view>
<view a:if="{{multiple}}" class="iconfont iconicon_ok com-list-item-selectStaus {{comSelectList.includes(item.id) ? 'com-list-item-select' : ''}}">
</view>
</view>
</view>
\ No newline at end of file
Component({
mixins: [],
data: {
comSelectListId: ''
comSelectListId: 0,
comSelectList: []
},
props: {
iconType: 'icon'
iconType: 'icon',
complete: false,
multiple: false,
},
didMount() {
console.log(this.props.comSelectListId)
this.setData({
comSelectListId: this.props.comSelectListId
comSelectListId: this.props.comSelectListId,
comSelectList: this.props.comSelectList
})
},
didUpdate() {
......@@ -20,10 +24,40 @@ Component({
didUnmount() { },
methods: {
comSelectList(event) {
this.setData({
comSelectListId: event.currentTarget.dataset.item.id
if (this.props.multiple && event.currentTarget.dataset.item.id != -1) {
if (this.data.comSelectList.includes(event.target.dataset.item.id)) {
this.data.comSelectList.forEach((item, index) => {
if (item == event.target.dataset.item.id) {
this.data.comSelectList.splice(index, 1)
}
return
})
}
else {
this.data.comSelectList.push(event.target.dataset.item.id)
}
this.setData({
comSelectList: this.data.comSelectList
})
} else if (this.props.multiple && event.currentTarget.dataset.item.id == -1) {
this.setData({
comSelectList: []
})
}
else if (!this.props.multiple) {
this.setData({
comSelectListId: event.currentTarget.dataset.item.id
})
this.props.onComSelectList(event)
}
console.log(this.data.comSelectList)
},
complete(event) {
let comSelectList = this.data.comSelectList.sort((a, b) => {
return a - b
})
this.props.onComSelectList(event)
this.props.onCompelete(comSelectList)
}
},
});
......@@ -87,4 +87,14 @@
font-size: 32rpx;
right: 32rpx;
top: 32rpx;
}
\ No newline at end of file
}
/* =======
.popupComplet {
display: inline-block;
float: right;
height: 100%;
line-height: 64rpx;
margin-right: 32rpx;
>>>>>>> Stashed changes
} */
\ No newline at end of file
<view
class="dm-popup {{show ? 'dm-popup-show' : ''}} {{ animation ? 'animation': '' }}"
disable-scroll="{{disableScroll}}"
>
<view
class="dm-popup-mask"
a:if="{{mask}}"
onTap="onMaskTap"
style="z-index: {{zIndex}}"
></view>
<view
class="dm-popup-content {{className}} dm-popup-{{position}}"
style="z-index: {{zIndex}}"
>
<view a:if="{{position == 'bottom'}}" class="close-icon">
<text onTap="onMaskTap" class="iconfont iconicon_slide"></text>
</view>
<view class="popup-title" a:if="{{title}}">{{title}}</view>
<slot/>
<view class="dm-popup {{show ? 'dm-popup-show' : ''}} {{ animation ? 'animation': '' }}" disable-scroll="{{disableScroll}}">
<view class="dm-popup-mask" a:if="{{mask}}" onTap="onMaskTap" style="z-index: {{zIndex}}"></view>
<view class="dm-popup-content {{className}} dm-popup-{{position}}" style="z-index: {{zIndex}}">
<view a:if="{{position == 'bottom'}}" class="close-icon">
<text onTap="onMaskTap" class="iconfont iconicon_slide"></text>
<!--<text class="popupComplet">完成</text> -->
</view>
<view class="popup-title" a:if="{{title}}">{{title}}</view>
<slot/>
</view>
</view>
\ No newline at end of file
......@@ -10,13 +10,19 @@ Component({
},
didMount() {
setTimeout(res => {
}, this.props.duration)
},
didUpdate(preProps, prevData) {
if (this.props.showToast) {
setTimeout(res => {
this.hide()
}, this.props.duration)
}
},
didUnmount() { },
methods: {
hide() {
this.props.onToastHidden()
}
},
});
......@@ -7,7 +7,7 @@
</view>
</view>
<view class="remark" a:if="{{isShowRemark}}">
<input placeholder-class="placeholder" placeholder="请添加描述" class="text" onInput="onInput" data-type="remark" />
<input placeholder-class="placeholder" placeholder="请添加描述" class="text" onInput="onInput" data-type="remark" value="{{remark}}" />
</view>
</view>
<!-- roomId locationName 地点 -->
......@@ -68,7 +68,7 @@
{{conflictPeople.length}}人会议安排冲突
</view>
</view>
<view class="iconicon_open iconfont icon" style=" vertical-align: middle" catchTap="nextPage" data-nextPage="participantsDetail"></view>
<view class="iconicon_open iconfont icon" style=" vertical-align: middle" catchTap="nextPage" data-nextPage="participantsDetail"></view>
</view>
<view class="participatorListBottom">
<view class="people" a:for="{{participatorList.length > 10 ? [...participatorList].splice(0, 11) : participatorList}}">
......
......@@ -48,7 +48,7 @@ create.Page({
conflictPeople: []
},
showPop() {
showPop(event) {
this.setData({
show: true
})
......@@ -79,11 +79,6 @@ create.Page({
// 添加描述
addRemark() {
let isShowRemark = !this.data.isShowRemark
if (!isShowRemark) {
this.setData({
remark: ''
})
}
this.setData({
isShowRemark: isShowRemark
})
......@@ -152,19 +147,25 @@ create.Page({
// 选择循环机制 选择会议方式 选择时间 出现popup弹窗
showPopup(event) {
let iconType = ''
let popupTitle = ''
switch (event.currentTarget.dataset.type) {
case 'meetingWayModel':
iconType = 'image'
popupTitle = '选择会议方式'
break
case 'repeat':
iconType = 'icon'
popupTitle = '会议重复'
break
case 'participator':
popupTitle = '选择参会人'
break
case 'time':
popupTitle = '选择会议时间'
break
}
this.setData({
popupTitle: popupTitle,
popupShow: true,
comType: event.currentTarget.dataset.type,
'comListData.iconType': iconType
......@@ -215,7 +216,6 @@ create.Page({
},
// 选择完水平 HList 的回调
selectComHList(event) {
console.log(event)
switch (event.currentTarget.dataset.item.id) {
case 0:
this.addParticipator()
......@@ -319,7 +319,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 }],
participatorList: !!this.store.data.participatorList.length ? this.store.data.participatorList : [{ userId: getApp().globalData.userid, username: getApp().globalData.name, headUrl: getApp().globalData.avatar, platform: 'dingtalk' }],
repeatable: this.data.repeatable,
remark: this.data.remark,
recurrenceModel: this.data.recurrenceModel,
......
......@@ -296,10 +296,32 @@ input {
color: #1B263D;
}
.remindTime {
.remind>text {
display: inline-block;
vertical-align: top;
}
.remindTimeContaint {
display: inline-block;
max-width: 400rpx;
overflow: scroll;
white-space: nowrap;
margin: 0 20rpx;
text-align: center;
}
.remindTimeContaint>text {
margin: 0 8rpx;
}
.noRemind {
margin: 0 20rpx;
}
.remindTime {
margin-right: 4rpx;
}
.participate>text {
margin-right: 10rpx;
color: #15BC83;
......
......@@ -12,12 +12,12 @@
<!-- title remark 标题 描述 -->
<view class="createTitle">
<view class="title">
<input placeholder-class="placeholder" placeholder="请输入主题" class="text" focus="{{true}}" onInput="onInput" data-type="title" value="{{title}}" />
<input placeholder-class="placeholder" placeholder="请输入主题" class="text" onInput="onInput" data-type="title" data-selectType="common" value="{{title}}" onBlur="onBlur" />
<view class="icon iconfont iconicon_description" onTap="addRemark">
</view>
</view>
<view class="remark" a:if="{{isShowRemark}}">
<input placeholder-class="placeholder" placeholder="请添加描述" class="text" onInput="onInput" data-type="remark" value="{{remark}}" />
<input placeholder-class="placeholder" placeholder="请添加描述" class="text" onInput="onInput" data-type="remark" value="{{remark}}" onBlur="onBlur" />
</view>
</view>
<!-- roomId locationName 地点 -->
......@@ -114,7 +114,7 @@
</view>
</view>
<!-- 删除该会议 -->
<view class="delMetting">
<view class="delMetting" onTap="delSheudle">
<view class=" iconfont iconicon_close">
</view>
<view>
......@@ -124,26 +124,48 @@
<popup title="{{popupTitle}}" show="{{popupShow}}" mask="true" onClose="closePopup">
<meeting-time-picker a:if="{{'time' === comType}}" onComplete="onComplete"></meeting-time-picker>
<hlist a:if="{{'participator' === comType}}" dataComList="{{comHListData.contactData}}" onSelectComHList="selectComHList"></hlist>
<list a:if="{{comType=='repeat' || comType=='meetingWayModel'}}" dataComList="{{comType=='repeat' ? comListData.repeatList : comListData.meetingWayList}}" onComSelectList="selectComList" comSelectListId="{{comType=='repeat' ? comListData.comSelectListId : comListData.meetingWayModelId}}" iconType="{{comListData.iconType}}">
<list multiple="{{comListData.multiple}}" onCompelete="selectAheadtimes" comSelectList={{aheadTimes}} complete="{{comType=='aheadTime' ? true : false}}"a:if="{{comType=='repeat' || comType=='meetingWayModel' || comType=='aheadTime'}}" dataComList="{{comType=='repeat' ? comListData.repeatList : (comType=='aheadTime' ? comListData.aheadTimesList : comListData.meetingWayList)}}" onComSelectList="selectComList" comSelectListId="{{comType=='repeat' ? comListData.comSelectListId : (comType=='aheadTime'?comListData.aheadTimesListId : comListData.meetingWayModelId)}}" iconType="{{comListData.iconType}}">
</list>
</popup>
</view>
<!-- 底部导航栏 -->
<view class="footNav">
<view class="footNavTop">
<view class="originStaus"><view><text class="iconfont iconicon_share"></text><text>参加</text></view><text class="line">|</text><view><text class="iconfont iconicon_share"></text><text>不参加</text></view></view>
<!-- <view class="participateStatus"><view class="remind"><text class="iconfont iconicon_share"></text><text class="remindTime">提前15分钟提醒</text><text class="iconfont iconicon_share"></text></view><text class="line">|</text><view class="participate"><text class="iconfont iconicon_share"></text><text>参加</text></view></view> -->
<!-- <view class="noParticipateStatus">
<view class="originStaus" a:if="{{confirmAttendance === null}}">
<view catchTap="participate">
<text class="iconfont iconicon_share"></text>
<text>参加</text></view>
<text class="line">|</text>
<view catchTap="noParticipate">
<text class="iconfont iconicon_share"></text>
<text>不参加</text>
</view>
</view>
<view class="participateStatus" a:if="{{confirmAttendance === 1}}">
<view class="remind" catchTap="showPopup" data-type="aheadTime">
<text class="iconfont iconicon_share"></text>
<text class="remindTimeContaint" a:if="{{aheadTimes.length}}">
<text class="remindTime" a:for="{{comListData.aheadTimesList}}" a:if="{{aheadTimes.includes(item.id)}}">
{{item.text}}
</text>
</text>
<text class="noRemind" a:if="{{!aheadTimes.length}}">不提醒</text>
<text class="iconfont iconicon_share"></text></view>
<text class="line">|</text>
<view class="participate" catchTap="noParticipate">
<text class="iconfont iconicon_share"></text>
<text>参加</text></view></view>
<view class="noParticipateStatus" a:if="{{confirmAttendance === 0}}" catchTap="participate">
<text class="iconfont iconicon_share"></text>
<text>不参加</text>
</view> -->
</view>
</view>
<view class="footNavBottom">
<view class="iconfont iconicon_share" onTap="uploadFile">
<view class="iconfont iconicon_data" onTap="uploadFile">
</view>
<view class="iconfont iconicon_task">
<view class="iconfont iconicon_task1">
</view>
</view>
</view>
<toast showToast="{{showToast}}" onToastHidden=" onToastHidden"></toast>
<selectpopup showSelectPopup="{{conSelectPopupData.showSelectPopup}}" selectPopupList="{{conSelectPopupData.editSaveList}}" onSelectPopup="onSelectPopup" onSelectPopupCancel="onSelectPopupCancel"></selectpopup>
<toast showToast="{{conToastData.showToast}}" onToastHidden="onToastHidden"></toast>
<selectpopup showSelectPopup="{{conSelectPopupData.showSelectPopup}}" selectPopupList="{{conSelectPopupData.selectType==='noParticipateStatus' ? conSelectPopupData.noParticipateStatusList : conSelectPopupData.selectType==='delSheudle' ? conSelectPopupData.delSheudleList : (conSelectPopupData.selectType === 'participateStatus' ? conSelectPopupData.participateStatusList : conSelectPopupData.editSaveList)}}" onSelectPopup="onSelectPopup" onSelectPopupCancel="onSelectPopupCancel"></selectpopup>
\ No newline at end of file
import { getScheduleDetail, getUserScheduleInTime, uploadPermissions } from '../../api/request.js'
import { isParticipate, deleteSchedule, getScheduleDetail, getUserScheduleInTime, uploadPermissions, modifySchedule } from '../../api/request.js'
import { throttle } from './../../utils/utils.js'
import create from 'dd-store'
import exampleStore from '/stores/exampleStore'
......@@ -20,6 +20,20 @@ create.Page({
{ id: 1, text: 'Zoom Meeting', imageUrl: '../../assests/Zoom.png', meetingWayModel: { model: 'zoom' } },
{ id: 2, text: '钉钉', imageUrl: '../../assests/dingding.png', meetingWayModel: { model: 'dingtalk' } }
],
aheadTimesList: [
{ id: -1, text: '不提醒', icon: 'iconicon_cycle' },
{ id: 0, text: '会议开始时提醒', icon: '' },
{ id: 5, text: '提前5分钟提醒', icon: '' },
{ id: 15, text: '提前15分钟提醒', icon: '' },
{ id: 30, text: '提前30分钟提醒', icon: '' },
{ id: 60, text: '提前一小时提醒', icon: '' },
{ id: 120, text: '提前二小时提醒', icon: '' },
{ id: 1440, text: '提前一天提醒', icon: '' },
{ id: 105120, text: '提前一周提醒', icon: '' }
],
multiple: false,
complete: false,
aheadTimesListId: [-1],
comSelectListId: 0,
meetingWayModelId: null,
iconType: 'icon'
......@@ -37,8 +51,12 @@ create.Page({
},
// 传递给组件selectPopup 的数据
conSelectPopupData: {
showSelectPopup: true,
editSaveList: [{text: '仅接受此会议', id: 'only'},{text: '接受所有会议', id: 'all'}]
showSelectPopup: false,
selectType: 'common',
editSaveList: [{ text: '仅保存此会议', id: 'only' }, { text: '保存此次及以后会议', id: 'future' }],
delSheudleList: [{ text: '仅删除此会议', id: 'only' }, { text: '删除此次及以后会议', id: 'future' }],
participateStatusList: [{ text: '仅参加此次会议', id: 'only' }, { text: '参加所有会议', id: 'all' }],
noParticipateStatusList: [{ text: '不参加此次会议', id: 'only' }, { text: '不参加所有会议', id: 'all' }]
},
title: ``,
repeatable: 0,
......@@ -56,7 +74,13 @@ create.Page({
conflictPeople: [],
isAcrossDay: false,
scheduleItem: '',
originalData: new Map()
originalData: new Map(),
lock: false,
originUsers: [],
aheadTimes: [],
organizer: '',
editType: '',
confirmAttendance: null
},
showPop() {
......@@ -74,11 +98,12 @@ create.Page({
this.closePop();
},
onLoad(event) {
this.reset()
dd.setNavigationBar({
title: `会议详情`
})
this.setData({
scheduleItem: JSON.parse(event.scheduleItem)
scheduleItem: JSON.parse(event.scheduleItem),
})
this.getDetail()
},
......@@ -92,9 +117,13 @@ create.Page({
getScheduleDetail(data).then(res => {
if (res.data.code === 0) {
let participatorList = []
let originUsers = []
let participatorUserId = []
let repeatListMap = new Map()
for (let value of res.data.data.userList) {
participatorList.push(value.participator)
participatorUserId.push(value.participator.userId)
originUsers.push(value.participator)
}
for (let item of this.data.comListData.repeatList) {
if (item.recurrenceModel.recurrenceModel !== 'weekly') {
......@@ -103,22 +132,31 @@ create.Page({
}
// console.log(repeatListMap, 111)
this.setData({
'scheduleItem.id': res.data.data.id,
'comListData.comSelectListId': res.data.data.recurrenceModel.model === 'weekly' ? (res.data.data.recurrenceModel.weekDayList.length > 1 ? 3 : 2) : repeatListMap.get(res.data.data.recurrenceModel.model),
confirmAttendance: res.data.data.confirmAttendance,
organizer: res.data.data.organizer,
originUsers: originUsers,
'comListData.meetingWayModelId': res.data.data.meetingWayModel === 'dingtalk' ? 2 : (res.data.data.meetingWayModel === 'zoom' ? 1 : 0),
repeatable: res.data.repeatable,
recurrenceModel: res.data.repeatable ? { model: res.data.data.recurrenceModel.model, daysOfMonth: res.data.data.recurrenceModel.daysOfMonth, interval: 1, initialTime: res.data.data.initialTime, terminateTime: res.data.data.terminateTime, weekDayList: res.data.data.weekDayList } : { model: 'no_repeat' },
'scheduleItem.id': res.data.data.id,
'scheduleItem.groupId': res.data.data.groupId,
repeatable: res.data.data.repeatable,
recurrenceModel: res.data.data.repeatable ? { model: res.data.data.recurrenceModel.model, daysOfMonth: res.data.data.recurrenceModel.daysOfMonth, interval: 1, initialTime: res.data.data.recurrenceModel.initialTime, terminateTime: res.data.data.recurrenceModel.terminateTime, weekDayList: res.data.data.recurrenceModel.weekDayList } : { model: 'no_repeat' },
originalData: res.data.data,
title: res.data.data.title,
remark: res.data.data.remark,
isShowRemark: res.data.data.remark ? true : false,
week: this.data.weekList[new Date(res.data.data.startTime.replace(/'-'/g, "\/")).getDay()]
})
if (res.data.data.repeatable) {
this.setData({
'comListData.comSelectListId': res.data.data.recurrenceModel.model === 'weekly' ? (res.data.data.recurrenceModel.weekDayList.length > 1 ? 3 : 2) : repeatListMap.get(res.data.data.recurrenceModel.model),
})
}
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.startTime = res.data.data.startTime.replace(/'-'/g, "\/")
this.store.data.endTime = res.data.data.endTime.replace(/'-'/g, "\/")
this.store.data.participatorList = participatorList
this.store.data.participatorUserId = participatorUserId
this.update()
this.conflictPeople()
console.log(res.data.data)
......@@ -128,11 +166,6 @@ create.Page({
// 添加描述
addRemark() {
let isShowRemark = !this.data.isShowRemark
if (!isShowRemark) {
this.setData({
remark: ''
})
}
this.setData({
isShowRemark: isShowRemark
})
......@@ -154,6 +187,34 @@ create.Page({
break
}
},
// 输入框失去焦点
onBlur(event) {
this.setData({
'conSelectPopupData.selectType': 'common'
})
switch (event.target.dataset.type) {
case 'title':
if (this.data.repeatable) {
this.setData({
'conSelectPopupData.showSelectPopup': true,
editType: 'title'
})
} else {
this.isChange('title', 'only')
}
break
case 'remark':
if (this.data.repeatable) {
this.setData({
'conSelectPopupData.showSelectPopup': true,
editType: 'remark'
})
} else {
this.isChange('remark', 'only')
}
break
}
},
// 初始化
reset() {
this.store.data.roomId = ''
......@@ -170,7 +231,7 @@ create.Page({
nextPage(event) {
switch (event.target.dataset.nextPage) {
case 'location':
dd.navigateTo({ url: './../place/place' })
dd.navigateTo({ url: `./../place/place?scheduleItem=${JSON.stringify(this.data.scheduleItem)}` })
break
case 'participantsDetail':
dd.navigateTo({ url: `./../participantsDetail/participantsDetail?scheduleItem=${JSON.stringify(this.data.scheduleItem)}` })
......@@ -201,22 +262,36 @@ create.Page({
// 选择循环机制 选择会议方式 选择时间 出现popup弹窗
showPopup(event) {
let iconType = ''
let complete = false
let multiple = false
switch (event.currentTarget.dataset.type) {
case 'meetingWayModel':
iconType = 'image'
iconType = 'image',
complete = true
multiple = false
break
case 'repeat':
iconType = 'icon'
iconType = 'icon',
complete = true,
multiple = false
break
case 'participator':
break
case 'time':
break
case 'aheadTime':
iconType = 'icon',
complete = true,
multiple = true
break
}
this.setData({
popupShow: true,
comType: event.currentTarget.dataset.type,
'comListData.iconType': iconType
'comListData.complete': complete,
'comListData.iconType': iconType,
'comListData.multiple': multiple
})
},
resetRepeatList() {
......@@ -276,7 +351,7 @@ create.Page({
this.setData({
popupShow: false
})
dd.navigateTo({ url: './../outLookContact/outLookContact' })
dd.navigateTo({ url: `./../outLookContact/outLookContact?scheduleItem=${this.data.scheduleItem}` })
break;
}
},
......@@ -294,8 +369,13 @@ create.Page({
const _that = this
let require = []
let select = []
select = this.store.data.participatorUserId
require = [getApp().globalData.userid]
if (this.data.organizer === getApp().globalData.userid) {
select = [...this.store.data.participatorUserId]
require = [getApp().globalData.userid]
} else {
select = []
require = [...this.store.data.participatorUserId]
}
select = _that.selectedelRequired(require, select).pickedUsers
dd.complexChoose({
title: "选择参会人", //标题
......@@ -304,38 +384,36 @@ create.Page({
requiredUsers: require, //必选用户(不可取消选中状态)
responseUserOnly: true, //返回人,或者返回人和部门
success: function (res) {
_that.store.data.participatorList = []
_that.store.data.participatorUserId = []
_that.store.data.participatorList.push({ userId: getApp().globalData.userid, username: getApp().globalData.name, headUrl: getApp().globalData.avatar, platform: 'dingtalk' })
_that.store.data.participatorUserId.push(getApp().globalData.userid)
res.users.forEach((item, index) => {
_that.store.data.participatorList.push({ userId: item.userId, username: item.name, headUrl: item.avatar, platform: 'dingtalk' })
_that.store.data.participatorUserId.push(item.userId)
})
if (_that.data.organizer === getApp().globalData.userid) {
_that.store.data.participatorList = []
_that.store.data.participatorUserId = []
_that.store.data.participatorList.push({ userId: getApp().globalData.userid, username: getApp().globalData.name, headUrl: getApp().globalData.avatar, platform: 'dingtalk' })
_that.store.data.participatorUserId.push(getApp().globalData.userid)
res.users.forEach((item, index) => {
_that.store.data.participatorList.push({ userId: item.userId, username: item.name, headUrl: item.avatar })
_that.store.data.participatorUserId.push(item.userId)
})
} else {
_that.store.data.participatorList = []
_that.store.data.participatorUserId = []
_that.data.requireUsersInfo.forEach((item, index) => {
_that.store.data.participatorList.push({ userId: item.userId, username: item.username, headUrl: item.headUrl, platform: 'dingtalk' })
_that.store.data.participatorUserId.push(item.userId)
})
res.users.forEach((item, index) => {
_that.store.data.participatorList.push({ userId: item.userId, username: item.name, headUrl: item.avatar, platform: 'dingtalk' })
_that.store.data.participatorUserId.push(item.userId)
})
}
_that.store.data.participatorList = _that.setArrary(_that.store.data.participatorList)
_that.store.data.participatorUserId = [...new Set(_that.store.data.participatorUserId)]
_that.update()
_that.conflictPeople()
},
fail: function (err) {
}
})
},
// 已选用户去中去掉必选用户
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
}
},
// 数组 去重
setArrary(arr) {
let containt = {}
......@@ -354,30 +432,50 @@ create.Page({
popupShow: false
})
},
addSchedule() {
// 选择会前提醒时间
selectAheadtimes(event) {
this.setData({
aheadTimes: event,
popupShow: false
})
},
// 保存编辑
modifySchedule(modifyContent, modifyModel) {
let participatorList = this.arrayPoor(this.data.originUsers, this.store.data.participatorList)
let data = {
modifyContent: modifyContent,
shcheduleType: 'common',
deleteUserList: participatorList.deleteUserList,
addUserList: participatorList.addUserList,
modifyModel: modifyModel,
planDate: this.data.scheduleItem.planDate,
title: this.data.title || `${getApp().globalData.name}创建的会议`,
scheduleId: this.data.scheduleItem.id,
templateId: this.data.scheduleItem.scheduleTemplateId,
location: {
longitude: '10',
latitude: '10',
locationName: this.store.data.locationName
locationName: this.store.data.locationName || ''
},
startTime: this.store.data.startTime.replace(/\//g, "-"),
endTime: this.store.data.endTime.replace(/\//g, "-"),
meetingRoomId: this.store.data.roomId,
startTime: `${this.store.data.startTime.replace(/\//g, "-")}`,
endTime: `${this.store.data.endTime.replace(/\//g, '-')}`,
scheduleType: this.store.data.roomId ? 'meeting' : 'common',
noticeType: 'dd_notice',
participatorList: !!this.store.data.participatorList.length ? this.store.data.participatorList : [{ userId: getApp().globalData.userid, username: getApp().globalData.name, headUrl: getApp().globalData.avatar }],
repeatable: this.data.repeatable,
remark: this.data.remark,
aheadTimes: this.store.data.aheadTimes,
recurrenceModel: this.data.recurrenceModel,
meetingRoomId: this.store.data.roomId,
remark: this.data.remark,
meetingWayModel: this.data.meetingWayModel
}
addSchedule(data).then(res => {
console.log(res)
modifySchedule(data).then(res => {
if (res.data.code === 0) {
dd.navigateBack({
delta: 1
this.setData({
originUsers: this.store.data.participatorList
})
this.setData({
'conToastData.showToast': true
})
}
})
......@@ -452,14 +550,76 @@ create.Page({
},
// toast 消失之后的回调
onToastHidden () {
onToastHidden() {
this.setData({
'conToastData.showToast': false
})
},
// onSelectPopup 选择完的回调
onSelectPopup(event) {
console.log(event.currentTarget.dataset.item)
this.setData({
switch (this.data.conSelectPopupData.selectType) {
case 'common':
this.isChange(this.data.editType, event.currentTarget.dataset.item.id)
break
case 'noParticipateStatus':
let data1 = {
type: event.currentTarget.dataset.item.id,
templateId: this.data.scheduleItem.scheduleTemplateId,
planDate: this.data.scheduleItem.planDate,
value: 0
}
isParticipate(data1).then(res => {
if (res.data.code === 0) {
this.setData({
confirmAttendance: 0,
'conToastData.showToast': true
})
}
})
break
case 'participateStatus':
let data = {
type: event.currentTarget.dataset.item.id,
templateId: this.data.scheduleItem.scheduleTemplateId,
planDate: this.data.scheduleItem.planDate,
value: 1
}
isParticipate(data).then(res => {
if (res.data.code === 0) {
this.setData({
confirmAttendance: 1,
'conToastData.showToast': true
})
}
})
break
case 'delSheudle':
dd.confirm({
title: '删除会议',
content: '确认删除会议吗?',
confirmButtonText: '确定',
cancelButtonText: '取消',
success: (success) => {
if (!!success.confirm) {
let data = {
scheduleId: this.data.scheduleItem.id,
identify: this.data.organizer === getApp().globalData.userid ? 'major' : 'identify',
deleteModel: event.currentTarget.dataset.item.id,
templateId: this.data.scheduleItem.scheduleTemplateId,
planDate: this.data.scheduleItem.planDate
}
deleteSchedule(data).then(res => {
dd.navigateBack({
delta: 1
})
})
}
}
})
break
}
this.setData({
'conSelectPopupData.showSelectPopup': false
})
},
......@@ -469,15 +629,179 @@ create.Page({
'conSelectPopupData.showSelectPopup': false
})
},
// 判断数据发生改变 发生改变
isChange(value) {
// 判断数据发生改变 发生改变 请求
isChange(value, modifyModel) {
let modifyContent = ''
switch (value) {
case 'title':
// if()
break
if (this.data.title !== this.data.originalData.title) {
modifyContent = 'title'
this.modifySchedule(modifyContent, modifyModel)
}
break
case 'remark':
if (this.data.remark !== this.data.originalData.remark) {
modifyContent = 'remark'
this.modifySchedule(modifyContent, modifyModel)
}
break
case 'meeting_way':
if (this.data.meetingWayModel !== this.data.originalData.meetingWayModel) {
modifyContent = 'meeting_way'
this.modifySchedule(modifyContent, modifyModel)
}
break
case 'operate_user':
if (this.data.remark !== this.data.originalData.remark) {
modifyContent = 'operate_user'
this.modifySchedule(modifyContent, modifyModel)
}
break
case 'repeat':
if (this.data.originalData.repeatable === 0 && this.data.repeatable === 1) {
modifyContent = 'to_repeat'
this.modifySchedule(modifyContent, modifyModel)
}
else if (this.data.originalData.repeatable === 1 && this.data.repeatable === 0) {
modifyContent = 'no_repeat'
this.modifySchedule(modifyContent, modifyModel)
}
else {
modifyContent = 'change_rule'
this.modifySchedule(modifyContent, modifyModel)
}
break
case 'modify_location':
if ((!!this.store.data.roomId ? this.store.data.roomId : -1) !== this.data.originalData.meetingRoomId || this.store.data.locationName !== this.data.originalData.location.locationName) {
modifyContent = 'modify_location'
this.modifySchedule(modifyContent, modifyModel)
}
break
case 'modify_time':
if (this.store.data.startTime !== this.data.originalData.startTime || this.store.data.endTime !== this.store.data.originalData.endTime) {
modifyContent = 'modify_time'
this.modifySchedule(modifyContent, modifyModel)
}
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
}
},
// 删除 日程
delSheudle() {
if (this.data.repeatable) {
this.setData({
'conSelectPopupData.selectType': 'delSheudle',
'conSelectPopupData.showSelectPopup': true
})
} else {
dd.confirm({
title: '删除会议',
content: '确认删除会议吗?',
confirmButtonText: '确定',
cancelButtonText: '取消',
success: (success) => {
if (!!success.confirm) {
let data = {
scheduleId: this.data.scheduleItem.id,
identify: this.data.organizer === getApp().globalData.userid ? 'major' : 'identify',
deleteModel: 'only'
}
deleteSchedule(data).then(res => {
dd.navigateBack({
delta: 1
})
})
}
}
})
}
},
// 点击参加
participate() {
let data = {
scheduleId: this.data.scheduleItem.id,
value: 1,
type: 'only'
}
if (this.data.repeatable) {
this.setData({
'conSelectPopupData.showSelectPopup': true,
'conSelectPopupData.selectType': 'participateStatus'
})
} else {
isParticipate(data).then(res => {
if (res.data.code === 0) {
this.setData({
confirmAttendance: 1,
'conToastData.showToast': true
})
}
})
}
},
// 点击 不参加
noParticipate() {
let data = {
scheduleId: this.data.scheduleItem.id,
value: 0,
type: 'only'
}
if (this.data.repeatable) {
this.setData({
'conSelectPopupData.showSelectPopup': true,
'conSelectPopupData.selectType': 'noParticipateStatus'
})
} else {
isParticipate(data).then(res => {
if (res.data.code === 0) {
this.setData({
confirmAttendance: 0,
'conToastData.showToast': true
})
}
})
}
}
});
......@@ -47,6 +47,7 @@ input {
}
.contactImage {
position: relative;
color: #fff;
font-size: 28rpx;
height: 80rpx;
......@@ -91,4 +92,19 @@ input {
color: #FFFFFF;
text-align: center;
line-height: 96rpx;
}
.conflict {
line-height: 13px;
vertical-align: top;
width: 13px;
height: 13px;
position: absolute;
background: #fff;
bottom: 0rpx;
color: #FF943E;
font-size: 12px;
right: -3rpx;
border-radius: 50%;
text-align: center;
}
\ No newline at end of file
......@@ -6,10 +6,12 @@
</view>
</view>
<!-- 邮箱联系人列表 -->
<view class="contactList" >
<view class="contactList">
<view class="contactListItem" a:for="{{outlookContact}}">
<view class="contactImage">
{{item.username.substring(0,2)}}
<view a:if="{{conflictPeople.includes(item.userId)}}" class="conflict iconicon_conflict iconfont">
</view>
</view>
<view class="contactText">
{{item.username}}
......
import { getHomeUserSchedule } from '../../api/request.js'
import { getUserScheduleInTime } from '../../api/request.js'
import { throttle } from './../../utils/utils.js'
import create from 'dd-store'
import exampleStore from '/stores/exampleStore'
......@@ -7,9 +7,12 @@ create.Page({
useAll: true,
data: {
outlookContact: [],
value: ''
value: '',
conflictPeople: [],
scheduleItem: ''
},
onLoad() {
onLoad(event) {
let scheduleItem = event.scheduleItem
let outlookContact = this.data.outlookContact
for (let value of this.store.data.participatorList) {
if (value.platform === 'outlook') {
......@@ -17,8 +20,10 @@ create.Page({
}
}
this.setData({
outlookContact: outlookContact
outlookContact: outlookContact,
scheduleItem: scheduleItem
})
this.conflictPeople()
},
onShow() {
},
......@@ -44,6 +49,7 @@ create.Page({
value: '',
outlookContact: outlookContact
})
this.conflictPeople()
} else {
dd.alert({
content: '请输入正确的邮箱格式',
......@@ -78,11 +84,42 @@ create.Page({
save() {
// concat 拼接后生成新的数组 push 返回的是长度
this.store.data.participatorList.push(...this.data.outlookContact)
let participatorList = [{ userId: getApp().globalData.userid, username: getApp().globalData.name, headUrl: getApp().globalData.avatar, platform: 'dingtalk'}].concat(this.store.data.participatorList)
let participatorList = [{ userId: getApp().globalData.userid, username: getApp().globalData.name, headUrl: getApp().globalData.avatar, platform: 'dingtalk' }].concat(this.store.data.participatorList)
this.store.data.participatorList = this.setArrary(participatorList)
this.update()
dd.navigateBack({
delta: 1
})
},
// 会议冲突
conflictPeople() {
let userIds = []
for (let value of this.data.outlookContact) {
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) {
if (!!this.data.scheduleItem) {
if (res.data.data[value].length > 1) {
conflictPeople.push(value)
}
} else {
if (res.data.data[value].length > 0) {
conflictPeople.push(value)
}
}
}
this.setData({
conflictPeople: conflictPeople
})
})
}
});
......@@ -9,9 +9,13 @@ create.Page({
conflictPeople: []
},
onLoad(event) {
let scheduleItem = JSON.parse(event.scheduleItem)
dd.setNavigationBar({
title: `参会人(${this.store.data.participatorList.length}人)`
})
this.setData({
scheduleItem: scheduleItem
})
this.conflictPeople()
},
// 保存信息
......@@ -98,9 +102,16 @@ create.Page({
getUserScheduleInTime(data).then(res => {
let conflictPeople = []
for (let value in res.data.data) {
if (res.data.data[value].length > 0) {
conflictPeople.push(value)
if (!!this.data.scheduleItem) {
if (res.data.data[value].length > 1) {
conflictPeople.push(value)
}
} else {
if (res.data.data[value].length > 0) {
conflictPeople.push(value)
}
}
}
this.setData({
conflictPeople: conflictPeople
......
......@@ -7,9 +7,13 @@ create.Page({
useAll: true,
data: {
place: '',
availableMeetingRoom: []
availableMeetingRoom: [],
scheduleItem: ''
},
onLoad(e) {
// this.setData({
// scheduleItem: JSON.parse(e.scheduleItem)
// })
dd.setNavigationBar({
title: '会议地点'
})
......
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