mirror of https://github.com/halo-dev/halo-admin
refactor: change the creation time field for comments and replies (#874)
#### What type of PR is this? /kind improvement #### What this PR does / why we need it: 修改评论和回复的创建时间字段。适配:https://github.com/halo-dev/halo/pull/3341 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3330 #### Special notes for your reviewer: None #### Does this PR introduce a user-facing change? ```release-note None ```pull/888/head
parent
e4b655e561
commit
0eff78787e
|
@ -61,6 +61,12 @@ export interface CommentSpec {
|
||||||
* @memberof CommentSpec
|
* @memberof CommentSpec
|
||||||
*/
|
*/
|
||||||
approvedTime?: string
|
approvedTime?: string
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CommentSpec
|
||||||
|
*/
|
||||||
|
creationTime?: string
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
|
|
|
@ -58,6 +58,12 @@ export interface ReplySpec {
|
||||||
* @memberof ReplySpec
|
* @memberof ReplySpec
|
||||||
*/
|
*/
|
||||||
approvedTime?: string
|
approvedTime?: string
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ReplySpec
|
||||||
|
*/
|
||||||
|
creationTime?: string
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
|
|
|
@ -369,10 +369,15 @@ const subjectRefResult = computed(() => {
|
||||||
<VStatusDot v-tooltip="`删除中`" state="warning" animate />
|
<VStatusDot v-tooltip="`删除中`" state="warning" animate />
|
||||||
</template>
|
</template>
|
||||||
</VEntityField>
|
</VEntityField>
|
||||||
<VEntityField v-if="comment?.comment?.spec.approvedTime">
|
<VEntityField>
|
||||||
<template #description>
|
<template #description>
|
||||||
<span class="truncate text-xs tabular-nums text-gray-500">
|
<span class="truncate text-xs tabular-nums text-gray-500">
|
||||||
{{ formatDatetime(comment?.comment?.spec.approvedTime) }}
|
{{
|
||||||
|
formatDatetime(
|
||||||
|
comment?.comment.spec.creationTime ||
|
||||||
|
comment?.comment.metadata.creationTimestamp
|
||||||
|
)
|
||||||
|
}}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</VEntityField>
|
</VEntityField>
|
||||||
|
|
|
@ -171,10 +171,15 @@ const isHoveredReply = computed(() => {
|
||||||
<VStatusDot v-tooltip="`删除中`" state="warning" animate />
|
<VStatusDot v-tooltip="`删除中`" state="warning" animate />
|
||||||
</template>
|
</template>
|
||||||
</VEntityField>
|
</VEntityField>
|
||||||
<VEntityField v-if="reply?.reply?.spec.approvedTime">
|
<VEntityField>
|
||||||
<template #description>
|
<template #description>
|
||||||
<span class="truncate text-xs tabular-nums text-gray-500">
|
<span class="truncate text-xs tabular-nums text-gray-500">
|
||||||
{{ formatDatetime(reply?.reply?.spec.approvedTime) }}
|
{{
|
||||||
|
formatDatetime(
|
||||||
|
reply?.reply?.spec.creationTime ||
|
||||||
|
reply?.reply.metadata.creationTimestamp
|
||||||
|
)
|
||||||
|
}}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</VEntityField>
|
</VEntityField>
|
||||||
|
|
Loading…
Reference in New Issue