feat: add cover for post list in uc (#7534)

#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.21.x

#### What this PR does / why we need it:

Add cover image display for the post list in the uc.

#### Does this PR introduce a user-facing change?

```release-note
None
```
pull/7535/head
Ryan Wang 2025-06-10 23:16:36 +08:00 committed by GitHub
parent 6f769b0c59
commit 2cba28d21d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import HasPermission from "@/components/permission/HasPermission.vue";
import PostContributorList from "@/components/user/PostContributorList.vue";
import { postLabels } from "@/constants/labels";
import { formatDatetime, relativeTimeTo } from "@/utils/date";
import { generateThumbnailUrl } from "@/utils/thumbnail";
import PostTag from "@console/modules/contents/posts/tags/components/PostTag.vue";
import type { ListedPost } from "@halo-dev/api-client";
import { ucApiClient } from "@halo-dev/api-client";
@ -121,6 +122,16 @@ function handleDelete() {
<template>
<VEntity>
<template #start>
<VEntityField v-if="post.post.spec.cover">
<template #description>
<div class="aspect-h-2 rounded-md overflow-hidden aspect-w-3 w-20">
<img
class="object-cover w-full h-full"
:src="generateThumbnailUrl(post.post.spec.cover, 's')"
/>
</div>
</template>
</VEntityField>
<VEntityField
:title="post.post.spec.title"
:route="{