perf: close attachment upload modal after click complete button (#3784)

#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

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

支持在附件上传弹框中点击完成按钮关闭弹框。

<img width="647" alt="image" src="https://user-images.githubusercontent.com/21301288/232964793-d4e94e7a-fc81-4d1b-b0fc-b93d8f5bc537.png">

#### Special notes for your reviewer:

测试方式:

1. 测试上传完附件之后,点击完成按钮,观察是否关闭上传弹框即可。

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

```release-note
优化 Console 端上传附件的弹框,支持点击完成按钮以关闭弹框。
```
pull/3819/head
Ryan Wang 2023-04-21 20:33:41 +08:00 committed by GitHub
parent f076fc5740
commit 50832a09df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -24,6 +24,7 @@ const props = withDefaults(
note?: string;
method?: "GET" | "POST" | "PUT" | "HEAD" | "get" | "post" | "put" | "head";
disabled?: boolean;
doneButtonHandler?: () => void;
}>(),
{
restrictions: undefined,
@ -34,6 +35,7 @@ const props = withDefaults(
note: undefined,
method: "post",
disabled: false,
doneButtonHandler: undefined,
}
);
@ -96,6 +98,11 @@ onUnmounted(() => {
<template>
<dashboard
:uppy="uppy"
:props="{ theme: 'light', disabled: disabled, note: note }"
:props="{
theme: 'light',
disabled: disabled,
note: note,
doneButtonHandler: doneButtonHandler,
}"
/>
</template>

View File

@ -226,6 +226,7 @@ watch(
? ''
: $t('core.attachment.upload_modal.filters.policy.not_select')
"
:done-button-handler="() => onVisibleChange(false)"
/>
</div>
</VModal>