perf: 任务详情窗口截止时间24小时倒计时
This commit is contained in:
parent
f06b4040bc
commit
b71dbe9832
@ -257,8 +257,10 @@
|
|||||||
transfer>
|
transfer>
|
||||||
<div class="picker-time">
|
<div class="picker-time">
|
||||||
<div @click="openTime" class="time">{{taskDetail.end_at ? cutTime : '--'}}</div>
|
<div @click="openTime" class="time">{{taskDetail.end_at ? cutTime : '--'}}</div>
|
||||||
<Tag v-if="!taskDetail.complete_at && taskDetail.today" color="blue"><i class="taskfont"></i>{{expiresFormat(taskDetail.end_at)}}</Tag>
|
<template v-if="!taskDetail.complete_at">
|
||||||
<Tag v-if="!taskDetail.complete_at && taskDetail.overdue" color="red">{{$L('超期未完成')}}</Tag>
|
<Tag v-if="within24Hours(taskDetail.end_at)" color="blue"><i class="taskfont"></i>{{expiresFormat(taskDetail.end_at)}}</Tag>
|
||||||
|
<Tag v-if="taskDetail.overdue" color="red">{{$L('超期未完成')}}</Tag>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</DatePicker>
|
</DatePicker>
|
||||||
</li>
|
</li>
|
||||||
@ -714,6 +716,10 @@ export default {
|
|||||||
this.innerHeight = Math.min(1100, window.innerHeight);
|
this.innerHeight = Math.min(1100, window.innerHeight);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
within24Hours(date) {
|
||||||
|
return Math.round($A.Date(date).getTime() / 1000) - this.nowTime < 86400
|
||||||
|
},
|
||||||
|
|
||||||
expiresFormat(date) {
|
expiresFormat(date) {
|
||||||
return $A.countDownFormat(date, this.nowTime)
|
return $A.countDownFormat(date, this.nowTime)
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user