Commit 6e2ec912 by xiexiaoqin

Merge branch 'release_beta/1.0.0' of…

Merge branch 'release_beta/1.0.0' of ssh://gitlab.roboming.com:2018/fengzhaoyu/schedule into release_beta/1.0.0
parents c273514c 6357191f
import { getInterTime } from '../../utils/utils';
const currentDate = new Date();
const weekList = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
const durationList = [{ value: 30, label: '30分钟' }, { value: 60, label: '1小时' }, { value: 120, label: '2小时' }];
const durationList = [{ value: 30, label: '30分钟' }, { value: 60, label: '1小时' }, { value: 90, label: '1.5小时' }, { value: 120, label: '2小时' }];
const timeData = generateDate(365);
const timeHour = generateHour(24);
const timeMin = generateMin(60);
......
......@@ -17,24 +17,8 @@ create.Component({
this.getData();
},
didUpdate() {
if (typeof this.$store.data.relatedAppNeedUpdate === "object") {
let relatedAppList = this.data.relatedAppList;
let relatedAppPlatformList = this.data.relatedAppPlatformList;
relatedAppList.push({
thirdUserIdentify: this.$store.data.relatedAppNeedUpdate.name,
platform: this.$store.data.relatedAppNeedUpdate.platform
});
relatedAppPlatformList.push(
this.$store.data.relatedAppNeedUpdate.platform
);
this.setData({
relatedAppList: relatedAppList,
relatedAppPlatformList: relatedAppPlatformList
});
this.$store.data.relatedAppNeedUpdate = "";
this.update();
} else if (this.$store.data.relatedAppNeedUpdate === "1") {
this.$store.data.relatedAppNeedUpdate = "";
if (this.$store.data.relatedAppNeedUpdate) {
this.$store.data.relatedAppNeedUpdate = false;
this.update();
this.getData();
}
......@@ -56,16 +40,9 @@ create.Component({
preventSort() {
return false;
},
bindingApp(e) {
dd.navigateTo({
url: `./../bindingApp/bindingApp?platform=${e.target.dataset.platform}`
});
},
toAppDetails(e) {
dd.navigateTo({
url: `./../unbindApp/unbindApp?item=${JSON.stringify(
e.target.dataset.item
)}`
url: `./../appDetails/appDetails?userName=${e.target.dataset.name}&platform=${e.target.dataset.platform}`
});
}
}
......
......@@ -47,7 +47,7 @@ create.Component({
complete: throttle(
function () {
const { currentTask } = this.store.data;
if (!currentTask.taskInfos.taskTitle) {
if ((currentTask.taskInfos && !currentTask.taskInfos.taskTitle) || !currentTask.taskInfos) {
return
}
this.props.onComplete()
......
......@@ -4,7 +4,7 @@ Component({
},
props: {
showToast: false,
duration: 2000,
duration: 1000,
title: '保存成功',
toastIcon: 'iconcanjia3'
......
<web-view id="web-view-1" src="{{url}}" onMessage="test">
</web-view>
\ No newline at end of file
import {
getOutlookUrl,
getZoomUrl,
authorizationCodeReplacementToken,
sendZoomCode
} from "../../api/request";
import "dingtalk-jsapi/entry/mobile";
import openLink from "dingtalk-jsapi/api/biz/util/openLink";
import create from "dd-store";
create.Page({
data: {
$data: null,
url: "",
platform: ""
},
onLoad(e) {
this.setData({
platform: e.platform
});
this.webViewContext = dd.createWebViewContext("web-view-1");
if (e.platform === "outlook") {
let data = `${getApp().globalData.userid},${dd.corpId}`;
getOutlookUrl(data).then(res => {
openLink({
url: res.data.data
});
// this.setData({
// url: res.data.data
// });
});
} else if (e.platform === "zoom") {
getZoomUrl("").then(res => {
this.setData({
url: res.data.data
});
});
}
},
test(e) {
const code = e.detail.code;
const state = e.detail.state;
if (this.data.platform === "outlook") {
const data = {
code: code,
state: state
};
authorizationCodeReplacementToken(data).then(res => {
if (res.data.data) {
this.$store.data.relatedAppNeedUpdate = {
name: res.data.data,
platform: this.data.platform
};
this.update();
dd.navigateBack({
delta: 1
});
}
});
} else if (this.data.platform === "zoom") {
const data = {
code: code,
userId: getApp().globalData.userid,
orgId: dd.corpId
};
sendZoomCode(data).then(res => {
if (res.data.data) {
this.$store.data.relatedAppNeedUpdate = {
name: res.data.data,
platform: this.data.platform
};
this.update();
dd.navigateBack({
delta: 1
});
}
});
}
}
});
{}
\ No newline at end of file
......@@ -19,6 +19,7 @@ import {
padZero,
getCreateShowTime
} from "../../utils/utils";
import { checkFullScren } from "../../utils/checkFullScren";
const currentDate = new Date();
const minYear = 2020;
const maxYear = currentDate.getFullYear() + 1;
......@@ -28,6 +29,7 @@ import create from "dd-store";
let maxClickCount = 5;
create.Page({
data: {
sign: '',
refresh: false,
$data: null,
iconDay: currentDate.getDate(),
......@@ -44,7 +46,7 @@ create.Page({
current: 1,
pages: 1,
listLoading: true,
isFullscreen: false
isIPX: checkFullScren()
},
scrollTop: 0,
pageSize: 10,
......@@ -60,6 +62,7 @@ create.Page({
maxYear: maxYear,
todayIndex: 0,
onShow() {
//如果是重复会议重新算
if (this.$store.data.indexNeedUpdate) {
dd.setNavigationBar({
......@@ -83,22 +86,31 @@ create.Page({
this.$store.data.isIndexAffairListNeedUpdate = false;
this.update();
}
//开启一个定时器
this.timer = setInterval(() => {
this.getData()
}, 30000)
},
onHide() {
clearInterval(this.timer);
this.timer = null;
},
onLoad(event) {
if (JSON.stringify(event) != "{}") {
refresh() {
this.onLoad()
},
onLoad(query) {
console.log(query);
if (query && JSON.stringify(query) !== '{}') {
this.setData({
listLoading: false
});
let scheduleItem = JSON.parse(Object.keys(event)[0].split("=")[1]);
const scheduleItem = JSON.parse(Object.keys(query)[0].split("=")[1]);
dd.navigateTo({
url: `./../meetingDetail/meetingDetail?scheduleItem=${encodeURIComponent(
JSON.stringify(scheduleItem)
)}`
});
}
this.setData({
isFullscreen: getApp().globalData.isFullscreen
});
dd.setNavigationBar({
title: "动态"
});
......@@ -186,11 +198,11 @@ create.Page({
callBack();
}
}).catch(err => {
// if (err && err.refresh) {
// this.setData({
// refresh: true
// })
// }
if (err && err.refresh) {
this.setData({
refresh: true
})
}
});
},
//动态置顶
......@@ -291,7 +303,23 @@ create.Page({
startTime: "2020-01-01 00:00:00",
endTime: "2025-12-30 23:59:59"
}).then(res => {
//是否刷新页面
if (this.data.sign && res.data.data.sign !== this.data.sign) {
DateMap = getDateMap(this.minYear, this.maxYear);
}
if (res.data.data.sign !== this.data.sign) {
this.getScheduleList(res.data.data);
}
this.setData({
sign: res.data.data.sign
})
}).catch(err => {
if (err && err.refresh) {
this.setData({
refresh: true
})
}
});
},
//生成DateMap值
......@@ -322,7 +350,7 @@ create.Page({
pushItem.duration = nextDateList.length;
for (let i = 1; i < nextDateList.length; i++) {
if (DateMap.has(nextDateList[i])) {
DateMap.get(nextDateList[i]).unshift({
DateMap.get(nextDateList[i]).push({
...pushItem,
isFewDays: i + 1,
isfirstDayOrEndDay: nextDateList.length - 1 === i ? "2" : "1" // 0 第一天,1中间的天,2结束的天
......@@ -782,7 +810,7 @@ create.Page({
maxClickCount--;
if (maxClickCount == 0) {
dd.alert({
content: "版本号222"
content: "0.0.11"
});
maxClickCount = 5;
}
......
......@@ -2,7 +2,7 @@ import create from 'dd-store';
import { checkFullScren } from "../../utils/checkFullScren";
import pageStore from './store';
import { getMeetingRoomAffairs, createMeetingTask, deleteMeetingTask, updateMeetingTask, uploadPermissions } from '../../api/request';
import { isParticipate, deleteSchedule, getScheduleDetail, getUserScheduleInTime, modifySchedule } from '../../api/request.js'
import { isParticipate, deleteSchedule, getScheduleDetail, getUserScheduleInTime, modifySchedule, getMeetingRoomRepeatAffairs } from '../../api/request.js'
import { throttle, getCreateShowTime } from './../../utils/utils.js'
import { observer } from '/utils/observer.js'
import { resolve } from 'path';
......@@ -10,6 +10,8 @@ create.Page({
store: pageStore,
useAll: true,
data: {
current: 1,
pages: 1,
isIPX: false,
$data: null,
affairLoading: true,
......@@ -106,7 +108,8 @@ create.Page({
editType: '',
confirmAttendance: null,
isExpand: false,
placeholder: ''
placeholder: '',
mrReserveStatus: ''
},
onShow() {
// this.conflictPeople()
......@@ -114,7 +117,7 @@ create.Page({
this.update()
}, 100)
if (this.store.data.isNeedReloadList) {
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.setData({
'conToastData.showToast': true,
'conToastData.title': '保存成功',
......@@ -153,10 +156,14 @@ create.Page({
editType: this.$store.data.updateInfo.updateType
})
} else {
if (this.$store.data.participatorList.length < 2) {
this.isChange(this.$store.data.updateInfo.updateType, 'only')
} else {
this.setData({
editType: this.$store.data.updateInfo.updateType,
'centerPopup.showCenterPopup': true
})
}
// this.isChange(this.$store.data.updateInfo.updateType, 'only')
}
} else {
......@@ -213,12 +220,6 @@ create.Page({
participatorUserId.push(value.participator.userId)
originUsersId.push(value.participator.userId)
originUsers.push(value.participator)
if (value.userId === getApp().globalData.userid) {
this.setData({
aheadTimes: !!value.aheadList ? value.aheadList : [],
'comListData.aheadTimesListId': !!value.aheadList ? value.aheadList : [-1]
})
}
}
}
for (let item of this.data.comListData.repeatList) {
......@@ -227,6 +228,9 @@ create.Page({
}
}
this.setData({
aheadTimes: !!res.data.data.aheadTimes ? res.data.data.aheadTimes : [],
'comListData.aheadTimesListId': !!res.data.data.aheadTimes ? res.data.data.aheadTimes : [-1],
mrReserveStatus: res.data.data.mrReserveStatus,
confirmAttendance: res.data.data.confirmAttendance === null ? -9 : res.data.data.confirmAttendance,
organizer: res.data.data.organizer,
'comListData.meetingWayModelId': res.data.data.meetingWayModel.model === null ? null : (res.data.data.meetingWayModel.model === 'dingtalk' ? 1 : 0),
......@@ -259,7 +263,7 @@ create.Page({
this.store.data.scheduleId = res.data.data.id;
this.store.data.groupId = res.data.data.groupId;
this.update();
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.resetRepeatList()
} else {
......@@ -320,6 +324,7 @@ create.Page({
reset() {
this.$store.resetEditData()
this.resetRepeatList()
this.store.data.affairList = [];
this.acrossDay(this.$store.data.startTime, this.$store.data.endTime)
},
// 跳转下一页
......@@ -351,10 +356,15 @@ create.Page({
editType: 'modify_location'
})
} else {
if (this.$store.data.participatorList.length < 2) {
this.isChange('modify_location', 'only')
} else {
this.setData({
editType: 'modify_location',
'centerPopup.showCenterPopup': true
})
}
}
break
case 'meetingWayModel':
......@@ -471,7 +481,15 @@ create.Page({
editType: 'repeat'
})
} else {
if (this.$store.data.participatorList.length < 2) {
this.isChange('repeat', 'only')
} else {
this.setData({
editType: 'repeat',
'centerPopup.showCenterPopup': true
})
}
}
break;
}
......@@ -594,10 +612,14 @@ create.Page({
editType: 'modify_time'
})
} else {
if (this.$store.data.participatorList.length < 2) {
this.isChange('modify_time', 'only')
} else {
this.setData({
editType: 'modify_time',
'centerPopup.showCenterPopup': true
})
}
// this.isChange('modify_time', 'only')
}
},
......@@ -704,10 +726,14 @@ create.Page({
const _that = this
switch (this.data.conSelectPopupData.selectType) {
case 'common':
if (this.data.editType === 'modify_location' || this.data.editType === 'modify_time') {
if (this.data.editType === 'modify_location' || this.data.editType === 'modify_time' || this.data.editType === 'repeat') {
if (this.$store.data.participatorList.length < 2) {
this.isChange(this.data.editType, event.currentTarget.dataset.item.id)
} else {
this.setData({
'centerPopup.showCenterPopup': true
})
}
} else {
this.isChange(this.data.editType, event.currentTarget.dataset.item.id)
}
......@@ -744,6 +770,8 @@ create.Page({
this.$store.data.indexNeedUpdate = true
this.update()
this.setData({
aheadTimes: [15],
'comListData.aheadTimesListId': [15],
confirmAttendance: 1
})
this.conflictPeople()
......@@ -874,13 +902,14 @@ create.Page({
modifyModel: modifyModel,
modifyContent: 'title'
}
this.modifySchedule(dataTitle).catch(err => {
this.modifySchedule(dataTitle).then(res => {
this.$store.data.isIndexAffairListNeedUpdate = true
this.$store.data.originalData.title = this.data.title
this.update()
}).catch(err => {
this.setData({
title: this.$store.data.originalData.title
})
}).then(res => {
this.$store.data.originalData.title = this.data.title
this.update()
})
}
break
......@@ -891,13 +920,13 @@ create.Page({
modifyModel: modifyModel,
modifyContent: 'remark'
}
this.modifySchedule(dataRemark).catch(err => {
this.modifySchedule(dataRemark).then(res => {
this.$store.data.originalData.remark = this.data.remark
this.update()
}).catch(err => {
this.setData({
remark: this.$store.data.originalData.remark
})
}).then(res => {
this.$store.data.originalData.remark = this.data.remark
this.update()
})
}
break
......@@ -907,13 +936,13 @@ create.Page({
modifyModel: modifyModel,
modifyContent: 'meeting_way'
}
this.modifySchedule(dataWay).catch(err => {
this.modifySchedule(dataWay).then(res => {
this.$store.data.originalData.meetingWay = !!this.data.comListData.meetingWayModelId ? this.data.comListData.meetingWayList[this.data.comListData.meetingWayModelId] : null
this.update()
}).catch(err => {
this.setData({
'comListData.meetingWayModelId': this.$store.data.originalData.meetingWayModel === null ? null : (this.$store.data.originalData.meetingWayModel.model === 'dingtalk' ? 2 : (this.$store.data.originalData.meetingWayModel.model === 'zoom' ? 1 : 0))
})
}).then(res => {
this.$store.data.originalData.meetingWay = !!this.data.comListData.meetingWayModelId ? this.data.comListData.meetingWayList[this.data.comListData.meetingWayModelId] : null
this.update()
})
break
case 'operate_user':
......@@ -926,17 +955,17 @@ create.Page({
modifyModel: modifyModel,
modifyContent: 'operate_user'
}
this.modifySchedule(dataUser, needNotice).catch(err => {
this.$store.data.participatorList = this.$store.data.originUsers
this.$store.data.participatorUserId = this.$store.data.originUsersId
this.modifySchedule(dataUser, needNotice).then(res => {
this.$store.data.originUsers = this.$store.data.participatorList
this.$store.data.originUsersId = this.$store.data.participatorUserId
this.$store.data.updateInfo = {
updateType: '',
isUpate: false
}
this.update()
}).then(res => {
this.$store.data.originUsers = this.$store.data.participatorList
this.$store.data.originUsersId = this.$store.data.participatorUserId
}).catch(err => {
this.$store.data.participatorList = this.$store.data.originUsers
this.$store.data.participatorUserId = this.$store.data.originUsersId
this.$store.data.updateInfo = {
updateType: '',
isUpate: false
......@@ -962,17 +991,17 @@ create.Page({
recurrenceModel: this.data.recurrenceModel,
repeatable: this.data.repeatable
}
this.modifySchedule(dataRepeat1).catch(err => {
this.modifySchedule(dataRepeat1).then(res => {
observer.notice(res.data.data)
this.$store.data.originalData.recurrenceModel = this.data.recurrenceModel
this.$store.data.originalData.repeatable = this.data.repeatable
this.update()
}).catch(err => {
this.setData({
'comListData.comSelectListId': this.$store.data.originalData.recurrenceModel.model === 'weekly' ? (this.$store.data.originalData.recurrenceModel.weekDayList.length > 1 ? 3 : 2) : repeatListMap.get(this.$store.data.originalData.recurrenceModel.model),
repeatable: this.$store.data.originalData.repeatable,
recurrenceModel: this.$store.data.originalData.repeatable ? { model: this.storer.data.originalData.recurrenceModel.model, daysOfMonth: this.$store.data.originalData.recurrenceModel.daysOfMonth, interval: 1, initialTime: this.$store.data.originalData.recurrenceModel.initialTime, terminateTime: this.$store.data.originalData.recurrenceModel.terminateTime, weekDayList: this.$store.data.originalData.recurrenceModel.weekDayList } : { model: 'no_repeat' }
})
}).then(res => {
observer.notice(res.data.data)
this.$store.data.originalData.recurrenceModel = this.data.recurrenceModel
this.$store.data.originalData.repeatable = this.data.repeatable
this.update()
})
}
else if (this.$store.data.originalData.repeatable === 1 && this.data.repeatable === 0) {
......@@ -984,16 +1013,16 @@ create.Page({
recurrenceModel: this.data.recurrenceModel,
repeatable: this.data.repeatable
}
this.modifySchedule(dataRepeat2).catch(err => {
this.modifySchedule(dataRepeat2).then(res => {
this.$store.data.originalData.recurrenceModel = this.data.recurrenceModel
this.$store.data.originalData.repeatable = this.data.repeatable
this.update()
}).catch(err => {
this.setData({
'comListData.comSelectListId': this.$store.data.originalData.recurrenceModel.model === 'weekly' ? (this.$store.data.originalData.recurrenceModel.weekDayList.length > 1 ? 3 : 2) : repeatListMap.get(this.$store.data.originalData.recurrenceModel.model),
repeatable: this.$store.data.originalData.repeatable,
recurrenceModel: this.$store.data.originalData.repeatable ? { model: this.$store.data.originalData.recurrenceModel.model, daysOfMonth: this.$store.data.originalData.recurrenceModel.daysOfMonth, interval: 1, initialTime: this.$store.data.originalData.recurrenceModel.initialTime, terminateTime: this.$store.data.originalData.recurrenceModel.terminateTime, weekDayList: this.$store.data.originalData.recurrenceModel.weekDayList } : { model: 'no_repeat' }
})
}).then(res => {
this.$store.data.originalData.recurrenceModel = this.data.recurrenceModel
this.$store.data.originalData.repeatable = this.data.repeatable
this.update()
})
}
else {
......@@ -1005,15 +1034,15 @@ create.Page({
recurrenceModel: this.data.recurrenceModel,
repeatable: this.data.repeatable
}
this.modifySchedule(dataRepeat3).catch(err => {
this.modifySchedule(dataRepeat3).then(res => {
this.$store.data.originalData.recurrenceModel = this.data.recurrenceModel
this.$store.data.originalData.repeatable = this.data.repeatable
this.update()
}).catch(err => {
this.setData({
'comListData.comSelectListId': this.$store.data.originalData.recurrenceModel.model === 'weekly' ? (this.$store.data.originalData.recurrenceModel.weekDayList.length > 1 ? 3 : 2) : repeatListMap.get(this.$store.data.originalData.recurrenceModel.model),
repeatable: this.$store.data.originalData.repeatable
})
}).then(res => {
this.$store.data.originalData.recurrenceModel = this.data.recurrenceModel
this.$store.data.originalData.repeatable = this.data.repeatable
this.update()
})
}
break
......@@ -1028,11 +1057,7 @@ create.Page({
},
meetingRoomId: !!this.$store.data.roomId ? this.$store.data.roomId : -1
}
this.modifySchedule(dataLocation, needNotice).catch(err => {
this.$store.data.locationName = this.$store.data.originalData.location.locationName
this.$store.data.roomId = this.$store.data.originalData.meetingRoomId
this.update()
}).then(res => {
this.modifySchedule(dataLocation, needNotice).then(res => {
this.$store.data.originalData.location = {
longitude: '-999',
latitude: '-999',
......@@ -1050,7 +1075,10 @@ create.Page({
this.isChange('modify_time', modifyModel, needNotice)
}
}).catch(err => {
this.$store.data.locationName = this.$store.data.originalData.location.locationName
this.$store.data.roomId = this.$store.data.originalData.meetingRoomId
this.update()
})
break
case 'modify_time':
......@@ -1060,14 +1088,7 @@ create.Page({
endTime: this.$store.data.endTime.replace(/\//g, "-"),
modifyContent: 'modify_time'
}
this.modifySchedule(data, needNotice).catch(err => {
this.$store.data.startTime = this.$store.data.originalData.startTime.replace(/'-'/g, '/')
this.$store.data.endTime = this.$store.data.originalData.endTime.replace(/'-'/g, '/')
this.update()
this.setData({
week: this.data.weekList[new Date(this.$store.data.originalData.startTime.replace(/-/g, "/")).getDay()],
})
}).then(res => {
this.modifySchedule(data, needNotice).then(res => {
this.$store.data.originalData.startTime = this.$store.data.startTime.replace(/\//g, "-")
this.$store.data.originalData.endTime = this.$store.data.endTime.replace(/\//g, "-")
this.update()
......@@ -1103,6 +1124,13 @@ create.Page({
}
// this.modifySchedule(data, needNotice)
}).catch(err => {
this.$store.data.startTime = this.$store.data.originalData.startTime.replace(/-/g, '/')
this.$store.data.endTime = this.$store.data.originalData.endTime.replace(/-/g, '/')
this.update()
this.setData({
week: this.data.weekList[new Date(this.$store.data.originalData.startTime.replace(/-/g, "/")).getDay()],
})
})
break
case 'aheadTimes':
......@@ -1111,13 +1139,13 @@ create.Page({
aheadTimes: this.data.aheadTimes,
modifyContent: 'aheadTimes'
}
this.modifySchedule(dataAheadTimes).catch(err => {
this.modifySchedule(dataAheadTimes).then(res => {
this.$store.data.originalData.aheadTimes = (this.data.aheadTimes.length === 0 ? null : this.data.aheadTimes)
this.update()
}).catch(err => {
this.setData({
aheadTimes: this.$store.data.originalData.aheadTimes
})
}).then(res => {
this.$store.data.originalData.aheadTimes = (this.data.aheadTimes.length === 0 ? null : this.data.aheadTimes)
this.update()
})
break
}
......@@ -1216,6 +1244,8 @@ create.Page({
this.$store.data.indexNeedUpdate = true
this.update()
this.setData({
aheadTimes: [15],
'comListData.aheadTimesListId': [15],
confirmAttendance: 1
})
this.conflictPeople()
......@@ -1278,11 +1308,114 @@ create.Page({
// 页面被关闭
observer.unregister()
},
//获取动态列表
reload(id) {
loadAffairList(current = 1) {
if (this.data.repeatable == 1) {
this.getRepeatAffairList(this.data.scheduleItem.groupId, current)
} else {
this.getAffairList(this.data.scheduleItem.id)
}
//重置
this.store.data.isNeedReloadList = false;
this.update();
},
//获取单次会议动态列表
getAffairList(id) {
getMeetingRoomAffairs(id).then(res => {
const affairList = res.data.data || [];
const newAffairList = affairList.map(it => {
const newAffairList = this.dealAffairData(res.data.data || []);
this.store.data.affairList = newAffairList;
this.update();
this.setData({
affairLoading: false
});
})
},
//获取重复会议动态列表
getRepeatAffairList(groupId, current) {
getMeetingRoomRepeatAffairs(groupId, current).then(res => {
const newAffairList = this.dealRepeatAffairs(res.data.data.records || []);
//第一页数据会重新请求需要替换
if (current === 1) {
this.store.data.affairList = newAffairList;
this.update();
} else {
const newDynamicList = this.store.data.affairList.concat(newAffairList);
this.store.data.affairList = newDynamicList;
this.update();
}
this.setData({
affairLoading: false,
current: res.data.data.current,
pages: res.data.data.pages
});
})
},
//加载之前的会议动态
loadAffairMore() {
if (this.data.current < this.data.pages) {
this.loadAffairList(this.data.current + 1);
}
},
//处理重复会议动态数据
dealRepeatAffairs(affairList, type) {
// const newAffairData = {};
// const newAffairList = [];
// affairList.forEach(it => {
// if (it.meetingLogResource) {
// newAffairData[it.resourceId] = []
// }
// })
return affairList.map(item => {
let itemData = item.meetingLogResource;
if (itemData) {
if (item.createTime) {
item.sort1 = item.createTime
item.sort = new Date(item.createTime.replace(/-/g, '/')).getTime();
item.createTime = getCreateShowTime(item.createTime);
}
if (itemData.acceptorInfo) {
itemData.acceptorInfo = JSON.parse(itemData.acceptorInfo);
}
if (itemData.creatorInfo) {
itemData.creatorInfo = JSON.parse(itemData.creatorInfo);
}
if (itemData.fileInfos) {
item.fileView = {
fileInfos: JSON.parse(itemData.fileInfos),
creatorInfo: itemData.creatorInfo
};
}
if (itemData.taskInfos) {
item.taskViewList = [
{
acceptorInfo: itemData.acceptorInfo,
acceptorId: itemData.acceptorId,
creatorInfo: itemData.creatorInfo,
creatorId: itemData.creatorId,
taskInfos: JSON.parse(itemData.taskInfos),
taskStatus: itemData.taskStatus,
id: itemData.id
}
]
}
// newAffairData[item.resourceId].push(item);
}
return item
});
// console.log(newAffairData);
// for (let i in newAffairData) {
// newAffairData[i].sort((a, b) => a.sort - b.sort);
// newAffairList.push(newAffairData[i][0])
// }
// console.log(newAffairList)
// return newAffairList.sort((a, b) => a.sort - b.sort);
},
//处理会议动态数据
dealAffairData(affairList) {
return affairList.map(it => {
if (it.createTime) {
it.createTime = getCreateShowTime(it.createTime);
}
......@@ -1312,15 +1445,6 @@ create.Page({
}
return it
})
this.store.data.affairList = newAffairList;
this.setData({
affairLoading: false
});
//重置
this.store.data.isNeedReloadList = false;
this.update();
})
},
showPop(e) {
this.setData({
......@@ -1361,7 +1485,7 @@ create.Page({
//刷新列表,这里为什么不在promie后执行
setTimeout(() => {
if (this.store.data.isNeedReloadList) {
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.setData({
'conToastData.showToast': true,
'conToastData.title': '编辑成功',
......@@ -1431,7 +1555,7 @@ create.Page({
"resourceType": "accessory",
"id": id
}, () => {
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
})
......@@ -1467,6 +1591,21 @@ create.Page({
"taskInfos": JSON.stringify(this.store.data.currentTask.taskInfos)
})
},
//重复任务状态处理
dealRepeatStatus(task) {
let dataIndex = "";
this.data.affairList.forEach((item, index) => {
if (item.meetingLogResource.id == task.id) {
dataIndex = index;
}
});
const setData = `affairList[${dataIndex}].taskViewList[0].taskStatus`;
const setData2 = `affairList[${dataIndex}].meetingLogResource.taskStatus`;
this.store.data[setData] = task.status;
this.store.data[setData2] = task.status;
this.update();
},
//列表修改任务状态
changeTaskStatusOnList(task) {
this.updateTask({
......@@ -1474,7 +1613,11 @@ create.Page({
"taskStatus": task.status,
'id': task.id
}, () => {
this.reload(this.data.scheduleItem.id);
if (this.data.repeatable == 1) {
this.dealRepeatStatus(task);
} else {
this.loadAffairList();
}
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
})
......@@ -1484,6 +1627,12 @@ create.Page({
this.updateTask({
"logType": "task_status_modify",
"taskStatus": this.store.data.currentTask.taskStatus
}, () => {
if (this.data.repeatable == 1) {
this.dealRepeatStatus({ status: this.store.data.currentTask.taskStatus, id: this.store.data.currentTask.id });
}
this.store.data.isNeedReloadList = true;
this.update();
})
},
//删除任务
......@@ -1492,7 +1641,7 @@ create.Page({
"logType": "task_remove",
}, () => {
this.closePop();
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
})
......@@ -1539,7 +1688,7 @@ create.Page({
}
createMeetingTask(postData).then(res => {
if (res.data.code == 0) {
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.closePop();
this.setData({
'conToastData.showToast': true,
......@@ -1553,14 +1702,7 @@ create.Page({
this.update();
}
})
}),
// throttle
// complete() {
// debugger
// },
//
expand() {
this.setData({
isExpand: false
......
......@@ -77,26 +77,23 @@ create.Page({
parentStr: "",
onLoad(query) {
let date = new Date(this.$store.data.startTime.replace(/-/g, "/"));
// let date = new Date();
let year = date.getFullYear();
let month = padZero(date.getMonth() + 1);
let day = padZero(date.getDate());
let hour = padZero(date.getHours());
let minute = padZero(date.getMinutes());
let todayTime = `${year}/${padZero(date.getMonth() + 1)}/${padZero(
date.getDate()
)}`;
let tomorrowTime = new Date(date);
let toDayDate = new Date();
let tomorrowTime = new Date(toDayDate);
tomorrowTime.setDate(tomorrowTime.getDate() + 1);
let afterTomorrowTime = new Date(date);
let afterTomorrowTime = new Date(toDayDate);
afterTomorrowTime.setDate(afterTomorrowTime.getDate() + 2);
this.setData({
"search.time": `${year}-${month}-${day}`,
"TimeSlot.todayTime": todayTime,
"TimeSlot.tomorrowTime": `${year}/${padZero(
"TimeSlot.todayTime": `${toDayDate.getFullYear()}/${padZero(
toDayDate.getMonth() + 1
)}/${padZero(toDayDate.getDate())}`,
"TimeSlot.tomorrowTime": `${tomorrowTime.getFullYear()}/${padZero(
tomorrowTime.getMonth() + 1
)}/${padZero(tomorrowTime.getDate())}`,
"TimeSlot.afterTomorrowTime": `${year}/${padZero(
"TimeSlot.afterTomorrowTime": `${afterTomorrowTime.getFullYear()}/${padZero(
afterTomorrowTime.getMonth() + 1
)}/${padZero(afterTomorrowTime.getDate())}`,
userId: getApp().globalData.userid
......@@ -1266,6 +1263,10 @@ create.Page({
};
getReserveRoomList(data).then(res => {
if (res.data.data) {
for (let value of res.data.data) {
value.name = `${this.getParentStr(value.locationId)}${value.name}`;
this.parentStr = "";
}
let reserveRoomList = res.data.data.map(item => {
let startTime = parseInt(
item.timeSlotWithMeetingVOS[0].reserveStartTime.substring(0, 2)
......
......@@ -30,7 +30,7 @@ create.Page({
unbind() {
unbindingApp(this.data.item.platform).then(res => {
if (res.data.data) {
this.$store.data.relatedAppNeedUpdate = "1";
this.$store.data.relatedAppNeedUpdate = true;
this.update();
dd.navigateBack({
delta: 1
......
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