From 634e14c910c923c15b20e4750799acd6db8c48a4 Mon Sep 17 00:00:00 2001 From: smallchill Date: Thu, 9 May 2019 21:35:32 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E5=AE=8C=E5=96=84=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/work/process.js | 12 +- src/api/work/work.js | 6 +- src/page/login/userlogin.vue | 2 +- src/util/date.js | 79 +++++----- src/views/flow/follow.vue | 2 +- src/views/work/claim.vue | 20 ++- src/views/work/process/leave/detail.vue | 138 +++++++++++------ src/views/work/process/leave/handle.vue | 188 ++++++++++++++++++------ src/views/work/todo.vue | 2 +- 9 files changed, 305 insertions(+), 144 deletions(-) diff --git a/src/api/work/process.js b/src/api/work/process.js index 20c70d8..2d88e71 100644 --- a/src/api/work/process.js +++ b/src/api/work/process.js @@ -2,14 +2,12 @@ import request from '@/router/axios'; // =====================参数=========================== -export const historyFlowList = (current, size, params) => { +export const historyFlowList = (processInstanceId) => { return request({ url: '/api/blade-flow/process/history-flow-list', method: 'get', params: { - ...params, - current, - size, + processInstanceId } }) } @@ -25,10 +23,12 @@ export const leaveProcess = (data) => { }) } -export const leaveDetail = (params) => { +export const leaveDetail = (businessId) => { return request({ url: '/api/blade-desk/process/leave/detail', method: 'get', - params + params: { + businessId + } }) } diff --git a/src/api/work/work.js b/src/api/work/work.js index f4f0c13..c815686 100644 --- a/src/api/work/work.js +++ b/src/api/work/work.js @@ -61,11 +61,13 @@ export const doneList = (current, size, params) => { }) } -export const claimTask = (params) => { +export const claimTask = (taskId) => { return request({ url: '/api/blade-flow/work/claim-task', method: 'post', - params + params: { + taskId + } }) } diff --git a/src/page/login/userlogin.vue b/src/page/login/userlogin.vue index b67e37d..454177a 100644 --- a/src/page/login/userlogin.vue +++ b/src/page/login/userlogin.vue @@ -72,7 +72,7 @@ export default { ], password: [ { required: true, message: "请输入密码", trigger: "blur" }, - { min: 5, message: "密码长度最少为6位", trigger: "blur" } + { min: 1, message: "密码长度最少为6位", trigger: "blur" } ] }, passwordType: "password" diff --git a/src/util/date.js b/src/util/date.js index 80ff1a1..4c1f250 100644 --- a/src/util/date.js +++ b/src/util/date.js @@ -1,50 +1,51 @@ export const calcDate = (date1, date2) => { - var date3 = date2 - date1; + let date3 = date2 - date1; - var days = Math.floor(date3 / (24 * 3600 * 1000)) + let days = Math.floor(date3 / (24 * 3600 * 1000)) - var leave1 = date3 % (24 * 3600 * 1000) //计算天数后剩余的毫秒数 - var hours = Math.floor(leave1 / (3600 * 1000)) + let leave1 = date3 % (24 * 3600 * 1000) //计算天数后剩余的毫秒数 + let hours = Math.floor(leave1 / (3600 * 1000)) - var leave2 = leave1 % (3600 * 1000) //计算小时数后剩余的毫秒数 - var minutes = Math.floor(leave2 / (60 * 1000)) + let leave2 = leave1 % (3600 * 1000) //计算小时数后剩余的毫秒数 + let minutes = Math.floor(leave2 / (60 * 1000)) - var leave3 = leave2 % (60 * 1000) //计算分钟数后剩余的毫秒数 - var seconds = Math.round(date3 / 1000) - return { - leave1, - leave2, - leave3, - days: days, - hours: hours, - minutes: minutes, - seconds: seconds, - } + let leave3 = leave2 % (60 * 1000) //计算分钟数后剩余的毫秒数 + let seconds = Math.round(date3 / 1000) + return { + leave1, + leave2, + leave3, + days: days, + hours: hours, + minutes: minutes, + seconds: seconds, + } } + /** * 日期格式化 */ -export function dateFormat(date) { - let format = 'yyyy-MM-dd hh:mm:ss'; - if (date != 'Invalid Date') { - var o = { - "M+": date.getMonth() + 1, //month - "d+": date.getDate(), //day - "h+": date.getHours(), //hour - "m+": date.getMinutes(), //minute - "s+": date.getSeconds(), //second - "q+": Math.floor((date.getMonth() + 3) / 3), //quarter - "S": date.getMilliseconds() //millisecond - } - if (/(y+)/.test(format)) format = format.replace(RegExp.$1, - (date.getFullYear() + "").substr(4 - RegExp.$1.length)); - for (var k in o) - if (new RegExp("(" + k + ")").test(format)) - format = format.replace(RegExp.$1, - RegExp.$1.length == 1 ? o[k] : - ("00" + o[k]).substr(("" + o[k]).length)); - return format; +export function dateFormat(date, format) { + format = format || 'yyyy-MM-dd hh:mm:ss'; + if (date !== 'Invalid Date') { + let o = { + "M+": date.getMonth() + 1, //month + "d+": date.getDate(), //day + "h+": date.getHours(), //hour + "m+": date.getMinutes(), //minute + "s+": date.getSeconds(), //second + "q+": Math.floor((date.getMonth() + 3) / 3), //quarter + "S": date.getMilliseconds() //millisecond } - return ''; + if (/(y+)/.test(format)) format = format.replace(RegExp.$1, + (date.getFullYear() + "").substr(4 - RegExp.$1.length)); + for (let k in o) + if (new RegExp("(" + k + ")").test(format)) + format = format.replace(RegExp.$1, + RegExp.$1.length === 1 ? o[k] : + ("00" + o[k]).substr(("" + o[k]).length)); + return format; + } + return ''; -} \ No newline at end of file +} diff --git a/src/views/flow/follow.vue b/src/views/flow/follow.vue index 1e93381..3197d13 100644 --- a/src/views/flow/follow.vue +++ b/src/views/flow/follow.vue @@ -17,7 +17,7 @@ width="20%"> + label-width="80px"> diff --git a/src/views/work/claim.vue b/src/views/work/claim.vue index fa16808..a27ea02 100644 --- a/src/views/work/claim.vue +++ b/src/views/work/claim.vue @@ -62,7 +62,7 @@