Commit aa7bf2a9 by xiexiaoqin

任务相关接口对接

parent 91dd8c3a
......@@ -17,8 +17,8 @@ Component({
didMount() {
this.getPages(1)
},
didUpdate() {},
didUnmount() {},
didUpdate() { },
didUnmount() { },
methods: {
getPages(current) {
let that = this
......@@ -27,13 +27,16 @@ Component({
size: 10
}
getDynamicList(data).then(res => {
if (!res.data.data) {
return
}
// 第一层日程数据处理
let dynamicList = res.data.data.records.map((item,index) => {
let dynamicList = res.data.data.records.map((item, index) => {
// 第二层日程下的动态数据处理
let meetingLogResourceList = item.meetingLogDataList.map((item2,index2) => {
let meetingLogResourceList = item.meetingLogDataList.map((item2, index2) => {
if (item2.category === '2') {
// 第三层处理动态下的文件或者任务数据
let meetingLogResourceList = item2.meetingLogResourceList.map((item3,index3) => {
let meetingLogResourceList = item2.meetingLogResourceList.map((item3, index3) => {
return {
...item3,
fileInfos: item3.fileInfos ? JSON.parse(item3.fileInfos) : ''
......@@ -73,11 +76,11 @@ Component({
}
})
},
touchstart(e){
touchstart(e) {
this.setData({
startX: e.changedTouches[0].clientX,
startY: e.changedTouches[0].clientY,
isTouchMove : this.data.isTouchMove ? !this.data.isTouchMove : this.data.isTouchMove
isTouchMove: this.data.isTouchMove ? !this.data.isTouchMove : this.data.isTouchMove
})
},
touchmove(e) {
......@@ -91,18 +94,18 @@ Component({
var isTouchMove
//滑动超过30度角 return
if (Math.abs(angle) > 30) return;
if (touchMoveX > startX){ //右滑
if (touchMoveX > startX) { //右滑
isTouchMove = false
}else{ //左滑
} else { //左滑
isTouchMove = true
}
//更新数据
that.setData({
isTouchMove : isTouchMove,
isTouchMove: isTouchMove,
touchMoveId: e.currentTarget.dataset.id
})
},
angle (start, end) {
angle(start, end) {
var _X = end.X - start.X,
_Y = end.Y - start.Y
//返回角度 /Math.atan()返回数字的反正切值
......
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,13 @@ export default function http (data) {
method: data.method,
dataType: 'json',
data: data.data,
success: function(res) {
resolve(res)
success: function (res) {
if (res.data.code == 0) {
resolve(res);
}
},
fail: function(res) {
fail: function (res) {
rejects(res)
console.log(res)
}
......@@ -24,10 +27,12 @@ export default function http (data) {
} else {
return new Promise((resolve, rejects) => {
login().then(res => {
const { oapiUser } = res.data.data;
getApp().globalData.token = res.data.data.accessToken.access_token
getApp().globalData.name = res.data.data.oapiUser.name
getApp().globalData.userid = res.data.data.oapiUser.userid
getApp().globalData.avatar = res.data.data.oapiUser.avatar
getApp().globalData.userInfo = JSON.stringify({ username: oapiUser.name, userId: oapiUser.userid, headUrl: oapiUser.avatar, "platform": "dingtalk" })
dd.httpRequest({
headers: {
"Content-Type": "application/json",
......@@ -37,10 +42,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)
}
})
......
......@@ -248,49 +248,33 @@ export function isParticipate(data) {
export function getMeetingRoomAffairs(id) {
return $http({
method: 'get',
url: `/meet/meeting-log/datail/4902`
url: `/meet/meeting-log/detail/${id}`
})
}
//会议室创建新任务
export function createMeetingTask() {
export function createMeetingTask(data) {
return $http({
method: 'post',
data: JSON.stringify(data),
url: `/meet/schedule/confirm`
})
}
// 修改任务状态
export function updateTaskStatus() {
return $http({
method: 'put',
data: JSON.stringify(data),
url: `/meet/schedule/confirm`
})
}
// 修改任务标题
export function updateTaskTitle() {
return $http({
method: 'put',
data: JSON.stringify(data),
url: `/meet/schedule/confirm`
url: `/meet/meeting-log-resource/save`
})
}
// 添加任务执行人
export function addTaskExcutor() {
//会议室修改任务
export function updateMeetingTask(data) {
return $http({
method: 'post',
data: JSON.stringify(data),
url: `/meet/schedule/confirm`
url: `/meet/meeting-log-resource/update`
})
}
//删除任务
export function deleteMeetingTask() {
export function deleteMeetingTask(id) {
return $http({
method: 'delete',
data: JSON.stringify(data),
url: `/meet/schedule/confirm`
method: 'get',
url: `/meet/meeting-log-resource/remove/${id}`
})
}// 测试的首页api
}
// 测试的首页api
export function getHomeUserSchedule1(data) {
return $http({
method: 'POST',
......
......@@ -19,6 +19,7 @@ App({
avatar: '',
userid: '',
name: '',
userInfo: '',
// globalUrl:'https://gateway2.mingwork.com', // 线上地址
globalUrl: 'https://gateway-beta.mingwork.com' //beta地址
// globalUrl:'http://139.196.213.18:9999' //beta地址
......
{
"pages": [
"pages/meetingDetail/meetingDetail",
"pages/index/index",
"demo/index/index",
"pages/meetingDetail/meetingDetail",
"pages/excutorList/excutorList",
"demo/sideslipping/sideslipping",
"pages/index/index",
"pages/editMeeting/editMeeting",
"pages/createMeeting/createMeeting",
"pages/outLookContact/outLookContact",
......@@ -21,7 +21,6 @@
"pages/participantsDetail/participantsDetail",
"pages/createOrEditSchedule/createOrEditSchedule",
"pages/applicationDetails/applicationDetails",
"pages/attendeeList/attendeeList",
"pages/scheduleList/scheduleList"
"pages/attendeeList/attendeeList"
]
}
\ No newline at end of file
......@@ -35,9 +35,7 @@ Component({
cancelButtonText: '取消',
success: (res) => {
if (res.confirm) {
// delFile().then(res => {
// this.props.onReload();
// })
this.props.deleteTaskFile()
}
}
})
......@@ -48,6 +46,5 @@ Component({
})
dd.navigateTo({ url: `./../editFile/editFile?file=${JSON.stringify(e.target.dataset.file)}` })
}
},
});
......@@ -2,9 +2,9 @@
<import src="../../template/checkbox/index.axml"/>
<view class="task-list">
<view class="task-box" a:for='{{taskList}}'>
<template is="checkbox" data="{{status: item.taskStatus}}"></template>
<template is="checkbox" data="{{ status: item.taskStatus, id: item.id }}"></template>
<view class="task-title" data-pop="{{title: '会议任务', type: 'updateTask'}}" onTap="showPop" data-task="{{item}}">{{item.taskInfos.taskTitle}}
<template is="avater" data="{{item: item.acceptorInfo}}"/>
<template is="avater" a:if="{{item.acceptorInfo}}" data="{{item: item.acceptorInfo}}"/>
</view>
</view>
</view>
\ No newline at end of file
// import create from 'dd-store';
// import pageStore from '../../pages/meetingDetail/store';
Component({
// store: pageStore,
mixins: [],
data: {
show: false,
// currentTask: null,
// actionList: null
show: false
},
props: {
isCanEdit: true
......@@ -19,7 +14,6 @@ Component({
methods: {
showPop(e) {
if (this.props.isCanEdit) {
console.log(e.target.dataset.task)
this.props.onShowPop(e);
this.props.onSetCurrentTask(e.target.dataset.task);
}
......@@ -29,8 +23,14 @@ Component({
show: false
})
},
CheckChange(e) {
this.props.onCheckChange(e.detail.value)
checkChange(e) {
let { status, id } = e.target.dataset;
if (status == '0') {
status = '1'
} else {
status = '0'
}
this.props.onChangeTaskStatusOnList({ status, id })
}
},
});
......@@ -3,14 +3,14 @@
<import src="../../template/checkbox/index.axml"/>
<view a:if="{{action == 'create'}}" class="picker-complete" onTap='complete'>完成</view>
<view class="task-column edit-column">
<template a:if="{{action == 'update'}}" is="checkbox" data="{{status: currentTask.taskStatus}}"></template>
<input onBlur="inputChange" value="{{currentTask.taskInfos.taskTitle}}" placeholder="请输入任务标题"/>
<template a:if="{{action == 'update'}}" is="checkbox" data="{{status: currentTask.taskStatus, id:currentTask.id}}"></template>
<input onInput="inputChange" value="{{currentTask.taskInfos.taskTitle}}" placeholder="请输入任务标题"/>
</view>
<view class="margin-bottom">
<view class="task-column participator-top">
<text class="iconicon_attender iconfont icon"></text>
<text class="participator-title">{{currentTask.acceptorInfo ? '执行人' : '设置执行人'}}</text>
<text class="iconright iconfont icon" data-acceptorInfo="{{currentTask.acceptorInfo}}" onTap="handleExcutorChange"></text>
<text class="iconright iconfont icon" data-acceptorId="{{currentTask.acceptorId}}" onTap="handleExcutorChange"></text>
</view>
<view class="participator-bottom" a:if="{{currentTask.acceptorInfo}}">
<view class="people">
......
Component({
import create from 'dd-store';
import pageStore from '../../pages/meetingDetail/store';
import { debounce } from '../../utils/utils';
create.Component({
store: pageStore,
mixins: [],
data: {
task: {
title: '',
excutor: '',
}
currentTask: null //store
},
props: {
currentTask: {},
action: 'update'
action: ''
},
didMount() {
console.log(this.props)
},
didUpdate() { },
didUnmount() { },
didUpdate() {
},
didUnmount() {
},
methods: {
//编辑才有
CheckChange(e) {
const status = e.target.dataset.status;
if (status !== this.props.currentTask.status) {
this.props.onCheckChange(status);
//编辑
checkChange(e) {
let { status, id } = e.target.dataset;
if (status == '0') {
status = '1'
} else {
status = '0'
}
this.store.data.currentTask.taskStatus = status;
this.update();
// this.props.onCheckChange({ status, id });
},
inputChange(e) {
//更新操作立即保存
const value = e.detail.value;
if (this.props.action === 'update') {
if (value !== this.props.currentTask.title) {
return this.props.onInputChange(e.detail.value);
}
}
// 创建操作保存到data
if (value) {
this.setData({
'task.title': value
});
this.store.data.currentTask.taskInfos = { taskTitle: value };
this.update();
}
},
// inputChange: debounce(function (e) {
// const value = e.detail.value;
// if (value) {
// this.store.data.currentTask.taskInfos = { taskTitle: value };
// this.update();
// //更新要调用更新接口
// // if (this.props.action === 'update') {
// // if (value !== this.props.oldTask.taskInfos.taskTitle) {
// // this.store.data.isEditTaskTitle = true;
// // // this.props.onInputChange(value);
// // }
// // }
// }
// }, 1000),
handleExcutorChange(e) {
const acceptorInfo = e.target.dataset.acceptorInfo;
//执行人页面可删除执行人
if (acceptorInfo) {
dd.navigateTo({ url: `../../pages/excutorList/excutorList?acceptorInfo=${JSON.stringify(acceptorInfo)}&action=${this.props.action}` })
//执行人页面删除执行人
if (e.target.dataset.acceptorId) {
dd.navigateTo({ url: `../../pages/excutorList/excutorList` })
}
//参会人列表页面选择参会人
//参会人列表页面选择参会人
else {
dd.navigateTo({ url: `../../pages/attendeeList/attendeeList?action=${this.props.action}` })
dd.navigateTo({ url: `../../pages/attendeeList/attendeeList` })
}
},
//新建才有完成按钮
complete() {
const { task } = this.data;
if (!task.title) {
const { currentTask } = this.store.data;
if (!currentTask.taskInfos) {
return
}
console.log(task)
this.props.onComplete(task)
this.props.onComplete()
},
//删除任务
handleDelete() {
......@@ -70,11 +78,10 @@ Component({
cancelButtonText: '取消',
success: (res) => {
if (res.confirm) {
this.props.onDeleteTask(task)
this.props.onDeleteTask()
}
}
})
}
},
});
<import src="../../template/avater/index.axml"/>
<view class="column" a:for="{{$data.participatorList}}">
<template is="radio" data="{{status: item.userId == userId, userId: item.userId}}"/>
<template is="radio" data="{{status: item.userId == currentTask.acceptorId, item: item}}"/>
<template is="avater" data="{{item}}"/>
<view class="name">{{item.username}}</view>
</view>
<!-- radio模板 {status: status, userId: userId}-->
<template name='radio'>
<view class="radio {{status ? 'radio-checked' : 'radio-uncheck'}}" data-userId="{{userId}}" onTap="radioChange">
<view class="radio {{status ? 'radio-checked' : 'radio-uncheck'}}" data-item="{{item}}" onTap="radioChange">
<text a:if="{{status}}" class="iconfont iconicon_ok"></text>
</view>
</template>
\ No newline at end of file
......@@ -8,38 +8,24 @@ create.Page({
$data: {
participatorList: null,
},
action: '',
excutor: '' //store
currentTask: null, //store
// action: ''
},
onLoad(query) {
console.log(this)
const { user, action } = query;
console.log('onLoad')
console.log(query)
this.setData({
...query
})
// this.setData({
// action: query.action
// })
},
radioChange(e) {
const userId9 = e.target.dataset.userId;
this.setData({
userId
});
const item = e.target.dataset.item;
this.store.data.currentTask.acceptorInfo = item;
this.store.data.currentTask.acceptorId = item.userId;
//更新页面,执行添加执行人操作
if (this.data.action == 'update') {
addTaskExcutor().then(res => {
getMeetingRoomAffairs().then(res => {
this.store.data.affairList = res.data.data;
this.update();
})
})
}
// 创建页面保存选中的执行人
else if (this.data.action == 'create') {
this.store.data.excutor = userId;
// //更新保存添加标示
// if (this.data.action == 'update') {
// this.store.data.isAddAcceptorInfo = true;
// }
this.update();
dd.navigateBack();
}
}
});
<import src="../../template/avater/index.axml"/>
<view class="column">
<template is="avater" data="{{item: acceptorInfo}}"/>
<view class="name">{{acceptorInfo.username}}
<view class="column" a:if="{{item: currentTask.acceptorInfo}}">
<template is="avater" data="{{item: currentTask.acceptorInfo}}"/>
<view class="name">{{currentTask.acceptorInfo.username}}
<text class="iconfont iconicon_close" onTap="deleteExcutor"></text>
</view>
</view>
\ No newline at end of file
......@@ -3,18 +3,15 @@ import pageStore from '../meetingDetail/store';
create.Page({
store: pageStore,
data: {
action: "",
acceptorInfo: ''
// action: "",
currentTask: '',//store
},
onLoad(query) {
this.setData({
action: query.action,
acceptorInfo: JSON.parse(query.acceptorInfo)
})
// this.setData({
// action: query.action
// })
},
deleteExcutor() {
//编辑调用删除接口
if (this.data.action == 'update') {
dd.confirm({
title: '删除执行人',
content: '确认删除执行人吗?',
......@@ -22,15 +19,17 @@ create.Page({
cancelButtonText: '取消',
success: (res) => {
if (res.confirm) {
this.store.data.currentTask.acceptorInfo = null;
this.store.data.currentTask.acceptorId = '';
// //更新保存添加标示
// if (this.data.action == 'update') {
// this.store.data.isDeleteAcceptorInfo = true;
// }
this.update();
dd.navigateBack();
}
}
})
}
//更新通知任务模板
else {
}
});
}
});
......@@ -288,7 +288,8 @@ Page({
},
nextDetail: throttle(function (e) {
let item = e.target.dataset.item
dd.navigateTo({ url: `./../editMeeting/editMeeting?scheduleItem=${JSON.stringify(item)}` })
// dd.navigateTo({ url: `./../editMeeting/editMeeting?scheduleItem=${JSON.stringify(item)}` });
dd.navigateTo({ url: `./../meetingDetail/meetingDetail?scheduleItem=${JSON.stringify(item)}` })
}, 1000),
// nextPage: throttle(function (e) {
// console.log(11111111)
......
<import src="../../template/avater/index.axml"/>
<view class="list">
<block a:for="{{affairList}}">
<view a:if="{{item.logType == 'task_add' && item.taskViewList}}" class='compose-column'>
<view a:if="{{item.category == '3' && item.taskViewList}}" class='compose-column'>
<view class="avater task-avater">
<text class="iconfont iconicon_task1"></text>
</view>
......@@ -9,9 +9,9 @@
会议任务
<text>{{item.createTime}}</text>
</view>
<task-list onShowPop="showPop" onSetCurrentTask="setCurrentTask" taskList="{{item.taskViewList}}" onCheckChange="checkChange"/>
<task-list onShowPop="showPop" onSetCurrentTask="setCurrentTask" taskList="{{item.taskViewList}}" onChangeTaskStatusOnList="changeTaskStatusOnList"/>
</view>
<view a:if="{{item.logType == 'schedule_accessory_add' && item.fileView.fileInfos}}" class='compose-column'>
<view a:if="{{item.logType == '2' && item.fileView.fileInfos}}" class='compose-column'>
<template is="avater" data="{{item: item.fileView.creatorInfo}}"/>
<view class="title">
{{item.fileView.creatorInfo.username}}
......@@ -26,17 +26,20 @@
</block>
</view>
<view class="footer">
<view onTap="showPop" data-pop="{{title: '创建任务', type: 'createTask'}}">
<text class="iconfont iconicon_task1"></text>任务</view>
<view>
<text class="iconfont iconicon_data"></text>文件</view>
<view onTap="showCreateTask" data-pop="{{title: '创建任务', type: 'createTask'}}">
<text class="iconfont iconicon_task1"></text>任务
</view>
<view onTap="addMeetingFile">
<text class="iconfont iconicon_data"></text>文件
</view>
<text class="devider"></text>
<view>
<text class="iconfont iconicon_share1"></text></view>
<text class="iconfont iconicon_share1"></text>
</view>
</view>
<popup show="{{show}}" onClose="closePop" title="{{pop.title}}">
<!-- 任务创建弹出框 -->
<task-panel a:if="{{pop.type === 'createTask'}}" onComplete="Complete" action='create'/>
<task-panel a:if="{{pop.type === 'createTask'}}" onComplete="complete" action='create'/>
<!-- 任务修改弹出框 -->
<task-panel a:if="{{pop.type === 'updateTask'}}" action='update' currentTask="{{currentTask}}" onDeleteTask="deleteTask" onInputChange="inputChange" onCheckChange="checkChange"/>
<task-panel a:if="{{pop.type === 'updateTask'}}" action='update' onDeleteTask="deleteTask"/>
</popup>
\ No newline at end of file
import create from 'dd-store';
import pageStore from './store';
import { getMeetingRoomAffairs, createMeetingTask, deleteMeetingTask, updateTaskTitle, updateTaskStatus } from '../../api/request';
import { getScheduleDetail, getMeetingRoomAffairs, createMeetingTask, deleteMeetingTask, updateMeetingTask, uploadPermissions } from '../../api/request';
create.Page({
store: pageStore,
data: {
affairList: null, //store
affairList: null, //store,页面用到的变量需要在这里声明
show: false, //pop
oldTask: null,
pop: {
title: '',
type: ''
},
currentTask: {}
}
},
onLoad(query) {
this.reload();
this.setData({
scheduleItem: JSON.parse(query.scheduleItem),
})
this.getDetail();
},
// 获取详情
getDetail() {
let data = {
id: this.data.scheduleItem.id,
scheduleTemplateId: this.data.scheduleItem.scheduleTemplateId,
planDate: this.data.scheduleItem.planDate
}
getScheduleDetail(data).then(res => {
if (res.data.code === 0) {
let participatorList = []
let originUsers = []
let participatorUserId = []
let repeatListMap = new Map()
for (let value of res.data.data.userList) {
participatorList.push(value.participator)
participatorUserId.push(value.participator.userId)
originUsers.push(value.participator)
}
// for (let item of this.data.comListData.repeatList) {
// if (item.recurrenceModel.recurrenceModel !== 'weekly') {
// 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),
'scheduleItem.id': res.data.data.id,
'scheduleItem.groupId': res.data.data.groupId,
repeatable: res.data.data.repeatable,
recurrenceModel: res.data.data.repeatable ? { model: res.data.data.recurrenceModel.model, daysOfMonth: res.data.data.recurrenceModel.daysOfMonth, interval: 1, initialTime: res.data.data.recurrenceModel.initialTime, terminateTime: res.data.data.recurrenceModel.terminateTime, weekDayList: res.data.data.recurrenceModel.weekDayList } : { model: 'no_repeat' },
originalData: res.data.data,
title: res.data.data.title,
remark: res.data.data.remark,
isShowRemark: res.data.data.remark ? true : false,
// week: this.data.weekList[new Date(res.data.data.startTime.replace(/'-'/g, "\/")).getDay()]
})
// if (res.data.data.repeatable) {
// this.setData({
// 'comListData.comSelectListId': res.data.data.recurrenceModel.model === 'weekly' ? (res.data.data.recurrenceModel.weekDayList.length > 1 ? 3 : 2) : repeatListMap.get(res.data.data.recurrenceModel.model),
// })
// }
// this.$store.$data.locationName = res.data.data.location.locationName
// this.$store.$data.roomId = res.data.data.meetingRoomId < 0 ? '' : res.data.data.meetingRoomId
// this.$store.$data.startTime = res.data.data.startTime.replace(/'-'/g, "\/")
// this.$store.$data.endTime = res.data.data.endTime.replace(/'-'/g, "\/")
// this.$store.$data.participatorList = participatorList
// this.$store.$data.participatorUserId = participatorUserId
// this.$store.update();
// this.conflictPeople()
this.reload(this.data.scheduleItem.id);
}
})
},
//获取动态列表
reload() {
getMeetingRoomAffairs().then(res => {
reload(id) {
getMeetingRoomAffairs(id).then(res => {
const affairList = res.data.data;
const newAffairList = affairList.map(it => {
if (it.logType == 'schedule_accessory_add') {
if (it.logType == '2') {
if (it.fileView.creatorInfo) {
it.fileView.creatorInfo = JSON.parse(it.fileView.creatorInfo);
}
......@@ -30,7 +89,7 @@ create.Page({
}
return it
}
else if (it.logType === 'task_add') {
else if (it.category === '3' && it.taskViewList) {
it.taskViewList.map(o => {
if (o.acceptorInfo) {
o.acceptorInfo = JSON.parse(o.acceptorInfo)
......@@ -47,12 +106,13 @@ create.Page({
}
return it
})
console.log(newAffairList)
this.store.data.affairList = newAffairList;
//重置
this.store.data.isNeedReloadList = false;
this.update();
})
},
showPop(e) {
this.setData({
pop: e.target.dataset.pop,
......@@ -62,43 +122,198 @@ create.Page({
closePop() {
this.setData({
show: false
});
if (this.data.pop.type == 'updateTask') {
const { currentTask } = this.store.data;
const { oldTask } = this.data;
//添加执行人
if (!oldTask.acceptorId && currentTask.acceptorId) {
this.addTaskExcutor();
}
///删除执行人
else if (oldTask.acceptorId && !currentTask.acceptorId) {
this.deleteTaskExcutor();
}
//修改执行人
else if ((oldTask.acceptorId && currentTask.acceptorId) && (oldTask.acceptorId !== currentTask.acceptorId)) {
this.updateTaskExcutor();
}
//修改任务标题
if (currentTask.taskInfos.taskTitle !== oldTask.taskInfos.taskTitle) {
this.editTaskTitle();
}
//修改任务状态
if (currentTask.taskStatus !== oldTask.taskStatus) {
this.changeTaskStatus();
}
//刷新列表,这里为什么不在promie后执行
setTimeout(() => {
console.log(this.store.data.isNeedReloadList)
if (this.store.data.isNeedReloadList) {
this.reload(this.data.scheduleItem.id);
}
})
}
},
//出现任务弹窗
showCreateTask(e) {
//重置
this.store.data.currentTask = {};
this.update();
this.showPop(e)
},
//设置修改任务弹框中当前任务
setCurrentTask(currentTask) {
this.setData({
currentTask
oldTask: JSON.parse(JSON.stringify(currentTask))
})
this.store.data.currentTask = currentTask;
this.update();
},
// 添加文件
addMeetingFile() {
decodeURI.navagac
},
// 文件上传
addMeetingFile() {
let data = {
ddUserId: getApp().globalData.userid,
type: 'add',
projectName: 'MING_MEETING'
}
uploadPermissions(data).then(res => {
if (res.data.code === 0) {
const _that = this
dd.uploadAttachmentToDingTalk({
image: { multiple: true, compress: true, max: 9, spaceId: res.data.data },
space: { spaceId: res.data.data, compress: true, isCopy: 1, max: 9 },
types: ["photo", "camera", "space"],
success: (res) => {
dd.navigateTo({ url: `./../uploadFile/uploadFile?scheduleItem=${JSON.stringify(_that.data.scheduleItem)}&upLoadInfo=${encodeURIComponent(JSON.stringify(res))}` })
},
fail: (err) => {
}
})
}
})
},
// 修改文件描述
updateMeetingFile() {
},
// 删除文件
deleteMeetingFile() {
},
// 删除执行人
deleteTaskExcutor() {
this.updateTask({
"logType": "task_remove_acceptor",
acceptorInfo: JSON.stringify(this.data.oldTask.acceptorInfo),
acceptorId: this.data.oldTask.acceptorId
})
},
// 添加执行人
addTaskExcutor() {
this.updateTask({
"logType": "task_add_acceptor",
acceptorInfo: JSON.stringify(this.store.data.currentTask.acceptorInfo),
acceptorId: this.store.data.currentTask.acceptorId
})
},
//修改执行人
updateTaskExcutor() {
this.updateTask({
"logType": "task_modify_acceptor",
acceptorInfo: JSON.stringify(this.store.data.currentTask.acceptorInfo),
acceptorId: this.store.data.currentTask.acceptorId
})
},
//修改任务标题
inputChange(value) {
console.log(value);
updateTaskTitle({}).then(res => {
this.reload();
editTaskTitle(value) {
this.updateTask({
"logType": "task_modify_title",
"taskInfos": JSON.stringify(this.store.data.currentTask.taskInfos)
})
},
//修改任务状态
CheckChange(value) {
console.log(value)
updateTaskStatus({}).then(res => {
this.reload();
})
},
//创建任务完成
Complete(data) {
console.log(data)
const excutor = this.store.data.excutor;
console.log(this.store.data)
createMeetingTask(data).then(res => {
if (res.data.data.success) {
this.reload();
//列表修改任务状态
changeTaskStatusOnList(task) {
this.updateTask({
"logType": "task_status_modify",
"taskStatus": task.status,
'id': task.id
}, () => {
this.reload(this.data.scheduleItem.id);
})
},
//弹窗修改任务状态
changeTaskStatus() {
this.updateTask({
"logType": "task_status_modify",
"taskStatus": this.store.data.currentTask.taskStatus
})
},
//删除任务
deleteTask(id) {
this.updateTask({
"logType": "task_remove",
}, () => {
this.closePop();
this.reload(this.data.scheduleItem.id);
})
},
//修改任务
updateTask(taskData, callBack) {
const postData = {
"groupId": this.data.scheduleItem.groupId,
"scheduleId": this.data.scheduleItem.id,
"resourceType": "task",
"creatorId": getApp().globalData.userid,
"creatorInfo": getApp().globalData.userInfo,
"id": this.store.data.currentTask.id,
...taskData
}
updateMeetingTask(postData).then(res => {
if (res.data.code == 0) {
if (callBack) {
callBack();
} else {
this.store.data.isNeedReloadList = true;
this.update();
}
}
})
},
deleteTask() {
deleteMeetingTask({}).then(res => {
this.reload();
//创建任务
complete() {
const { currentTask } = this.store.data;
const postData = {
"groupId": this.data.scheduleItem.groupId,
"scheduleId": this.data.scheduleItem.id,
"resourceType": "task",
"creatorId": getApp().globalData.userid,
"creatorInfo": getApp().globalData.userInfo,
"logType": "task_add",
"taskInfos": JSON.stringify(currentTask.taskInfos),
"taskStatus": '0',
"description": ""
}
if (currentTask.acceptorId) {
postData.acceptorId = currentTask.acceptorId;
postData.acceptorInfo = JSON.stringify(currentTask.acceptorInfo);
}
createMeetingTask(postData).then(res => {
if (res.data.code == 0) {
this.reload(this.data.scheduleItem.id);
this.closePop();
//重置
this.store.data.currentTask = {};
this.update();
}
})
}
});
class Store {
data = {
affairList: [],
excutor: ''
currentTask: {
id: '',
acceptorInfo: null,
acceptorId: '',
taskStatus: '',
taskInfos: null
},
// isAddAcceptorInfo: false,
// isDeleteAcceptorInfo: false,
isNeedReloadList: false,
// isEditTaskTitle: false
}
}
export default new Store()
\ No newline at end of file
class Store {
data = {
participatorList: [], // 参会人列表
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: [],
......
......@@ -4,3 +4,9 @@
color: white;
text-align: center;
}
.avater>image {
border-radius: 50%;
width: 100%;
height: 100%;
}
\ No newline at end of file
<!-- checkbox模板 {status: status}-->
<template name="checkbox">
<view class="checkbox {{status ? 'checkbox-active': ''}}" data-status="{{status}}" onTap="CheckChange">
<text a:if="{{status}}" class="iconfont iconicon_ok"></text>
<view class="checkbox {{status == '1' ? 'checkbox-active': ''}}" data-id="{{id}}" data-status="{{status}}" onTap="checkChange">
<text a:if="{{status == '1'}}" class="iconfont iconicon_ok"></text>
</view>
</template>
\ No newline at end of file
......@@ -13,10 +13,20 @@ export function throttle(fn, gapTime) {
}
}
export function debounce(fn, delay) {
let timeout = null;
return function () {
clearTimeout(timeout);
timeout = setTimeout(() => {
fn.apply(this, arguments);
}, delay);
};
}
// 判断时间 刚刚 五分钟以内 十分钟以内 正常时间年月日
export function dealFileTime(time) {
let result = ''
let argumentsTime= new Date(time.replace(/\-/g, "/")).getTime()
let argumentsTime = new Date(time.replace(/\-/g, "/")).getTime()
let nowTime = new Date().getTime()
let diffValue = nowTime - argumentsTime
let minute = 1000 * 60; //把分,时,天,周,半个月,一个月用毫秒表示
......@@ -25,27 +35,27 @@ export function dealFileTime(time) {
let week = day * 7;
let halfamonth = day * 15;
let month = day * 30;
if(diffValue < 0){
if (diffValue < 0) {
return;
}
let minC = diffValue/minute; //计算时间差的分,时,天,周,月
let hourC = diffValue/hour;
let dayC = diffValue/day;
let weekC = diffValue/week;
let monthC = diffValue/month;
if(monthC >= 1 && monthC <= 3){
let minC = diffValue / minute; //计算时间差的分,时,天,周,月
let hourC = diffValue / hour;
let dayC = diffValue / day;
let weekC = diffValue / week;
let monthC = diffValue / month;
if (monthC >= 1 && monthC <= 3) {
result = " " + parseInt(monthC) + "月前"
}else if(weekC >= 1 && weekC <= 3){
} else if (weekC >= 1 && weekC <= 3) {
result = " " + parseInt(weekC) + "周前"
}else if(dayC >= 1 && dayC <= 6){
} else if (dayC >= 1 && dayC <= 6) {
result = " " + parseInt(dayC) + "天前"
}else if(hourC >= 1 && hourC <= 23){
} else if (hourC >= 1 && hourC <= 23) {
result = " " + parseInt(hourC) + "小时前"
}else if(minC >= 1 && minC <= 59){
result =" " + parseInt(minC) + "分钟前"
}else if(diffValue >= 0 && diffValue <= minute){
} else if (minC >= 1 && minC <= 59) {
result = " " + parseInt(minC) + "分钟前"
} else if (diffValue >= 0 && diffValue <= minute) {
result = "刚刚"
}else {
} else {
let datetime = new Date();
datetime.setTime(time);
let Nyear = datetime.getFullYear();
......@@ -64,8 +74,8 @@ export function dealFileTime(time) {
format 格式 yyyyMMdd HH:mm:ss, yyyyMMdd, HH:mm:ss
Symbol 分隔符号
*/
export function getFormatDate (time, format, symbol) {
time = typeof(time) === 'object' ? time : new Date(time)
export function getFormatDate(time, format, symbol) {
time = typeof (time) === 'object' ? time : new Date(time)
format = format ? format : 'yyyyMMdd HH:mm:ss'
symbol = symbol ? symbol : ''
let year = time.getFullYear()
......
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