From 512ee822160043ca82a34ed7d8ecb5ec1baccb3c Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Tue, 18 Oct 2022 09:58:09 +0800 Subject: [PATCH] refactor: api of dialog component (#646) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind api-change /kind improvement /milestone 2.0 #### What this PR does / why we need it: 重构 Dialog 组件使用 API 的调用方式,改为与 Toast 组件一致。https://github.com/halo-dev/console/pull/644 同样的,使用此方式调用 Dialog 组件不限制在 Vue 组件。 #### Special notes for your reviewer: /cc @halo-dev/sig-halo-console 需要测试后台各个操作的会话框是否正常。 #### Does this PR introduce a user-facing change? ```release-note 重构 Dialog 组件使用 API 的调用方式。 ``` --- .../src/components/dialog/Dialog.story.vue | 29 ++++--- .../src/components/dialog/DialogProvider.vue | 27 ------- .../src/components/dialog/dialog-manager.ts | 75 +++++++++++++++++++ .../components/src/components/dialog/index.ts | 3 +- .../src/components/dialog/interface.ts | 12 +++ .../src/components/dialog/use-dialog.ts | 39 ---------- packages/shared/src/layouts/BasicLayout.vue | 5 +- src/App.vue | 7 +- .../UploadSelectorProvider.vue | 6 +- .../attachments/composables/use-attachment.ts | 8 +- src/modules/contents/comments/CommentList.vue | 8 +- .../comments/components/CommentListItem.vue | 8 +- .../comments/components/ReplyListItem.vue | 6 +- src/modules/contents/pages/SinglePageList.vue | 6 +- src/modules/contents/posts/PostList.vue | 8 +- .../composables/use-post-category.ts | 6 +- .../posts/tags/composables/use-post-tag.ts | 6 +- src/modules/interface/menus/Menus.vue | 8 +- .../interface/menus/components/MenuList.vue | 6 +- src/modules/interface/themes/ThemeDetail.vue | 6 +- .../themes/components/ThemeListModal.vue | 6 +- .../interface/themes/composables/use-theme.ts | 6 +- .../plugins/components/PluginInstallModal.vue | 5 +- .../system/plugins/composables/use-plugin.ts | 8 +- src/modules/system/roles/RoleList.vue | 5 +- src/modules/system/users/UserList.vue | 8 +- 26 files changed, 153 insertions(+), 164 deletions(-) delete mode 100644 packages/components/src/components/dialog/DialogProvider.vue create mode 100644 packages/components/src/components/dialog/dialog-manager.ts delete mode 100644 packages/components/src/components/dialog/use-dialog.ts diff --git a/packages/components/src/components/dialog/Dialog.story.vue b/packages/components/src/components/dialog/Dialog.story.vue index 876f2267..985016d3 100644 --- a/packages/components/src/components/dialog/Dialog.story.vue +++ b/packages/components/src/components/dialog/Dialog.story.vue @@ -1,6 +1,6 @@