From f5fa216b23db48b4fc0bc368e6fa954622bbb20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= <792998983@qq.com> Date: Wed, 4 Aug 2021 21:48:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/DateUtil.js | 26 ++++++++++++------- src/military/fetch.js | 2 +- .../task/components/itemListMyTask/index.jsx | 7 +++-- .../task/components/itemListMyTask/index.scss | 12 +++++++-- .../task/components/itemListPaper/index.jsx | 1 - src/military/task/static.js | 2 ++ src/military/task/taskDetail/index.jsx | 3 ++- src/military/task/taskList/index.jsx | 2 +- 8 files changed, 38 insertions(+), 17 deletions(-) diff --git a/src/common/DateUtil.js b/src/common/DateUtil.js index 90cb1b775..f678f6677 100644 --- a/src/common/DateUtil.js +++ b/src/common/DateUtil.js @@ -69,16 +69,23 @@ export function formatSeconds(value) { export function formatDuring(s) { - let days =absFloor(s / (60 * 60 * 24)) ; - let hours = absFloor((s % (60 * 60 * 24)) / ( 60 * 60)); - let minutes =absFloor((s % (60 * 60)) / ( 60)); - let second = absFloor(s % 60); + s = Math.abs(s); + let days = Math.floor(s / (60 * 60 * 24)); + let hours = Math.floor((s % (60 * 60 * 24)) / (60 * 60)); + let minutes = Math.floor((s % (60 * 60)) / (60)); + let second = Math.floor(s % 60); if (days) { - return days + "天" + hours + "小时" ; + if(hours){ + return days + "天" + hours + "小时"; + } + return days + "天"; } if (hours) { - return hours + "小时" + minutes + "分"; + if(minutes){ + return hours + "小时" + minutes + "分"; + } + return hours + "小时" ; } if (minutes) { return minutes + "分"; @@ -86,9 +93,7 @@ export function formatDuring(s) { return second + "秒"; } -export function absFloor(number){ - return Math.abs(Math.floor(number)); -} + /* 返回:多久以前 @@ -105,6 +110,9 @@ export function timeAgo(backDate) { var hours = Math.floor((time % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((time % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((time % (1000 * 60 * 60)) / 1000); + if (time <= 0) { + return "刚刚"; + } if (days) { return days + "天前"; } diff --git a/src/military/fetch.js b/src/military/fetch.js index 2ea879b54..0e6c6e898 100644 --- a/src/military/fetch.js +++ b/src/military/fetch.js @@ -6,7 +6,7 @@ import cookie from 'react-cookies'; let actionUrl = ''; if (window.location.href.indexOf('localhost') > -1) { actionUrl = 'http://117.50.100.12:8008'; - // actionUrl='http://192.168.31.73:8081'; + // actionUrl='http://192.168.31.72:8081'; } else if (window.location.href.indexOf('117.50.100.12') > -1) { actionUrl = "http://117.50.100.12:8008"; axios.defaults.withCredentials = true; diff --git a/src/military/task/components/itemListMyTask/index.jsx b/src/military/task/components/itemListMyTask/index.jsx index 3fd5dfbd2..7c46c62d2 100644 --- a/src/military/task/components/itemListMyTask/index.jsx +++ b/src/military/task/components/itemListMyTask/index.jsx @@ -5,7 +5,7 @@ import Nodata from 'forge/Nodata'; import Loading from "src/Loading"; import Upload from 'military/components/Upload'; import ProofModal from '../proofModal'; -import { publishModeArr, taskStatusAllArr } from '../../static'; +import { publishModeArr, taskStatusAllArr, myPaperStatusArr } from '../../static'; import { signMethod, uploadAgreeRequire, downAgreement } from "../../api"; import { httpUrl } from 'military/fetch'; import '../../index.scss'; @@ -186,7 +186,10 @@ export default Form.create()((props) => { {item.name} { joinTask ? - {item.status === 4 && 待确认} + {item.myPaperStatus === 0 && {myPaperStatusArr[item.myPaperStatus]}} + {item.myPaperStatus === 1 && {myPaperStatusArr[item.myPaperStatus]}} + {item.myPaperStatus === 2 && {myPaperStatusArr[item.myPaperStatus]}} + {item.status === 6 && 待签订协议} : {item.status === 6 && (item.agreementSigning === 1 || (item.agreementSigning === 2 && item.auditing && item.auditing.pass === 1)) && 待签订协议} diff --git a/src/military/task/components/itemListMyTask/index.scss b/src/military/task/components/itemListMyTask/index.scss index 31f6ca909..6a48c6c0f 100644 --- a/src/military/task/components/itemListMyTask/index.scss +++ b/src/military/task/components/itemListMyTask/index.scss @@ -27,10 +27,10 @@ .mytask-title { justify-content: left; - a{ + a { word-break: break-all; } - span{ + span { flex: 0 0 auto; } } @@ -52,6 +52,14 @@ background: #ffb121; } + .s_red { + background: #fe0e36; + } + + .s_blue { + background: #4cacff; + } + .needs_condition_content_t { height: 40px; padding: 0px 20px; diff --git a/src/military/task/components/itemListPaper/index.jsx b/src/military/task/components/itemListPaper/index.jsx index 4946c7bc1..498d62bab 100644 --- a/src/military/task/components/itemListPaper/index.jsx +++ b/src/military/task/components/itemListPaper/index.jsx @@ -190,7 +190,6 @@ export default Form.create()((props) => {
{commentsItem.user.nickname || commentsItem.user.login} {timeAgo(commentsItem.createdAt)} -
diff --git a/src/military/task/static.js b/src/military/task/static.js index d1dcd674d..9e3156b45 100644 --- a/src/military/task/static.js +++ b/src/military/task/static.js @@ -110,6 +110,8 @@ export const showUserModeArr=[ { dicItemCode: 2, name: "手动公示", dicItemName: '手动公示' }, ] +export const myPaperStatusArr =["待确认","未采纳","评选胜出"] + export const formItemLayout = { labelCol: { xs: { span: 10 }, diff --git a/src/military/task/taskDetail/index.jsx b/src/military/task/taskDetail/index.jsx index b0a3ba3a0..807eea8d9 100644 --- a/src/military/task/taskDetail/index.jsx +++ b/src/military/task/taskDetail/index.jsx @@ -157,8 +157,9 @@ export default Form.create()( surplus = detailData.signingDays * 24 * 3600 - (new Date() - new Date(detailData.publicityCompleteAt)) / 1000; } if (status === 7) { - surplus = detailData.payingDays * 24 * 3600 - (new Date() - new Date(detailData.payingCompleteAt)) / 1000; + surplus = detailData.payingDays * 24 * 3600 - (new Date() - new Date(detailData.signingCompleteAt)) / 1000; } + console.log(surplus); surplusTimetext = formatDuring(surplus); } diff --git a/src/military/task/taskList/index.jsx b/src/military/task/taskList/index.jsx index eab6d6764..ce8041e7e 100644 --- a/src/military/task/taskList/index.jsx +++ b/src/military/task/taskList/index.jsx @@ -99,7 +99,7 @@ export default ({ history, current_user, showLoginDialog }) => { surplus = item.signingDays * 24 * 3600 - (new Date() - new Date(item.publicityCompleteAt)) / 1000; } if (status === 7) { - surplus = item.payingDays * 24 * 3600 - (new Date() - new Date(item.payingCompleteAt)) / 1000; + surplus = item.payingDays * 24 * 3600 - (new Date() - new Date(item.signingCompleteAt)) / 1000; } let surplusTimetext = formatDuring(surplus);