From bcfe7a52ee32e3b30feedfce87aad865a8a3fd69 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Tue, 13 Sep 2022 12:08:12 +0800 Subject: [PATCH] feat: add the entity component as a list item (halo-dev/console#609) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind feature /milestone 2.0 #### What this PR does / why we need it: 添加 Entity 和 EntityField 组件,作为列表项使用。 #### Which issue(s) this PR fixes: #### Screenshots: #### Special notes for your reviewer: 测试方式:检查后台各个页面的列表样式和功能是否正常。 /cc @halo-dev/sig-halo-admin #### Does this PR introduce a user-facing change? ```release-note None ``` --- src/components/entity/Entity.vue | 55 +++++ src/components/entity/EntityField.vue | 54 +++++ .../contents/attachments/AttachmentList.vue | 147 ++++++------ .../contents/pages/FunctionalPageList.vue | 32 +-- src/modules/contents/pages/SinglePageList.vue | 197 +++++++---------- src/modules/contents/posts/PostList.vue | 209 ++++++++---------- .../components/CategoryListItem.vue | 129 +++++------ src/modules/contents/posts/tags/TagList.vue | 121 ++++------ .../menus/components/MenuItemListItem.vue | 129 +++++------ .../interface/menus/components/MenuList.vue | 108 ++++----- .../plugins/components/PluginListItem.vue | 143 +++++------- src/modules/system/roles/RoleList.vue | 168 ++++++-------- src/modules/system/users/UserList.vue | 149 +++++-------- 13 files changed, 732 insertions(+), 909 deletions(-) create mode 100644 src/components/entity/Entity.vue create mode 100644 src/components/entity/EntityField.vue diff --git a/src/components/entity/Entity.vue b/src/components/entity/Entity.vue new file mode 100644 index 000000000..483d54f6a --- /dev/null +++ b/src/components/entity/Entity.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/components/entity/EntityField.vue b/src/components/entity/EntityField.vue new file mode 100644 index 000000000..9fb40fc78 --- /dev/null +++ b/src/components/entity/EntityField.vue @@ -0,0 +1,54 @@ + + + diff --git a/src/modules/contents/attachments/AttachmentList.vue b/src/modules/contents/attachments/AttachmentList.vue index 3eafb2596..30317bc41 100644 --- a/src/modules/contents/attachments/AttachmentList.vue +++ b/src/modules/contents/attachments/AttachmentList.vue @@ -7,7 +7,6 @@ import { IconDatabase2Line, IconGrid, IconList, - IconSettings, IconUpload, VButton, VCard, @@ -36,6 +35,8 @@ import cloneDeep from "lodash.clonedeep"; import { isImage } from "@/utils/image"; import { useRouteQuery } from "@vueuse/router"; import { useFetchAttachmentGroup } from "./composables/use-attachment-group"; +import Entity from "@/components/entity/Entity.vue"; +import EntityField from "@/components/entity/EntityField.vue"; const policyVisible = ref(false); const uploadVisible = ref(false); @@ -555,47 +556,35 @@ onMounted(() => { role="list" >
  • -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - + + + diff --git a/src/modules/contents/pages/SinglePageList.vue b/src/modules/contents/pages/SinglePageList.vue index 56e3f6753..fc40001ad 100644 --- a/src/modules/contents/pages/SinglePageList.vue +++ b/src/modules/contents/pages/SinglePageList.vue @@ -3,7 +3,6 @@ import { IconArrowDown, IconArrowLeft, IconArrowRight, - IconSettings, IconEye, IconEyeOff, IconTeam, @@ -30,6 +29,8 @@ import { apiClient } from "@halo-dev/admin-shared"; import { formatDatetime } from "@/utils/date"; import { RouterLink } from "vue-router"; import cloneDeep from "lodash.clonedeep"; +import Entity from "../../../components/entity/Entity.vue"; +import EntityField from "../../../components/entity/EntityField.vue"; enum SinglePagePhase { DRAFT = "未发布", @@ -332,68 +333,47 @@ const handleSelectUser = (user?: User) => { role="list" >
  • -
    -
    -
    - -
    -
    + + + + + +
  • diff --git a/src/modules/contents/posts/PostList.vue b/src/modules/contents/posts/PostList.vue index daa244669..03cb69bf2 100644 --- a/src/modules/contents/posts/PostList.vue +++ b/src/modules/contents/posts/PostList.vue @@ -7,7 +7,6 @@ import { IconBookRead, IconEye, IconEyeOff, - IconSettings, IconTeam, IconCloseCircle, useDialog, @@ -21,6 +20,8 @@ import { } from "@halo-dev/components"; import UserDropdownSelector from "@/components/dropdown-selector/UserDropdownSelector.vue"; import PostSettingModal from "./components/PostSettingModal.vue"; +import Entity from "@/components/entity/Entity.vue"; +import EntityField from "@/components/entity/EntityField.vue"; import PostTag from "../posts/tags/components/PostTag.vue"; import { onMounted, ref, watch, watchEffect } from "vue"; import type { @@ -738,64 +739,43 @@ function handleContributorFilterItemChange(user?: User) { role="list" >
  • -
    -
    -
    - -
    -
    - - - {{ post.post.spec.title }} - - + + + + + +
  • diff --git a/src/modules/contents/posts/categories/components/CategoryListItem.vue b/src/modules/contents/posts/categories/components/CategoryListItem.vue index 31aa1349b..002db8cca 100644 --- a/src/modules/contents/posts/categories/components/CategoryListItem.vue +++ b/src/modules/contents/posts/categories/components/CategoryListItem.vue @@ -1,9 +1,11 @@ diff --git a/src/modules/system/users/UserList.vue b/src/modules/system/users/UserList.vue index e9d8a9298..69a849e5a 100644 --- a/src/modules/system/users/UserList.vue +++ b/src/modules/system/users/UserList.vue @@ -2,7 +2,6 @@ import { IconAddCircle, IconArrowDown, - IconSettings, IconUserFollow, IconUserSettings, VButton, @@ -21,6 +20,8 @@ import type { User, UserList } from "@halo-dev/api-client"; import { rbacAnnotations } from "@/constants/annotations"; import { formatDatetime } from "@/utils/date"; import { useRouteQuery } from "@vueuse/router"; +import Entity from "@/components/entity/Entity.vue"; +import EntityField from "@/components/entity/EntityField.vue"; const checkAll = ref(false); const editingModal = ref(false); @@ -275,104 +276,70 @@ onMounted(() => {