Commit 789559e6 by fengzhaoyu

feat: 编辑

parent a788256f
import { login } from './login'
export default function http (data) {
export default function http(data) {
if (getApp().globalData.token !== '') {
return new Promise((resolve, rejects) => {
dd.httpRequest({
......@@ -12,10 +12,10 @@ export default function http (data) {
method: data.method,
dataType: 'json',
data: data.data,
success: function(res) {
success: function (res) {
resolve(res)
},
fail: function(res) {
fail: function (res) {
rejects(res)
console.log(res)
}
......@@ -37,10 +37,10 @@ export default function http (data) {
method: data.method,
data: data.data,
dataType: 'json',
success: function(res) {
success: function (res) {
resolve(res)
},
fail: function(res) {
fail: function (res) {
console.log(res)
}
})
......
......@@ -217,7 +217,7 @@ export function saveFileInfo(data) {
return $http({
method: 'post',
data: JSON.stringify(data),
url: `/meet/schedule-accessory/save`
url: `/meet/meeting-log-resource/save`
})
}
// 删除文件
......
......@@ -21,8 +21,9 @@ App({
name: '',
// globalUrl:'https://gateway2.mingwork.com', // 线上地址
globalUrl: 'https://gateway-beta.mingwork.com' //beta地址
// globalUrl: 'http://192.168.1.111' //beta地址
// globalUrl:'http://139.196.213.18:9999' //beta地址
// globalUrl:'http://192.168.1.101:9999', //beta地址
// globalUrl: 'http://192.168.1.101:9999', //beta地址
// globalUrl:'http://192.168.1.102:9999' //beta地址
// 106,112,102
}
......
{
"pages": [
"pages/index/index",
"demo/index/index",
"pages/excutorList/excutorList",
"demo/sideslipping/sideslipping",
"pages/index/index",
"pages/editMeeting/editMeeting",
"pages/createMeeting/createMeeting",
"pages/outLookContact/outLookContact",
......@@ -21,7 +21,6 @@
"pages/createOrEditSchedule/createOrEditSchedule",
"pages/applicationDetails/applicationDetails",
"pages/attendeeList/attendeeList",
"pages/scheduleList/scheduleList",
"pages/meetingDetail/meetingDetail"
]
}
\ No newline at end of file
......@@ -87,14 +87,4 @@
font-size: 32rpx;
right: 32rpx;
top: 32rpx;
}
/* =======
.popupComplet {
display: inline-block;
float: right;
height: 100%;
line-height: 64rpx;
margin-right: 32rpx;
>>>>>>> Stashed changes
} */
\ No newline at end of file
}
\ No newline at end of file
......@@ -9,14 +9,14 @@
},
"luxon": {
"version": "1.22.2",
"resolved": "https://registry.npm.taobao.org/luxon/download/luxon-1.22.2.tgz?cache=0&sync_timestamp=1585156513463&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fluxon%2Fdownload%2Fluxon-1.22.2.tgz",
"integrity": "sha1-eZ1lzB7QuoW0yz9904/Aio0aZ1A=",
"resolved": "https://registry.npmjs.org/luxon/-/luxon-1.22.2.tgz",
"integrity": "sha512-vq6eSaOOw1fKob+JXwfu0e3/UFUT4G4HTFRJab7dch8J1OdOGW/vXqCiJsY7rm2In+5gKNYx0EtnYT0Tc5V4Qw==",
"optional": true
},
"rrule": {
"version": "2.6.4",
"resolved": "https://registry.npm.taobao.org/rrule/download/rrule-2.6.4.tgz",
"integrity": "sha1-f08x/aErxySbsXbIkRCam8RI4DU=",
"resolved": "https://registry.npmjs.org/rrule/-/rrule-2.6.4.tgz",
"integrity": "sha512-sLdnh4lmjUqq8liFiOUXD5kWp/FcnbDLPwq5YAc/RrN6120XOPb86Ae5zxF7ttBVq8O3LxjjORMEit1baluahA==",
"requires": {
"luxon": "^1.21.3",
"tslib": "^1.10.0"
......@@ -24,8 +24,8 @@
},
"tslib": {
"version": "1.11.1",
"resolved": "https://registry.npm.taobao.org/tslib/download/tslib-1.11.1.tgz",
"integrity": "sha1-6xXRKIJ/vuKEFUnhcfRe0zisfjU="
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz",
"integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA=="
}
}
}
......@@ -3,12 +3,12 @@ page {
background: #fff;
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #030303;
color: #0a0a0a;
}
.icon {
vertical-align: middle;
color: #1B263D;
color: #0a0a0a;
font-size: 34rpx;
}
......@@ -18,7 +18,7 @@ input {
}
.createTitle {
padding: 14rpx 36rpx 16rpx;
padding: 28rpx 36rpx 16rpx;
}
.title {
......@@ -36,8 +36,6 @@ input {
}
.title>.icon {
color: #3070F2;
/* vertical-align: middle; */
line-height: 58rpx;
}
......@@ -45,7 +43,8 @@ input {
padding-left: 0;
width: 100%;
opacity: 0.72;
font-size: 14px;
font-size: 28rpx;
color: rgba(3, 3, 3, 1)
}
.placeholder {
......@@ -133,7 +132,7 @@ input {
}
.participatorListBottom {
margin-top: 11rpx;
margin-top: 14rpx;
display: flex;
flex-wrap: wrap;
}
......@@ -209,7 +208,7 @@ input {
bottom: 0;
left: 0;
right: 0;
padding: 16rpx 32rpx;
padding: 32rpx;
background: #fff;
box-shadow: 0 -2px 4px 0 rgba(0, 0, 0, 0.04);
position: fixed;
......@@ -219,18 +218,15 @@ input {
.button {
font-family: PingFangSC-Regular;
width: 686rpx;
height: 96rpx;
background: #4D88FF;
height: 72rpx;
background: #EA0C28;
border-radius: 48rpx;
font-size: 34rpx;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
line-height: 96rpx;
line-height: 72rpx;
}
/* .iconicon_add {
margin-left: -2rpx;
text-align: left;
vertical-align: middle;
font-size: 92rpx;
} */
\ No newline at end of file
.noValueIcon {
color: rgba(216, 216, 216, 1)!important;
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
<view class="createTitle">
<view class="title">
<input placeholder-class="placeholder" placeholder="请输入主题" class="text" focus="{{true}}" onInput="onInput" data-type="title" value="{{title}}" />
<view class="icon iconfont iconicon_description" onTap="addRemark">
<view class="icon iconfont iconicon_description1 {{remark ? '' : 'noValueIcon'}}" onTap="addRemark">
</view>
</view>
<view class="remark" a:if="{{isShowRemark}}">
......@@ -12,9 +12,9 @@
</view>
<!-- roomId locationName 地点 -->
<view class="place">
<view class="iconicon_room iconfont icon" a:if="{{roomId}}">
<view class="iconicon_room1 iconfont icon " a:if="{{roomId}}">
</view>
<view class="iconicon_location iconfont icon" a:else>
<view class="iconicon_location1 iconfont icon {{locationName ? '' : 'noValueIcon'}}" a:else>
</view>
<view class="placeContaint">
<view class="noPlace" a:if="{{!locationName}}" onTap="nextPage" data-nextPage="location">
......@@ -29,7 +29,7 @@
</view>
<!-- startTime endTime repeatable recurrenceModel 时间 重复 -->
<view class="time">
<view class="iconicon_time iconfont icon">
<view class="iconicon_conflict iconfont icon">
</view>
<view class="timeContaint">
<view>
......@@ -46,13 +46,13 @@
{{comListData.repeatList[comListData.comSelectListId].text}}重复
</view>
</view>
<view class="icon iconfont iconicon_cycle " catchTap="showPopup" data-type='repeat' a:if="{{comListData.comSelectListId == 0}}">
<view class="icon iconfont iconicon_open " catchTap="showPopup" data-type='repeat' a:if="{{comListData.comSelectListId == 0}}">
</view>
</view>
</view>
<!-- participatorList participatorUserId 参会人 -->
<view class="participator">
<view class="iconicon_attender1 iconfont icon">
<view class="iconicon_attender iconfont icon {{participatorList.length>1 ? '' : 'noValueIcon'}}"">
</view>
<view class="participatorContaint">
<view class="participatorText" a:if="{{participatorList.length < 2}}" catchTap="showPopup" data-type='participator'>
......@@ -89,7 +89,7 @@
</view>
<!-- meetingWay 会议方式 -->
<view class="meetingWay">
<view class="iconicon_meet1 iconfont icon">
<view class="iconicon_meet iconfont icon {{comListData.meetingWayModelId ? '' : 'noValueIcon'}}">
</view>
<view class="meetingWayContent">
<view class="noWay" a:if="{{comListData.meetingWayModelId == null}}" catchTap="showPopup" data-type='meetingWayModel'>
......
......@@ -59,7 +59,6 @@ create.Page({
})
},
Complete(data) {
console.log(data)
this.closePop();
},
onLoad() {
......@@ -245,26 +244,34 @@ create.Page({
const _that = this
let require = []
let select = []
let outLookConcat = []
for (let participator of _that.store.data.participatorList) {
if (participator.platform === 'outlook') {
outLookConcat.push(participator)
}
}
select = this.store.data.participatorUserId
require = [getApp().globalData.userid]
select = _that.selectedelRequired(require, select).pickedUsers
dd.complexChoose({
title: "选择参会人", //标题
multiple: true, //是否多选
pickedUsers: select, //已选用户
pickedUsers: select, //已选用户 s
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)
let participatorList = []
let participatorUserId = []
participatorList.push({ userId: getApp().globalData.userid, username: getApp().globalData.name, headUrl: getApp().globalData.avatar, platform: 'dingtalk' })
participatorUserId.push(getApp().globalData.userid)
res.users.forEach((item, index) => {
_that.store.data.participatorList.push({ userId: item.userId, username: item.name, headUrl: item.avatar, platform: 'dingtalk' })
_that.store.data.participatorUserId.push(item.userId)
participatorList.push({ userId: item.userId, username: item.name, headUrl: item.avatar, platform: 'dingtalk' })
participatorUserId.push(item.userId)
})
_that.store.data.participatorList = _that.setArrary(_that.store.data.participatorList)
_that.store.data.participatorUserId = [...new Set(_that.store.data.participatorUserId)]
participatorList = _that.setArrary(participatorList.concat(outLookConcat))
participatorUserId = [...new Set(participatorUserId)]
_that.store.data.participatorList = participatorList
_that.store.data.participatorUserId = participatorUserId
_that.update()
_that.conflictPeople()
......
......@@ -3,7 +3,7 @@ page {
background: #fff;
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #030303;
color: #0a0a0a;
}
.hideDetail {
......@@ -36,7 +36,7 @@ page {
.icon {
vertical-align: middle;
color: #1B263D;
color: #0a0a0a;
font-size: 34rpx;
}
......@@ -64,8 +64,7 @@ input {
}
.title>.icon {
color: #3070F2;
/* vertical-align: middle; */
color: #0a0a0a;
line-height: 58rpx;
}
......@@ -354,4 +353,8 @@ input {
.footNavBottom>.iconfont {
margin-right: 70rpx;
font-size: 40rpx;
}
.noValueIcon {
color: rgba(216, 216, 216, 1)!important;
}
\ No newline at end of file
......@@ -12,19 +12,19 @@
<!-- title remark 标题 描述 -->
<view class="createTitle">
<view class="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">
<input placeholder-class="placeholder" placeholder="请输入主题" class="text" onInput="onInput" data-type="title" data-selectType="common" value="{{title}}" onConfirm="onBlur" />
<view class="icon iconfont iconicon_description1 {{remark ? '' : 'noValueIcon'}}" onTap="addRemark">
</view>
</view>
<view class="remark" a:if="{{isShowRemark}}">
<input placeholder-class="placeholder" placeholder="请添加描述" class="text" onInput="onInput" data-type="remark" value="{{remark}}" onBlur="onBlur" />
<input placeholder-class="placeholder" placeholder="请添加描述" class="text" onInput="onInput" data-type="remark" value="{{remark}}" onConfirm="onBlur" />
</view>
</view>
<!-- roomId locationName 地点 -->
<view class="place">
<view class="iconicon_room iconfont icon" a:if="{{roomId}}">
</view>
<view class="iconicon_location iconfont icon" a:else>
<view class="iconicon_location1 iconfont icon {{locationName ? '' : 'noValueIcon'}}" a:else>
</view>
<view class="placeContaint">
<view class="noPlace" a:if="{{!locationName}}" onTap="nextPage" data-nextPage="location">
......@@ -39,7 +39,7 @@
</view>
<!-- startTime endTime repeatable recurrenceModel 时间 重复 -->
<view class="time">
<view class="iconicon_time iconfont icon">
<view class="iconicon_conflict iconfont icon">
</view>
<view class="timeContaint">
<view>
......@@ -57,13 +57,13 @@
{{comListData.repeatList[comListData.comSelectListId].text}}重复
</view>
</view>
<view class="icon iconfont iconicon_cycle " catchTap="showPopup" data-type='repeat' a:if="{{comListData.comSelectListId == 0}}">
<view class="icon iconfont iconicon_open" catchTap="showPopup" data-type='repeat' a:if="{{comListData.comSelectListId == 0}}">
</view>
</view>
</view>
<!-- participatorList participatorUserId 参会人 -->
<view class="participator">
<view class="iconicon_attender1 iconfont icon">
<view class="iconicon_attender iconfont icon {{participatorList.length>1 ? '' : 'noValueIcon'}}">
</view>
<view class="participatorContaint">
<view class="participatorText" a:if="{{participatorList.length < 2}}" catchTap="showPopup" data-type='participator'>
......@@ -100,7 +100,7 @@
</view>
<!-- meetingWay 会议方式 -->
<view class="meetingWay">
<view class="iconicon_meet1 iconfont icon">
<view class="iconicon_meet iconfont icon {{comListData.meetingWayModelId ? '' : 'noValueIcon'}}">
</view>
<view class="meetingWayContent">
<view class="noWay" a:if="{{comListData.meetingWayModelId == null}}" catchTap="showPopup" data-type='meetingWayModel'>
......
......@@ -76,7 +76,6 @@ create.Page({
scheduleItem: '',
originalData: new Map(),
lock: false,
originUsers: [],
aheadTimes: [],
organizer: '',
editType: '',
......@@ -130,12 +129,10 @@ create.Page({
repeatListMap.set(item.recurrenceModel.model, item.id)
}
}
// console.log(repeatListMap, 111)
this.setData({
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),
'comListData.meetingWayModelId': res.data.data.meetingWayModel === null ? null : (res.data.data.meetingWayModel.model === 'dingtalk' ? 2 : (res.data.data.meetingWayModel.model === 'zoom' ? 1 : 0)),
'scheduleItem.id': res.data.data.id,
'scheduleItem.groupId': res.data.data.groupId,
repeatable: res.data.data.repeatable,
......@@ -151,12 +148,14 @@ create.Page({
'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.originUsers = participatorList
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.store.data.originUsersId = participatorUserId
this.update()
this.conflictPeople()
console.log(res.data.data)
......@@ -174,6 +173,9 @@ create.Page({
},
// 输入框输入事件
onInput(event) {
// dd.alert({
// content: JSON.stringify(event)
// })
switch (event.target.dataset.type) {
case 'title':
this.setData({
......@@ -219,6 +221,9 @@ create.Page({
reset() {
this.store.data.roomId = ''
this.store.data.participatorList = []
this.store.data.originUsers = []
this.store.data.originUsersId = []
this.store.data.participatorList = []
this.store.data.participatorUserId = []
this.store.data.locationName = ''
this.store.data.startTime = this.getTimes()
......@@ -231,7 +236,7 @@ create.Page({
nextPage(event) {
switch (event.target.dataset.nextPage) {
case 'location':
dd.navigateTo({ url: `./../place/place?scheduleItem=${JSON.stringify(this.data.scheduleItem)}` })
dd.navigateTo({ url: `./../place/place?scheduleItem=${JSON.stringify(this.data.scheduleItem)}&repeatable= ${this.data.repeatable}` })
break
case 'participantsDetail':
dd.navigateTo({ url: `./../participantsDetail/participantsDetail?scheduleItem=${JSON.stringify(this.data.scheduleItem)}` })
......@@ -304,7 +309,7 @@ create.Page({
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)
......@@ -316,7 +321,7 @@ create.Page({
})
},
// 选择完comList后的回调
// 选择完comList后的回调 重复 会议方式
selectComList(event) {
switch (this.data.comType) {
case 'meetingWayModel':
......@@ -325,6 +330,14 @@ create.Page({
popupShow: false,
meetingWayModel: this.data.comListData.meetingWayList[event.currentTarget.dataset.item.id].meetingWayModel
})
if (this.data.repeatable) {
this.setData({
'conSelectPopupData.showSelectPopup': true,
editType: 'meeting_way'
})
} else {
this.isChange('meeting_way', 'only')
}
break;
case 'repeat':
this.resetRepeatList()
......@@ -334,6 +347,14 @@ create.Page({
repeatable: event.currentTarget.dataset.item.repeatable,
recurrenceModel: event.currentTarget.dataset.item.recurrenceModel
})
if (this.data.originalData.repeatable) {
this.setData({
'conSelectPopupData.showSelectPopup': true,
editType: 'repeat'
})
} else {
this.isChange('repeat', 'only')
}
break;
}
},
......@@ -369,12 +390,18 @@ create.Page({
const _that = this
let require = []
let select = []
let outLookConcat = []
for (let participator of _that.store.data.participatorList) {
if (participator.platform === 'outlook') {
outLookConcat.push(participator)
}
}
if (this.data.organizer === getApp().globalData.userid) {
select = [...this.store.data.participatorUserId]
select = this.store.data.participatorUserId
require = [getApp().globalData.userid]
} else {
select = []
require = [...this.store.data.participatorUserId]
require = [...this.store.data.originUsersId]
}
select = _that.selectedelRequired(require, select).pickedUsers
dd.complexChoose({
......@@ -384,31 +411,51 @@ create.Page({
requiredUsers: require, //必选用户(不可取消选中状态)
responseUserOnly: true, //返回人,或者返回人和部门
success: function (res) {
let participatorList = []
let participatorUserId = []
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)
participatorList.push({ userId: getApp().globalData.userid, username: getApp().globalData.name, headUrl: getApp().globalData.avatar, platform: 'dingtalk' })
participatorUserId.push(getApp().globalData.userid)
res.users.forEach((item, index) => {
_that.store.data.participatorList.push({ userId: item.userId, username: item.name, headUrl: item.avatar })
_that.store.data.participatorUserId.push(item.userId)
participatorList.push({ userId: item.userId, username: item.name, headUrl: item.avatar, platform: 'dingtalk' })
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)
_that.store.data.originUsers.forEach((item, index) => {
participatorList.push(item)
if (item.platform === 'dingtalk') {
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)
participatorList.push({ userId: item.userId, username: item.name, headUrl: item.avatar, platform: 'dingtalk' })
participatorUserId.push(item.userId)
})
}
_that.store.data.participatorList = _that.setArrary(_that.store.data.participatorList)
_that.store.data.participatorUserId = [...new Set(_that.store.data.participatorUserId)]
participatorList = _that.setArrary(participatorList.concat(outLookConcat))
participatorUserId = [...new Set(participatorUserId)]
_that.store.data.participatorList = participatorList
_that.store.data.participatorUserId = participatorUserId
_that.update()
_that.conflictPeople()
if (_that.data.repeatable) {
_that.setData({
'conSelectPopupData.showSelectPopup': true,
editType: 'operate_user'
})
} else {
_that.isChange('operate_user', 'only')
}
// if (true) {
// _that.store.data.originUsers = _that.store.data.participatorList
// _that.store.data.originUsersId = _that.store.data.participatorUserId
// _that.update()
// } else {
// _that.store.data.participatorList = _that.store.data.originUsers
// _that.store.data.participatorUserId = _that.store.data.originUsersId
// }
},
fail: function (err) {
}
......@@ -429,8 +476,17 @@ create.Page({
this.update()
this.acrossDay(this.store.data.startTime, this.store.data.endTime)
this.setData({
popupShow: false
popupShow: false,
editType: ''
})
if (this.data.repeatable) {
this.setData({
'conSelectPopupData.showSelectPopup': true,
editType: 'modify_time'
})
} else {
this.isChange('modify_time', 'only')
}
},
// 选择会前提醒时间
selectAheadtimes(event) {
......@@ -438,38 +494,23 @@ create.Page({
aheadTimes: event,
popupShow: false
})
if (this.data.repeatable) {
this.setData({
'conSelectPopupData.showSelectPopup': true,
editType: 'aheadTimes'
})
} else {
this.isChange('aheadTimes', 'only')
}
},
// 保存编辑
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}创建的会议`,
modifySchedule(data) {
let obj = {
scheduleId: this.data.scheduleItem.id,
templateId: this.data.scheduleItem.scheduleTemplateId,
location: {
longitude: '10',
latitude: '10',
locationName: this.store.data.locationName || ''
},
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,
aheadTimes: this.store.data.aheadTimes,
recurrenceModel: this.data.recurrenceModel,
meetingRoomId: this.store.data.roomId,
remark: this.data.remark,
meetingWayModel: this.data.meetingWayModel
}
modifySchedule(data).then(res => {
planDate: this.data.scheduleItem.planDate
}
modifySchedule(Object.assign(data, obj)).then(res => {
if (res.data.code === 0) {
this.setData({
originUsers: this.store.data.participatorList
......@@ -634,54 +675,95 @@ create.Page({
let modifyContent = ''
switch (value) {
case 'title':
if (this.data.title !== this.data.originalData.title) {
modifyContent = 'title'
this.modifySchedule(modifyContent, modifyModel)
let dataTitle = {
title: this.data.title,
modifyModel: modifyModel,
modifyContent: 'title'
}
this.modifySchedule(dataTitle)
break
case 'remark':
if (this.data.remark !== this.data.originalData.remark) {
modifyContent = 'remark'
this.modifySchedule(modifyContent, modifyModel)
let dataRemark = {
remark: this.data.remark,
modifyModel: modifyModel,
modifyContent: 'remark'
}
this.modifySchedule(dataRemark)
break
case 'meeting_way':
if (this.data.meetingWayModel !== this.data.originalData.meetingWayModel) {
modifyContent = 'meeting_way'
this.modifySchedule(modifyContent, modifyModel)
let dataWay = {
meetingWayModel: this.data.meetingWayModel,
modifyModel: modifyModel,
modifyContent: 'meeting_way'
}
this.modifySchedule(dataWay)
break
case 'operate_user':
if (this.data.remark !== this.data.originalData.remark) {
modifyContent = 'operate_user'
this.modifySchedule(modifyContent, modifyModel)
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,
modifyModel: modifyModel,
modifyContent: 'operate_user'
}
this.modifySchedule(dataUser)
break
case 'repeat':
if (this.data.originalData.repeatable === 0 && this.data.repeatable === 1) {
modifyContent = 'to_repeat'
this.modifySchedule(modifyContent, modifyModel)
let dataRepeat1 = {
startTime: this.store.data.startTime.replace(/\//g, "-"),
endTime: this.store.data.endTime.replace(/\//g, "-"),
modifyModel: modifyModel,
modifyContent: 'to_repeat',
recurrenceModel: this.data.recurrenceModel,
repeatable: this.data.repeatable
}
this.modifySchedule(dataRepeat1)
}
else if (this.data.originalData.repeatable === 1 && this.data.repeatable === 0) {
modifyContent = 'no_repeat'
this.modifySchedule(modifyContent, modifyModel)
let dataRepeat2 = {
startTime: this.store.data.startTime.replace(/\//g, "-"),
endTime: this.store.data.endTime.replace(/\//g, "-"),
modifyModel: modifyModel,
modifyContent: 'no_repeat',
recurrenceModel: this.data.recurrenceModel,
repeatable: this.data.repeatable
}
this.modifySchedule(dataRepeat2)
}
else {
modifyContent = 'change_rule'
this.modifySchedule(modifyContent, modifyModel)
let dataRepeat3 = {
startTime: this.store.data.startTime.replace(/\//g, "-"),
endTime: this.store.data.endTime.replace(/\//g, "-"),
modifyModel: modifyModel,
modifyContent: 'change_rule',
recurrenceModel: this.data.recurrenceModel,
repeatable: this.data.repeatable
}
this.modifySchedule(dataRepeat3)
}
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)
let data = {
modifyModel: modifyModel,
startTime: this.store.data.startTime.replace(/\//g, "-"),
endTime: this.store.data.endTime.replace(/\//g, "-"),
modifyContent: 'modify_time'
}
this.modifySchedule(data)
break
case 'aheadTimes':
debugger
let dataAheadTimes = {
modifyModel: modifyModel,
aheadTimes: this.data.aheadTimes,
modifyContent: 'aheadTimes'
}
this.modifySchedule(dataAheadTimes)
break
}
},
......
<!--<mw-select></mw-select> -->
版本号:151 版本
<view class="index">
<view a:if="{{startPageOnLoad&&startPageOnShow}}">
<view >
<scroll-view a:if="{{todayStr !== ''}}" scroll-y="{{true}}" upper-threshold="50" lower-threshold="50" onScrollToLower="lower" onScroll="onScroll" style="height: 100vh;" scroll-into-view="{{todayStr}}">
<block a:for="{{scheduleList}}" a:for-item="scheduleYearList">
<block a:for="{{scheduleYearList}}">
......@@ -92,11 +92,5 @@
<view class="createSchedule iconfont iconjiahao " onTap="nextPage">
</view>
</view>
<view class="startPage" a:else>
<image mode="scaleToFill" src="../../assests/startPage.png"/>
<view class="startText">
<text class="text1">开会有益</text>
<text>快乐工作</text>
</view>
</view>
</view>
<!--<view class="startPage"><image mode="scaleToFill" src="../../assests/startPage.png"/><view class="startText"><text class="text1">开会有益</text><text>快乐工作</text></view></view> -->
</view>
\ No newline at end of file
......@@ -12,16 +12,20 @@ create.Page({
scheduleItem: ''
},
onLoad(event) {
let scheduleItem = event.scheduleItem
let outlookContact = this.data.outlookContact
if (event.scheduleItem) {
let scheduleItem = event.scheduleItem
this.setData({
scheduleItem: scheduleItem
})
}
let outlookContact = []
for (let value of this.store.data.participatorList) {
if (value.platform === 'outlook') {
outlookContact.push(value)
}
}
this.setData({
outlookContact: outlookContact,
scheduleItem: scheduleItem
outlookContact: outlookContact
})
this.conflictPeople()
},
......@@ -83,14 +87,61 @@ 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)
this.store.data.participatorList = this.setArrary(participatorList)
let participatorList = []
for (let value of this.store.data.participatorList) {
if (value.platform !== 'outlook') {
participatorList.push(value)
}
}
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.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)
// this.store.data.participatorList = this.setArrary(participatorList)
if (!!this.data.scheduleItem) {
if (true) {
this.arrayPoor(this.store.data.originUsers, participatorList)
this.store.data.originUsers = participatorList
this.store.data.participatorList = participatorList
} else {
}
} else {
this.store.data.participatorList = participatorList
}
this.update()
dd.navigateBack({
delta: 1
})
},
// 数组取差值 原先的数组与现在的比较 增加与减少
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
}
},
// 会议冲突
conflictPeople() {
let userIds = []
......
......@@ -44,9 +44,9 @@ page {
}
.headImg image {
width: 100%;
vertical-align: top;
width: 64rpx;
height: 64rpx;
height: 100%;
border-radius: 50%;
}
......@@ -57,10 +57,6 @@ page {
border-bottom: 1rpx solid #E3E4E4;
}
.list:last-child .info {
border: none;
}
.close {
position: absolute;
right: 32rpx;
......
......@@ -7,11 +7,14 @@
</view>
<view class="info">
<text class="name">{{item.username}}</text>
<text class="close iconicon_close iconfont" data-userId="{{item.userId}}" onTap="delParticipants"></text>
<text class="close iconicon_close iconfont" data-userId="{{item.userId}}" onTap="delParticipants"></text>
</view>
</view>
<view class="addParticipants" onTap="addParticipants">
<text class="iconfont iconicon_add " ></text>
<view class="addParticipants" catchTap="showPopup">
<text class="iconfont iconicon_add "></text>
<text>添加参会人</text>
</view>
<popup title="{{popupTitle}}" show="{{popupShow}}" mask="true" onClose="closePopup">
<hlist dataComList="{{comHListData.contactData}}" onSelectComHList="selectComHList"></hlist>
</popup>
</view>
\ No newline at end of file
......@@ -6,17 +6,57 @@ create.Page({
useAll: true,
data: {
scheduleItem: '',
conflictPeople: []
conflictPeople: [],
// 传给组件 hList 水平排列 所有数据 comHListData
comHListData: {
contactData: [
{ id: 0, text: '钉钉联系人', imageUrl: '../../assests/dingContact.png' },
{ id: 1, text: '手动添加邮箱', imageUrl: '../../assests/emailContact.png' }
]
},
popupShow: false
},
onLoad(event) {
let scheduleItem = JSON.parse(event.scheduleItem)
if (event.scheduleItem) {
let scheduleItem = JSON.parse(event.scheduleItem)
this.setData({
scheduleItem: scheduleItem
})
}
dd.setNavigationBar({
title: `参会人(${this.store.data.participatorList.length}人)`
})
this.conflictPeople()
},
// 关闭popup 点击mark
closePopup() {
this.setData({
scheduleItem: scheduleItem
popupShow: false
})
this.conflictPeople()
},
// 出现popup
showPopup() {
this.setData({
popupShow: true
})
},
// 选择完水平 HList 的回调
selectComHList(event) {
switch (event.currentTarget.dataset.item.id) {
case 0:
this.addParticipator()
this.setData({
popupShow: false
})
break;
case 1:
this.setData({
popupShow: false
})
dd.navigateTo({ url: `./../outLookContact/outLookContact?scheduleItem=${JSON.stringify(this.data.scheduleItem)}` })
break;
}
},
// 保存信息
saveInfo() {
......@@ -25,12 +65,23 @@ create.Page({
})
},
// 添加参会人
addParticipants() {
addParticipator() {
const _that = this
let require = []
let select = []
select = this.store.data.participatorUserId
require = [getApp().globalData.userid]
let outLookConcat = []
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
require = [getApp().globalData.userid]
} else {
select = []
require = [...this.store.data.originUsersId]
}
select = _that.selectedelRequired(require, select).pickedUsers
dd.complexChoose({
title: "选择参会人", //标题
......@@ -39,24 +90,74 @@ 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)
})
_that.store.data.participatorList = _that.setArrary(_that.store.data.participatorList)
_that.store.data.participatorUserId = [...new Set(_that.store.data.participatorUserId)]
let participatorList = []
let participatorUserId = []
if (!_that.data.scheduleItem || _that.data.organizer === getApp().globalData.userid) {
participatorList.push({ userId: getApp().globalData.userid, username: getApp().globalData.name, headUrl: getApp().globalData.avatar, platform: 'dingtalk' })
participatorUserId.push(getApp().globalData.userid)
res.users.forEach((item, index) => {
participatorList.push({ userId: item.userId, username: item.name, headUrl: item.avatar, platform: 'dingtalk' })
participatorUserId.push(item.userId)
})
} else {
_that.store.data.originUsers.forEach((item, index) => {
participatorList.push(item)
if (item.platform === 'dingtalk') {
participatorUserId.push(item.userId)
}
})
res.users.forEach((item, index) => {
participatorList.push({ userId: item.userId, username: item.name, headUrl: item.avatar, platform: 'dingtalk' })
participatorUserId.push(item.userId)
})
}
participatorList = _that.setArrary(participatorList.concat(outLookConcat))
participatorUserId = [...new Set(participatorUserId)]
_that.store.data.participatorList = participatorList
_that.store.data.participatorUserId = participatorUserId
_that.update()
_that.arrayPoor(_that.store.data.originUsers, _that.store.data.participatorList)
_that.conflictPeople()
if (true) {
_that.store.data.originUsers = _that.store.data.participatorList
_that.store.data.originUsersId = _that.store.data.participatorUserId
_that.update()
} else {
_that.store.data.participatorList = _that.store.data.originUsers
_that.store.data.participatorUserId = _that.store.data.originUsersId
}
},
fail: function (err) {
}
})
},
// 数组取差值 原先的数组与现在的比较 增加与减少
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)
}
}
this.setData({
addUserList: add,
deleteUserList: del
})
},
// 删除参会人
delParticipants(event) {
let userId = event.target.dataset.userId
......
{}
\ No newline at end of file
{
"usingComponents": {
"popup": "../../components/popup/index",
"list": "../../components/list/list",
"hlist": "../../components/hList/hList",
"meeting-time-picker": "../../components/meetingTimePicker/meetingTimePicker"
}
}
\ No newline at end of file
......@@ -44,5 +44,6 @@
<view class="allMettingRoom" a:if="{{true}}" onTap="toRoomList">
查看所有会议室
</view>
<selectpopup showSelectPopup="{{conSelectPopupData.showSelectPopup}}" selectPopupList="{{conSelectPopupData.editSaveList}}" onSelectPopup="onSelectPopup" onSelectPopupCancel="onSelectPopupCancel"></selectpopup>
</view>
</view>
\ No newline at end of file
import create from 'dd-store'
import exampleStore from '/stores/exampleStore'
import { queryAvailableMeetingRoomByTime } from './../../api/request'
import { queryAvailableMeetingRoomByTime, modifySchedule } from './../../api/request'
import { throttle } from './../../utils/utils.js'
create.Page({
store: exampleStore,
......@@ -8,12 +8,22 @@ create.Page({
data: {
place: '',
availableMeetingRoom: [],
scheduleItem: ''
scheduleItem: '',
repeatable: 0,
// 传递给组件selectPopup 的数据
conSelectPopupData: {
showSelectPopup: false,
selectType: 'common',
editSaveList: [{ text: '仅保存此会议', id: 'only' }, { text: '保存此次及以后会议', id: 'future' }]
},
},
onLoad(e) {
// this.setData({
// scheduleItem: JSON.parse(e.scheduleItem)
// })
if (e.scheduleItem) {
this.setData({
repeatable: e.repeatable,
scheduleItem: JSON.parse(e.scheduleItem)
})
}
dd.setNavigationBar({
title: '会议地点'
})
......@@ -32,8 +42,56 @@ create.Page({
this.store.data.locationName = event.target.dataset.locationName
this.store.data.roomId = ''
this.update()
dd.navigateBack({
delta: 1
if (!!this.data.scheduleItem) {
if (this.data.repeatable) {
this.setData({
'conSelectPopupData.showSelectPopup': true
})
} else {
let data = {
location: {
longitude: -999,
latitude: -999,
locationName: this.store.data.locationName
},
meetingRoomId: this.store.data.roomId,
modifyModel: 'only',
modifyContent: 'modify_location'
}
}
} else {
dd.navigateBack({
delta: 1
})
}
},
onSelectPopup(event) {
let data = {
location: {
longitude: -999,
latitude: -999,
locationName: this.store.data.locationName
},
meetingRoomId: this.store.data.roomId,
modifyModel: event.currentTarget.dataset.item.id,
modifyContent: 'modify_location'
}
this.modifySchedule(data)
},
// 保存编辑
modifySchedule(data) {
let obj = {
scheduleId: this.data.scheduleItem.id,
templateId: this.data.scheduleItem.scheduleTemplateId,
planDate: this.data.scheduleItem.planDate
}
modifySchedule(Object.assign(data, obj)).then(res => {
if (res.data.code === 0) {
dd.navigateBack({
delta: 1
})
}
})
},
selectMeetingRoom(e) {
......
{}
\ No newline at end of file
{
"usingComponents": {
"popup": "../../components/popup/index",
"list": "../../components/list/list",
"hlist": "../../components/hList/hList",
"toast": "../../components/toast/toast",
"selectpopup": "../../components/selectPopup/selectPopup",
"meeting-time-picker": "../../components/meetingTimePicker/meetingTimePicker"
}
}
\ No newline at end of file
......@@ -91,16 +91,21 @@ create.Page({
// 保存的接口
saveUpload: throttle(function () {
let data = {
resourceType: 'accessory',
creatorId: '2',
scheduleId: this.data.scheduleItem.id,
uploader: getApp().globalData.userid,
uploaderInfo: JSON.stringify({
groupId: this.data.scheduleItem.groupId,
creatorInfo: JSON.stringify({
userId: getApp().globalData.userid,
username: getApp().globalData.name,
headUrl: getApp().globalData.avatar
headUrl: getApp().globalData.avatar,
platform: 'dingtalk'
}),
thirdStoreTenant: 'dingTalk',
fileInfos: JSON.stringify(this.data.upLoadInfo.data),
descript: this.data.descript
description: this.data.descript,
logType: 'schedule_accessory_add'
}
saveFileInfo(data).then(res => {
dd.alert({
......
......@@ -15,10 +15,11 @@ class Store {
participatorUserId: [], // 参会人的userId
userList: [],
aheadTimes: [],
requireUserList: [],
roomId: '',
startTime: '',
endTime: ''
endTime: '',
originUsers: [],
originUsersId: []
}
}
export default new Store()
\ No newline at end of file
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