feat: add cover for deleted post list in console (#7565)

#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.21.x

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

Add cover field for deleted post list in console.

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

```release-note
None
```
pull/7564/head^2
Ryan Wang 2025-06-17 23:06:55 +08:00 committed by GitHub
parent 7d560186e8
commit d5a411eb1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 28 additions and 0 deletions

View File

@ -2,6 +2,7 @@
import PostContributorList from "@/components/user/PostContributorList.vue";
import { formatDatetime, relativeTimeTo } from "@/utils/date";
import { usePermission } from "@/utils/permission";
import { generateThumbnailUrl } from "@/utils/thumbnail";
import type { ListedSinglePage, SinglePage } from "@halo-dev/api-client";
import { consoleApiClient, coreApiClient } from "@halo-dev/api-client";
import {
@ -306,6 +307,20 @@ watch(
/>
</template>
<template #start>
<VEntityField v-if="singlePage.page.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(singlePage.page.spec.cover, 's')
"
/>
</div>
</template>
</VEntityField>
<VEntityField :title="singlePage.page.spec.title">
<template #description>
<VSpace>

View File

@ -2,6 +2,7 @@
import PostContributorList from "@/components/user/PostContributorList.vue";
import { formatDatetime, relativeTimeTo } from "@/utils/date";
import { usePermission } from "@/utils/permission";
import { generateThumbnailUrl } from "@/utils/thumbnail";
import type { ListedPost, Post } from "@halo-dev/api-client";
import { consoleApiClient, coreApiClient } from "@halo-dev/api-client";
import {
@ -317,6 +318,18 @@ watch(
/>
</template>
<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">
<template #description>
<div class="flex flex-col gap-1.5">