显示完成时间

This commit is contained in:
kuaifan 2022-01-07 18:09:22 +08:00
parent 5a64cb2323
commit 4e8cc36d3a

View File

@ -125,6 +125,7 @@
:content="item.end_at"> :content="item.end_at">
<div @click="openTask(item)">{{expiresFormat(item.end_at)}}</div> <div @click="openTask(item)">{{expiresFormat(item.end_at)}}</div>
</ETooltip> </ETooltip>
<div v-else-if="showCompleteAt && item.complete_at" :title="item.complete_at">{{completeAtFormat(item.complete_at)}}</div>
</Col> </Col>
</Row> </Row>
<TaskRow <TaskRow
@ -167,6 +168,10 @@ export default {
type: String, type: String,
default: 'default' default: 'default'
}, },
showCompleteAt: {
type: Boolean,
default: false
},
}, },
data() { data() {
return { return {
@ -302,6 +307,15 @@ export default {
} }
return this.formatTime(date) return this.formatTime(date)
}, },
completeAtFormat(date) {
let time = Math.round($A.Date(date).getTime() / 1000);
if ($A.formatDate('Y') === $A.formatDate('Y', time)) {
return $A.formatDate('m-d H:i', time)
} else {
return $A.formatDate('Y-m-d', time)
}
}
} }
} }
</script> </script>