Commit e4f35b89 by fengzhaoyu

修改权限

parent 11695de0
......@@ -10,20 +10,20 @@
<input placeholder-class="placeholder" placeholder="请添加描述" class="text" onInput="onInput" data-type="remark" value="{{remark}}" />
</view>
</view>
<!-- roomId locationName 地点 -->
<!-- $data.$data.roomId locationName 地点 -->
<view class="place">
<view class="iconicon_Agreed1 iconfont icon " a:if="{{roomId}}">
<view class="iconicon_room1 iconfont icon " a:if="{{$data.roomId}}">
</view>
<view class="iconicon_location1 iconfont icon {{locationName ? '' : 'noValueIcon'}}" a:else>
<view class="iconicon_location1 iconfont icon {{$data.locationName ? '' : 'noValueIcon'}}" a:else>
</view>
<view class="placeContaint">
<view class="noPlace" a:if="{{!locationName}}" onTap="nextPage" data-nextPage="location">
<view class="noPlace" a:if="{{!$data.locationName}}" onTap="nextPage" data-nextPage="location">
添加地点
</view>
<view class="hasplace" onTap="nextPage" data-nextPage="location" a:else>
{{locationName}}
{{$data.locationName}}
</view>
<view class=" icon iconfont iconicon_close close" a:if="{{!!locationName}}" data-close="location" catchTap="close">
<view class=" icon iconfont iconicon_close close" a:if="{{!!$data.locationName}}" data-close="location" catchTap="close">
</view>
</view>
</view>
......@@ -35,10 +35,10 @@
<view>
<view class="timeText" catchTap="showPopup" data-type='time'>
<text a:if="{{isAcrossDay}}">
{{`${startTime.substring(5, 7)}月${startTime.substring(8, 10)}日 ${startTime.substring(11, 16)}`}} - {{`${endTime.substring(5, 7)}月${endTime.substring(8, 10)}日 ${endTime.substring(11, 16)}`}}
{{`${$data.startTime.substring(5, 7)}月${$data.startTime.substring(8, 10)}日 ${$data.startTime.substring(11, 16)}`}} - {{`${$data.endTime.substring(5, 7)}月${$data.endTime.substring(8, 10)}日 ${$data.endTime.substring(11, 16)}`}}
</text>
<text a:else>
{{`${startTime.substring(5, 7)}月${startTime.substring(8, 10)}日 ${week} ${startTime.substring(11, 16)}- ${endTime.substring(11, 16)}`}}
{{`${$data.startTime.substring(5, 7)}月${$data.startTime.substring(8, 10)}日 ${week} ${$data.startTime.substring(11, 16)}- ${$data.endTime.substring(11, 16)}`}}
</text>
<!-- 3月1日 周日 14:00-16:00 -->
</view>
......@@ -52,17 +52,17 @@
</view>
<!-- participatorList participatorUserId 参会人 -->
<view class="participator">
<view class="iconicon_attender iconfont icon {{participatorList.length>1 ? '' : 'noValueIcon'}}">
<view class="iconicon_attender iconfont icon {{$data.participatorList.length>1 ? '' : 'noValueIcon'}}">
</view>
<view class="participatorContaint">
<view class="participatorText" a:if="{{participatorList.length < 2}}" catchTap="showPopup" data-type='participator'>
<view class="participatorText" a:if="{{$data.participatorList.length < 2}}" catchTap="showPopup" data-type='participator'>
添加参会人
</view>
<view class="participatorList" a:else>
<view class="participatorListTop">
<view class="participatorText">
<view>
{{participatorList.length}}位参会人
{{$data.participatorList.length}}位参会人
</view>
<view class="conflictStatus" a:if="{{conflictPeople.length}}">
{{conflictPeople.length}}人会议安排冲突
......@@ -71,7 +71,7 @@
<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}}">
<view class="people" a:for="{{$data.participatorList.length > 10 ? [...$data.participatorList].splice(0, 11) : $data.participatorList}}">
<view class="headUrl">
<image a:if="{{item.headUrl}}" mode="scaleToFill" src="{{item.headUrl}}" />
<text
......
import { addSchedule, getUserScheduleInTime } from '../../api/request.js'
import { throttle } from './../../utils/utils.js'
import create from 'dd-store'
import exampleStore from '/stores/exampleStore'
create.Page({
store: exampleStore,
useAll: true,
data: {
$data: null,
// 传给组件list 的所有数据 comListData
comListData: {
repeatList: [
......@@ -71,7 +69,7 @@ create.Page({
this.reset()
},
onShow() {
if (this.store.data.participatorList.length > 1) {
if (this.$store.data.participatorList.length > 1) {
this.conflictPeople()
}
setTimeout(() => {
......@@ -104,17 +102,17 @@ create.Page({
},
// 初始化
reset() {
this.store.data.roomId = ''
this.store.data.participatorList = []
this.store.data.participatorUserId = []
this.store.data.originUsers = []
this.store.data.originUsersId = []
this.store.data.locationName = ''
this.store.data.startTime = this.getTimes()
this.store.data.endTime = this.getTimes(new Date(this.getTimes()).setMinutes(new Date(this.store.data.startTime).getMinutes() + 30))
this.$store.data.roomId = ''
this.$store.data.participatorList = []
this.$store.data.participatorUserId = []
this.$store.data.originUsers = []
this.$store.data.originUsersId = []
this.$store.data.locationName = ''
this.$store.data.startTime = this.getTimes()
this.$store.data.endTime = this.getTimes(new Date(this.getTimes()).setMinutes(new Date(this.$store.data.startTime).getMinutes() + 30))
this.update()
this.resetRepeatList()
this.acrossDay(this.store.data.startTime, this.store.data.endTime)
this.acrossDay(this.$store.data.startTime, this.$store.data.endTime)
},
// 跳转下一页
nextPage(event) {
......@@ -131,8 +129,8 @@ create.Page({
close(event) {
switch (event.target.dataset.close) {
case 'location':
this.store.data.locationName = ''
this.store.data.roomId = ''
this.$store.data.locationName = ''
this.$store.data.roomId = ''
this.update()
break
case 'meetingWayModel':
......@@ -180,12 +178,12 @@ create.Page({
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)
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().getDay()]]
} else if (index === 4) {
value.recurrenceModel.daysOfMonth = [this.store.data.startTime.replace(/\//g, "-").substring(8, 10)]
value.recurrenceModel.daysOfMonth = [this.$store.data.startTime.replace(/\//g, "-").substring(8, 10)]
}
}
repeatList.push(value)
......@@ -251,12 +249,12 @@ create.Page({
let require = []
let select = []
let outLookConcat = []
for (let participator of _that.store.data.participatorList) {
for (let participator of _that.$store.data.participatorList) {
if (participator.platform === 'outlook') {
outLookConcat.push(participator)
}
}
select = this.store.data.participatorUserId
select = this.$store.data.participatorUserId
require = [getApp().globalData.userid]
select = _that.selectedelRequired(require, select).pickedUsers
dd.complexChoose({
......@@ -276,8 +274,8 @@ create.Page({
})
participatorList = _that.setArrary(participatorList.concat(outLookConcat))
participatorUserId = [...new Set(participatorUserId)]
_that.store.data.participatorList = participatorList
_that.store.data.participatorUserId = participatorUserId
_that.$store.data.participatorList = participatorList
_that.$store.data.participatorUserId = participatorUserId
_that.update()
_that.conflictPeople()
},
......@@ -310,10 +308,10 @@ create.Page({
},
// 点击完成
onComplete(event) {
this.store.data.startTime = `${event.startTime}:00`
this.store.data.endTime = `${event.endTime}:00`
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.acrossDay(this.$store.data.startTime, this.$store.data.endTime)
this.setData({
popupShow: false
})
......@@ -325,22 +323,22 @@ create.Page({
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,
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' }],
startTime: this.$store.data.startTime.replace(/\//g, "-"),
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' }],
repeatable: this.data.repeatable,
remark: this.data.remark,
recurrenceModel: this.data.recurrenceModel,
meetingRoomId: this.store.data.roomId,
meetingRoomId: this.$store.data.roomId,
meetingWayModel: this.data.meetingWayModel
}
addSchedule(data).then(res => {
if (res.data.code === 0) {
this.store.data.indexNeedUpdate = true
this.$store.data.indexNeedUpdate = true
this.update()
dd.navigateBack({
delta: 1
......@@ -373,12 +371,12 @@ create.Page({
// 会议冲突
conflictPeople() {
let userIds = []
for (let value of this.store.data.participatorList) {
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, "-"),
startTime: this.$store.data.startTime.replace(/\//g, "-"),
endTime: this.$store.data.endTime.replace(/\//g, "-"),
userIds: userIds
}
getUserScheduleInTime(data).then(res => {
......
......@@ -111,7 +111,7 @@
</view>
<view class="name">{{item.name}}</view>
</view>
<view class="addPeople" catchTap="showPopup" data-type='participator'></view>
<view class="addPeople iconfont iconicon_add1" catchTap="showPopup" data-type='participator'></view>
</view>
</view>
</view>
......@@ -149,8 +149,8 @@
</view>
<!-- 底部导航栏 -->
<view class="footNav">
<view class="footNavTop" a:if="{{currentPeople != organizer}}">
<view class="originStaus" a:if="{{confirmAttendance === null}}">
<view class="footNavTop">
<view class="originStaus" a:if="{{(currentPeople != organizer)&&confirmAttendance === null}}">
<view catchTap="participate">
<text class="iconfont iconicon_Agreed1"></text>
<text>参加</text></view>
......
......@@ -157,10 +157,11 @@ create.Page({
participatorList.push(value.participator)
participatorUserId.push(value.participator.userId)
originUsers.push(value.participator)
if (value.participator.userId === getApp().globalData.userid) {
// this.setData({
// aheadTimes: value.
// })
if (value.userId === getApp().globalData.userid) {
debugger
this.setData({
aheadTimes: !!value.aheadList ? value.aheadList : [-1]
})
}
}
}
......
......@@ -16,7 +16,7 @@
<view class="contactText">
{{item.username}}
</view>
<view a:if="{{!!scheduleItem ? !(item.userId == originalData || originUsersId.includes(item.userId)) : !(item.userId == originalData)}}" class="contactClose icon iconfont iconicon_close" onTap="close" data-item="{{item}}">
<view a:if="{{!!scheduleItem ? !(item.userId == $data.originalData || $data.originUsersId.includes(item.userId)) : !(item.userId == $data.originalData)}}" class="contactClose icon iconfont iconicon_close" onTap="close" data-item="{{item}}">
</view>
</view>
</view>
......
import { getUserScheduleInTime, modifySchedule } from '../../api/request.js'
import { throttle } from './../../utils/utils.js'
import create from 'dd-store'
import exampleStore from '/stores/exampleStore'
import { observer } from '/utils/observer.js'
create.Page({
store: exampleStore,
useAll: true,
data: {
$data: null,
userList: [],
userListId: [],
outlookContact: [],
......@@ -53,7 +51,7 @@ create.Page({
})
}
let outlookContact = []
for (let value of this.store.data.participatorList) {
for (let value of this.$store.data.participatorList) {
if (value.platform === 'outlook') {
outlookContact.push(value)
}
......@@ -131,31 +129,31 @@ create.Page({
// concat 拼接后生成新的数组 push 返回的是长度
let participatorList = []
let participatorListId = []
for (let value of this.store.data.participatorList) {
for (let value of this.$store.data.participatorList) {
if (value.platform !== 'outlook') {
participatorList.push(value)
participatorListId.push(value.userId)
}
}
participatorListId.push(getApp().globalData.userid)
this.data.outlookContact.forEach(item => {
participatorListId.push(item.userId)
})
participatorList.push({ userId: getApp().globalData.userid, username: getApp().globalData.name, headUrl: getApp().globalData.avatar, platform: 'dingtalk' })
participatorList.push(...this.data.outlookContact)
participatorList = this.setArrary(participatorList)
this.data.outlookContact.forEach(item => {
participatorListId.push(item.userId)
})
this.setData({
userList: participatorList,
userId: [...new Set(participatorListId)]
userListId: [...new Set(participatorListId)]
})
if (!!this.data.scheduleItem) {
if (this.store.data.originalData.repeatable === 1) {
if (this.$store.data.originalData.repeatable === 1) {
this.setData({
'conSelectPopupData.showSelectPopup': true
})
} else {
let addUserList = this.arrayPoor(this.store.data.originUsers, this.data.userList).addUserList
let deleteUserList = this.arrayPoor(this.store.data.originUsers, this.data.userList).deleteUserList
let addUserList = this.arrayPoor(this.$store.data.originUsers, this.data.userList).addUserList
let deleteUserList = this.arrayPoor(this.$store.data.originUsers, this.data.userList).deleteUserList
let dataUser = {
addUserList: addUserList,
deleteUserList: deleteUserList,
......@@ -165,7 +163,7 @@ create.Page({
this.modifySchedule(dataUser)
}
} else {
this.store.data.participatorList = participatorList
this.$store.data.participatorList = participatorList
this.update()
dd.navigateBack({
delta: 1
......@@ -186,8 +184,8 @@ create.Page({
'centerPopup.showCenterPopup': false
})
if (event.currentTarget.dataset.item.id > -1) {
let addUserList = this.arrayPoor(this.store.data.originUsers, this.data.userList).addUserList
let deleteUserList = this.arrayPoor(this.store.data.originUsers, this.data.userListId).deleteUserList
let addUserList = this.arrayPoor(this.$store.data.originUsers, this.data.userList).addUserList
let deleteUserList = this.arrayPoor(this.$store.data.originUsers, this.data.userListId).deleteUserList
let dataUser = {
addUserList: addUserList,
deleteUserList: deleteUserList,
......@@ -216,13 +214,13 @@ create.Page({
return new Promise((resolve, rejects) => {
modifySchedule(Object.assign(data, obj)).then(res => {
if (res.data.code === 0) {
this.store.data.indexNeedUpdate = true
this.$store.data.indexNeedUpdate = true
this.update()
this.setData({
'conToastData.showToast': true,
'conToastData.title': '保存成功'
})
if (this.store.data.originalData.repeatable === 1) {
if (this.$store.data.originalData.repeatable === 1) {
observer.notice(res.data.data)
}
this.operateUserS()
......@@ -271,8 +269,8 @@ create.Page({
userIds.push(value.userId)
}
let data = {
startTime: this.store.data.startTime.replace(/\//g, "-"),
endTime: this.store.data.endTime.replace(/\//g, "-"),
startTime: this.$store.data.startTime.replace(/\//g, "-"),
endTime: this.$store.data.endTime.replace(/\//g, "-"),
userIds: userIds
}
getUserScheduleInTime(data).then(res => {
......@@ -311,11 +309,11 @@ create.Page({
},
// 参会人修改成功
operateUserS() {
this.store.data.participatorList = this.data.userList
this.store.data.participatorUserId = this.data.userListId
this.store.data.indexNeedUpdate = true
this.store.data.originUsers = this.store.data.participatorList
this.store.data.originUsersId = this.store.data.participatorUserId
this.$store.data.participatorList = this.data.userList
this.$store.data.participatorUserId = this.data.userListId
this.$store.data.indexNeedUpdate = true
this.$store.data.originUsers = this.$store.data.participatorList
this.$store.data.originUsersId = this.$store.data.participatorUserId
this.update()
dd.navigateBack({
delta: 1
......
<view class="participantsDetail">
<view class="peopleContaint">
<view class="peopleList" a:for="{{participatorList}}" a:for-item="item">
<view class="peopleList" a:for="{{$data.participatorList}}" a:for-item="item">
<view class="headImg">
<image a:if="{{!!item.headUrl}}" mode="scaleToFill" src="{{item.headUrl}}"/>
<text a:else>{{item.username.substring(0, 1)}}</text>
......@@ -8,7 +8,7 @@
</view>
<view class="info">
<text class="name">{{item.username}}</text>
<text a:if="{{!!scheduleItem ? !(item.userId == originalData || originUsersId.includes(item.userId)) : !(item.userId == originalData)}}" class="close iconicon_close iconfont" data-userId="{{item.userId}}" onTap="delParticipants"></text>
<text a:if="{{!!scheduleItem ? !(item.userId == $data.originalData || $data.originUsersId.includes(item.userId)) : !(item.userId == currentPeople)}}" class="close iconicon_close iconfont" data-userId="{{item.userId}}" onTap="delParticipants"></text>
</view>
</view>
</view>
......
import create from 'dd-store'
import exampleStore from '/stores/exampleStore'
import { modifySchedule, addSchedule, getUserScheduleInTime, getHomeUserSchedule } from '../../api/request.js'
import { observer } from '/utils/observer.js'
create.Page({
store: exampleStore,
useAll: true,
data: {
$data: null,
scheduleItem: '',
conflictPeople: [],
// 传给组件 hList 水平排列 所有数据 comHListData
......@@ -38,17 +36,22 @@ create.Page({
showToast: false,
title: '保存成功'
},
currentPeople: ''
},
onLoad(event) {
const _that = this
if (event.scheduleItem) {
let scheduleItem = JSON.parse(event.scheduleItem)
this.setData({
scheduleItem: scheduleItem
scheduleItem: scheduleItem,
})
}
this.setData({
currentPeople: getApp().globalData.userid
})
dd.setNavigationBar({
title: `参会人(${this.store.data.participatorList.length}人)`
title: `参会人(${this.$store.data.participatorList.length}人)`
})
observer.register({
notice(scheduleItem) {
......@@ -60,10 +63,16 @@ create.Page({
})
this.conflictPeople()
},
onShow() {
dd.setNavigationBar({
title: `参会人(${this.$store.data.participatorList.length}人)`
})
},
// 关闭popup 点击mark
closePopup() {
this.setData({
popupShow: false
popupShow: false,
})
},
// 出现popup
......@@ -107,17 +116,17 @@ create.Page({
let require = []
let select = []
let outLookConcat = []
for (let participator of _that.store.data.participatorList) {
for (let participator of _that.$store.data.participatorList) {
if (participator.platform === 'outlook') {
outLookConcat.push(participator)
}
}
if (!_that.data.scheduleItem || this.data.organizer === getApp().globalData.userid) {
select = this.store.data.participatorUserId
select = this.$store.data.participatorUserId
require = [getApp().globalData.userid]
} else {
select = []
require = [...this.store.data.originUsersId]
require = [...this.$store.data.originUsersId]
}
select = _that.selectedelRequired(require, select).pickedUsers
dd.complexChoose({
......@@ -137,7 +146,7 @@ create.Page({
participatorUserId.push(item.userId)
})
} else {
_that.store.data.originUsers.forEach((item, index) => {
_that.$store.data.originUsers.forEach((item, index) => {
participatorList.push(item)
if (item.platform === 'dingtalk') {
participatorUserId.push(item.userId)
......@@ -150,18 +159,18 @@ create.Page({
}
participatorList = _that.setArrary(participatorList.concat(outLookConcat))
participatorUserId = [...new Set(participatorUserId)]
_that.store.data.participatorList = participatorList
_that.store.data.participatorUserId = participatorUserId
_that.$store.data.participatorList = participatorList
_that.$store.data.participatorUserId = participatorUserId
_that.update()
_that.conflictPeople()
if (!!_that.data.scheduleItem) {
if (_that.store.data.originalData.repeatable) {
if (_that.$store.data.originalData.repeatable) {
_that.setData({
'conSelectPopupData.showSelectPopup': true
})
} else {
let addUserList = _that.arrayPoor(_that.store.data.originUsers, _that.store.data.participatorList).addUserList
let deleteUserList = _that.arrayPoor(_that.store.data.originUsers, _that.store.data.participatorList).deleteUserList
let addUserList = _that.arrayPoor(_that.$store.data.originUsers, _that.$store.data.participatorList).addUserList
let deleteUserList = _that.arrayPoor(_that.$store.data.originUsers, _that.$store.data.participatorList).deleteUserList
let dataUser = {
addUserList: addUserList,
deleteUserList: deleteUserList,
......@@ -190,8 +199,8 @@ create.Page({
'centerPopup.showCenterPopup': false
})
if (event.currentTarget.dataset.item.id > -1) {
let addUserList = this.arrayPoor(this.store.data.originUsers, this.store.data.participatorList).addUserList
let deleteUserList = this.arrayPoor(this.store.data.originUsers, this.store.data.participatorList).deleteUserList
let addUserList = this.arrayPoor(this.$store.data.originUsers, this.$store.data.participatorList).addUserList
let deleteUserList = this.arrayPoor(this.$store.data.originUsers, this.$store.data.participatorList).deleteUserList
let dataUser = {
addUserList: addUserList,
deleteUserList: deleteUserList,
......@@ -205,16 +214,22 @@ create.Page({
},
// 参会人修改成功
operateUserS() {
this.store.data.indexNeedUpdate = true
this.store.data.originUsers = this.store.data.participatorList
this.store.data.originUsersId = this.store.data.participatorUserId
this.$store.data.indexNeedUpdate = true
this.$store.data.originUsers = this.$store.data.participatorList
this.$store.data.originUsersId = this.$store.data.participatorUserId
this.update()
dd.setNavigationBar({
title: `参会人(${this.$store.data.participatorList.length}人)`
})
},
// 参会人修改失败
operateUserE() {
this.store.data.participatorList = this.store.data.originUsers
this.store.data.participatorUserId = this.store.data.originUsersId
this.$store.data.participatorList = this.$store.data.originUsers
this.$store.data.participatorUserId = this.$store.data.originUsersId
this.update()
dd.setNavigationBar({
title: `参会人(${this.$store.data.participatorList.length}人)`
})
},
// onSelectPopupCancel 点击取消
onSelectPopupCancel() {
......@@ -235,14 +250,14 @@ create.Page({
return new Promise((resolve, rejects) => {
modifySchedule(Object.assign(data, obj)).then(res => {
if (res.data.code === 0) {
this.store.data.indexNeedUpdate = true
this.$store.data.indexNeedUpdate = true
this.update()
this.setData({
'conToastData.showToast': true,
'conToastData.title': '保存成功'
})
this.operateUserS()
if (this.store.data.originalData.repeatable === 1) {
if (this.$store.data.originalData.repeatable === 1) {
observer.notice(res.data.data)
}
return resolve(res)
......@@ -294,15 +309,16 @@ create.Page({
cancelButtonText: '取消',
success: (success) => {
if (!!success.confirm) {
if (!!_that.store.data.originalData.repeatable) {
if (!!_that.$store.data.originalData.repeatable) {
_that.delete(event)
_that.setData({
'conSelectPopupData.showSelectPopup': true
})
} else {
_that.delete(event)
let addUserList = _that.arrayPoor(_that.store.data.originUsers, _that.store.data.participatorList).addUserList
let deleteUserList = _that.arrayPoor(_that.store.data.originUsers, _that.store.data.participatorList).deleteUserList
let addUserList = _that.arrayPoor(_that.$store.data.originUsers, _that.$store.data.participatorList).addUserList
let deleteUserList = _that.arrayPoor(_that.$store.data.originUsers, _that.$store.data.participatorList).deleteUserList
let dataUser = {
addUserList: addUserList,
deleteUserList: deleteUserList,
......@@ -316,33 +332,31 @@ create.Page({
})
} else {
this.delete()
this.delete(event)
}
},
// 删除操作
delete(event) {
let userId = event.target.dataset.userId
this.store.data.participatorList.forEach((item, index) => {
this.$store.data.participatorList.forEach((item, index) => {
if (userId === item.userId) {
let participatorList = [...this.store.data.participatorList]
let participatorList = [...this.$store.data.participatorList]
participatorList.splice(index, 1)
this.store.data.participatorList = participatorList
this.$store.data.participatorList = participatorList
this.update()
return
}
})
this.store.data.participatorUserId.forEach((item, index) => {
this.$store.data.participatorUserId.forEach((item, index) => {
if (userId === item) {
let participatorUserId = [...this.store.data.participatorUserId]
let participatorUserId = [...this.$store.data.participatorUserId]
participatorUserId.splice(index, 1)
this.store.data.participatorUserId = participatorUserId
this.$store.data.participatorUserId = participatorUserId
this.update()
return
}
})
dd.setNavigationBar({
title: `参会人(${this.store.data.participatorList.length}人)`
})
this.conflictPeople()
},
// 数组去重
......@@ -357,12 +371,12 @@ create.Page({
// 会议冲突
conflictPeople() {
let userIds = []
for (let value of this.store.data.participatorList) {
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, "-"),
startTime: this.$store.data.startTime.replace(/\//g, "-"),
endTime: this.$store.data.endTime.replace(/\//g, "-"),
userIds: userIds
}
getUserScheduleInTime(data).then(res => {
......
import create from 'dd-store'
import exampleStore from '/stores/exampleStore'
import { queryAvailableMeetingRoomByTime, modifySchedule } from './../../api/request'
import { throttle } from './../../utils/utils.js'
import { observer } from '/utils/observer.js'
create.Page({
store: exampleStore,
useAll: true,
data: {
$data: null,
place: '',
availableMeetingRoom: [],
scheduleItem: '',
......@@ -55,8 +53,8 @@ create.Page({
})
let that = this
let data = {
startTime: this.store.data.startTime.replace(/\//g, "-"),
endTime: this.store.data.endTime.replace(/\//g, "-")
startTime: this.$store.data.startTime.replace(/\//g, "-"),
endTime: this.$store.data.endTime.replace(/\//g, "-")
}
queryAvailableMeetingRoomByTime(data).then(res => {
that.setData({
......@@ -65,8 +63,8 @@ create.Page({
})
},
selectPlace(event) {
this.store.data.locationName = event.target.dataset.locationName
this.store.data.roomId = ''
this.$store.data.locationName = event.target.dataset.locationName
this.$store.data.roomId = ''
this.update()
if (!!this.data.scheduleItem) {
if (this.data.repeatable != 0) {
......@@ -78,9 +76,9 @@ create.Page({
location: {
longitude: -999,
latitude: -999,
locationName: this.store.data.locationName
locationName: this.$store.data.locationName
},
meetingRoomId: this.store.data.roomId,
meetingRoomId: this.$store.data.roomId,
modifyModel: 'only',
modifyContent: 'modify_location'
}
......@@ -114,9 +112,9 @@ create.Page({
location: {
longitude: -999,
latitude: -999,
locationName: this.store.data.locationName
locationName: this.$store.data.locationName
},
meetingRoomId: this.store.data.roomId,
meetingRoomId: this.$store.data.roomId,
modifyModel: this.data.conSelectPopupData.selectPopupId,
modifyContent: 'modify_location'
}
......@@ -131,8 +129,8 @@ create.Page({
},
// 修改地点成功
editLocationS() {
this.store.data.originalData.location.locationName = this.store.data.locationName
this.store.data.originalData.meetingRoomId = this.store.data.roomId
this.$store.data.originalData.location.locationName = this.$store.data.locationName
this.$store.data.originalData.meetingRoomId = this.$store.data.roomId
this.update()
dd.navigateBack({
delta: 1
......@@ -141,8 +139,8 @@ create.Page({
},
// 修改地点失败
editLocationE(lock = true) {
this.store.data.locationName = this.store.data.originalData.location.locationName
this.store.data.roomId = this.store.data.originalData.meetingRoomId
this.$store.data.locationName = this.$store.data.originalData.location.locationName
this.$store.data.roomId = this.$store.data.originalData.meetingRoomId
this.update()
if (lock) {
this.setData({
......@@ -167,7 +165,7 @@ create.Page({
'conToastData.showToast': true,
'conToastData.title': '保存成功'
})
if (this.store.data.originalData.repeatable === 1) {
if (this.$store.data.originalData.repeatable === 1) {
observer.notice(res.data.data)
}
return resolve(res)
......@@ -188,8 +186,8 @@ create.Page({
this.editLocationE(false)
},
selectMeetingRoom(e) {
this.store.data.locationName = e.target.dataset.locationName
this.store.data.roomId = e.target.dataset.locationid
this.$store.data.locationName = e.target.dataset.locationName
this.$store.data.roomId = e.target.dataset.locationid
this.update()
if (!!this.data.scheduleItem) {
if (this.data.repeatable != 0) {
......@@ -201,9 +199,9 @@ create.Page({
location: {
longitude: -999,
latitude: -999,
locationName: this.store.data.locationName
locationName: this.$store.data.locationName
},
meetingRoomId: this.store.data.roomId,
meetingRoomId: this.$store.data.roomId,
modifyModel: 'only',
modifyContent: 'modify_location'
}
......
class Store {
data = {
participatorList: [
{ headUrl: "", platform: "dingtalk", userId: "134410161020791052", username: "冯召玉" },
{ headUrl: "", platform: "dingtalk", userId: "30024743652146348302", username: "王五117" },
{ headUrl: "https://static.dingtalk.com/media/lADOCi4ohM0C7s0C7A_748_750.jpg", platform: "dingtalk", userId: "03282029482102674671", username: "楚德朋(小鹏)" },
{ headUrl: "https://static.dingtalk.com/media/lADPDgQ9rVfXAB7NC9XNC9A_3024_3029.jpg", platform: "dingtalk", userId: "2866151654752072", username: "小号" },
{ headUrl: "", platform: "dingtalk", userId: "2168192627-2054385182", username: "诙是诙谐的诙" },
{ headUrl: "https://static.dingtalk.com/media/lADPGoGu60TX5w3NAdrNAdo_474_474.jpg", platform: "dingtalk", userId: "0906633440812257", username: "指月" },
{ headUrl: "https://static.dingtalk.com/media/lADPDgQ9rB3t4ozNBQDNBQA_1280_1280.jpg", platform: "dingtalk", userId: "0307652433971147", username: "皮特" },
{ headUrl: "https://static.dingtalk.com/media/lADPDgQ9qyCUTczNAeDNAeA_480_480.jpg", platform: "dingtalk", userId: "2269350140-286520467", username: "陆宜(测试)" },
{ headUrl: "", platform: "outlook", userId: "2303907784@qq.com", username: "2303907784@qq.com" }
], // 参会人列表
locationName: '',
participatorUserId: [], // 参会人的userId
userList: [],
roomId: '',
startTime: '',
endTime: '',
......
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