From 3ee45a117eb6e4e65e79adb6094f329e050af71a Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Tue, 23 Aug 2022 12:08:10 +0800 Subject: [PATCH] feat: post basic management capability (#599) 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: 文章管理相关模块。适配 https://github.com/halo-dev/halo/pull/2326 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/2322 #### Screenshots: // pending #### Special notes for your reviewer: // pending #### Does this PR introduce a user-facing change? ```release-note None ``` --- package.json | 5 +- .../components/src/components/tag/Tag.vue | 7 +- packages/components/src/icons/icons.ts | 4 + packages/shared/package.json | 2 +- packages/shared/src/utils/api-client.ts | 25 +- pnpm-lock.yaml | 73 +- src/constants/labels.ts | 8 + src/formkit/theme.ts | 4 +- src/modules/contents/posts/PostEditor.vue | 131 ++- src/modules/contents/posts/PostList.vue | 645 ++++++++-- .../posts/categories/CategoryList.vue | 177 +-- .../components/CategoryEditingModal.vue | 119 +- .../components/CategoryListItem.vue | 142 +++ .../__tests__/CategoryEditingModal.spec.ts | 9 + .../composables/use-post-category.ts | 69 ++ .../contents/posts/categories/utils/index.ts | 123 ++ .../posts/components/PostSettingModal.vue | 316 +++-- .../__tests__/PostSettingModal.spec.ts | 20 + src/modules/contents/posts/posts-mock.ts | 1036 ----------------- src/modules/contents/posts/tags/TagList.vue | 267 +++-- .../posts/tags/components/PostTag.vue | 26 + .../posts/tags/components/TagEditingModal.vue | 152 ++- .../posts/tags/composables/use-post-tag.ts | 61 + .../widgets/RecentPublishedWidget.vue | 32 +- src/utils/__tests__/date.spec.ts | 10 + src/utils/date.ts | 14 + 26 files changed, 1993 insertions(+), 1484 deletions(-) create mode 100644 src/modules/contents/posts/categories/components/CategoryListItem.vue create mode 100644 src/modules/contents/posts/categories/components/__tests__/CategoryEditingModal.spec.ts create mode 100644 src/modules/contents/posts/categories/composables/use-post-category.ts create mode 100644 src/modules/contents/posts/categories/utils/index.ts create mode 100644 src/modules/contents/posts/components/__tests__/PostSettingModal.spec.ts delete mode 100644 src/modules/contents/posts/posts-mock.ts create mode 100644 src/modules/contents/posts/tags/components/PostTag.vue create mode 100644 src/modules/contents/posts/tags/composables/use-post-tag.ts create mode 100644 src/utils/__tests__/date.spec.ts create mode 100644 src/utils/date.ts diff --git a/package.json b/package.json index b7f8f27f..67b4d4c1 100644 --- a/package.json +++ b/package.json @@ -32,15 +32,16 @@ "@formkit/inputs": "1.0.0-beta.10", "@formkit/themes": "1.0.0-beta.10", "@formkit/vue": "1.0.0-beta.10", - "@halo-dev/admin-api": "^1.1.0", "@halo-dev/admin-shared": "workspace:*", - "@halo-dev/api-client": "^0.0.10", + "@halo-dev/api-client": "^0.0.12", "@halo-dev/components": "workspace:*", "@halo-dev/richtext-editor": "0.0.0-alpha.3", "@vueuse/components": "^8.9.4", "@vueuse/core": "^8.9.4", "@vueuse/router": "^9.1.0", "axios": "^0.27.2", + "colorjs.io": "^0.4.0", + "dayjs": "^1.11.5", "filepond": "^4.30.4", "filepond-plugin-image-preview": "^4.6.11", "floating-vue": "2.0.0-beta.19", diff --git a/packages/components/src/components/tag/Tag.vue b/packages/components/src/components/tag/Tag.vue index 14ab978d..d73cc14c 100644 --- a/packages/components/src/components/tag/Tag.vue +++ b/packages/components/src/components/tag/Tag.vue @@ -1,4 +1,5 @@