refactor: update the field for the number of post under categories and tags (#627)

#### What type of PR is this?

/kind improvement
/milestone 2.0

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

修改标签/分类显示文章数量的字段。 适配 https://github.com/halo-dev/halo/pull/2483

#### Which issue(s) this PR fixes:

Fixes #

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2483 PR 中的分支。
2. Console 需要 `pnpm install`
3. 发布多篇带分类和标签的文章后,检查分类和标签的文章数量是否正确。

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

```release-note
None
```
pull/626/head^2
Ryan Wang 2022-09-29 10:40:17 +08:00 committed by GitHub
parent 21d3220817
commit 24794df827
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1667 additions and 1746 deletions

View File

@ -34,7 +34,7 @@
"@formkit/themes": "1.0.0-beta.10",
"@formkit/vue": "1.0.0-beta.10",
"@halo-dev/admin-shared": "workspace:*",
"@halo-dev/api-client": "^0.0.29",
"@halo-dev/api-client": "^0.0.33",
"@halo-dev/components": "workspace:*",
"@halo-dev/richtext-editor": "^0.0.0-alpha.7",
"@tiptap/extension-character-count": "2.0.0-beta.31",

File diff suppressed because it is too large Load Diff

View File

@ -636,7 +636,7 @@ function handleContributorChange(user?: User) {
<div
class="cursor-pointer text-sm text-gray-500 hover:text-gray-900"
>
{{ category.status?.posts?.length || 0 }}
{{ category.status?.postCount || 0 }}
篇文章
</div>
</div>
@ -704,7 +704,7 @@ function handleContributorChange(user?: User) {
<div
class="cursor-pointer text-sm text-gray-500 hover:text-gray-900"
>
{{ tag.status?.posts?.length || 0 }}
{{ tag.status?.postCount || 0 }}
篇文章
</div>
</div>

View File

@ -76,7 +76,7 @@ function onDelete(category: CategoryTree) {
</template>
</VEntityField>
<VEntityField
:description="`${category.status?.posts?.length || 0} 篇文章`"
:description="`${category.status?.postCount || 0} 篇文章`"
/>
<VEntityField
:description="formatDatetime(category.metadata.creationTimestamp)"

View File

@ -192,7 +192,7 @@ onMounted(async () => {
</template>
</VEntityField>
<VEntityField
:description="`${tag.status?.posts?.length || 0} 篇文章`"
:description="`${tag.status?.postCount || 0} 篇文章`"
/>
<VEntityField
:description="formatDatetime(tag.metadata.creationTimestamp)"