diff --git a/src/components/dropdown-selector/CategoryDropdownSelector.vue b/src/components/dropdown-selector/CategoryDropdownSelector.vue new file mode 100644 index 00000000..250d1d1e --- /dev/null +++ b/src/components/dropdown-selector/CategoryDropdownSelector.vue @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/dropdown-selector/TagDropdownSelector.vue b/src/components/dropdown-selector/TagDropdownSelector.vue new file mode 100644 index 00000000..2fc86642 --- /dev/null +++ b/src/components/dropdown-selector/TagDropdownSelector.vue @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/dropdown-selector/UserDropdownSelector.vue b/src/components/dropdown-selector/UserDropdownSelector.vue index 619d67eb..47051071 100644 --- a/src/components/dropdown-selector/UserDropdownSelector.vue +++ b/src/components/dropdown-selector/UserDropdownSelector.vue @@ -1,7 +1,10 @@ @@ -40,42 +69,44 @@ function onDropdownShow() { - - - + + - - + + - - - - - - - {{ user.spec.displayName }} - - - @{{ user.metadata.name }} - - - - - - + + + + + + + + + + diff --git a/src/modules/contents/posts/PostList.vue b/src/modules/contents/posts/PostList.vue index 4a336db1..568a5618 100644 --- a/src/modules/contents/posts/PostList.vue +++ b/src/modules/contents/posts/PostList.vue @@ -23,6 +23,7 @@ import { VLoading, } from "@halo-dev/components"; import UserDropdownSelector from "@/components/dropdown-selector/UserDropdownSelector.vue"; +import CategoryDropdownSelector from "@/components/dropdown-selector/CategoryDropdownSelector.vue"; import PostSettingModal from "./components/PostSettingModal.vue"; import PostTag from "../posts/tags/components/PostTag.vue"; import { computed, onMounted, ref, watch } from "vue"; @@ -35,14 +36,13 @@ import type { } from "@halo-dev/api-client"; import { apiClient } from "@/utils/api-client"; import { formatDatetime } from "@/utils/date"; -import { usePostCategory } from "@/modules/contents/posts/categories/composables/use-post-category"; -import { usePostTag } from "@/modules/contents/posts/tags/composables/use-post-tag"; import { usePermission } from "@/utils/permission"; import { onBeforeRouteLeave } from "vue-router"; import { postLabels } from "@/constants/labels"; import FilterTag from "@/components/filter/FilterTag.vue"; import FilteCleanButton from "@/components/filter/FilterCleanButton.vue"; import { getNode } from "@formkit/core"; +import TagDropdownSelector from "@/components/dropdown-selector/TagDropdownSelector.vue"; const { currentUserHasPermission } = usePermission(); @@ -366,9 +366,6 @@ const SortItems: SortItem[] = [ }, ]; -const { categories } = usePostCategory({ fetchOnMounted: true }); -const { tags } = usePostTag({ fetchOnMounted: true }); - const selectedVisibleItem = ref(VisibleItems[0]); const selectedPublishStatusItem = ref(PublishStatuItems[0]); const selectedSortItem = ref(); @@ -631,7 +628,10 @@ const hasFilters = computed(() => { - + @@ -640,69 +640,11 @@ const hasFilters = computed(() => { - - - - - - - - - - - - - - {{ category.spec.displayName }} - - - - - - {{ category.status?.permalink }} - - - - - - - {{ category.status?.postCount || 0 }} - 篇文章 - - - - - - - - - - - - + + @@ -711,65 +653,7 @@ const hasFilters = computed(() => { - - - - - - - - - - - - - - - - - - {{ tag.status?.permalink }} - - - - - - - {{ tag.status?.postCount || 0 }} - 篇文章 - - - - - - - - - - - +
- {{ user.spec.displayName }} -
- @{{ user.metadata.name }} -