From 65d4751509ee88c05164de5607c285b3a70fe8e6 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Mon, 9 Jun 2025 23:34:34 +0800 Subject: [PATCH] feat: add cover for post list (#7519) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind feature /area ui /milestone 2.21.x #### What this PR does / why we need it: image #### Which issue(s) this PR fixes: Fixes #7437 #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? ```release-note 文章管理列表支持显示封面图 ``` --- .../pages/components/SinglePageListItem.vue | 11 ++++++++ .../posts/components/PostListItem.vue | 10 ++++++++ .../components/entity-fields/CoverField.vue | 25 +++++++++++++++++++ ui/src/utils/thumbnail.ts | 5 ++++ 4 files changed, 51 insertions(+) create mode 100644 ui/console-src/modules/contents/posts/components/entity-fields/CoverField.vue create mode 100644 ui/src/utils/thumbnail.ts diff --git a/ui/console-src/modules/contents/pages/components/SinglePageListItem.vue b/ui/console-src/modules/contents/pages/components/SinglePageListItem.vue index 9390ea20f..0ef9daa7e 100644 --- a/ui/console-src/modules/contents/pages/components/SinglePageListItem.vue +++ b/ui/console-src/modules/contents/pages/components/SinglePageListItem.vue @@ -3,6 +3,7 @@ import PostContributorList from "@/components/user/PostContributorList.vue"; import { singlePageLabels } from "@/constants/labels"; 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 { coreApiClient } from "@halo-dev/api-client"; import { @@ -131,6 +132,16 @@ const handleDelete = async () => { />