From 97c512421390912a421d5b07a95a26d6d618a88c Mon Sep 17 00:00:00 2001 From: xlsea Date: Thu, 18 Apr 2024 14:49:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/operate-drawer.vue | 17 ++--------------- .../modules/groupConfig-operate-drawer.vue | 10 ++++++++-- .../modules/namespace-operate-drawer.vue | 13 ++++++++++++- .../modules/notify-recipient-operate-drawer.vue | 6 ++++++ .../modules/notify-config-operate-drawer.vue | 6 ++++++ 5 files changed, 34 insertions(+), 18 deletions(-) diff --git a/src/components/common/operate-drawer.vue b/src/components/common/operate-drawer.vue index 07914c5..b9f1176 100644 --- a/src/components/common/operate-drawer.vue +++ b/src/components/common/operate-drawer.vue @@ -14,7 +14,7 @@ interface Props { const props = defineProps(); interface Emits { - (e: 'handleSubmit'): void; + (e: 'submitted'): void; (e: 'update:modelValue', modelValue: boolean): void; } @@ -58,19 +58,9 @@ watch( { immediate: true } ); -const closeDrawer = () => { - visible.value = false; - emit('update:modelValue', false); -}; - const onUpdateShow = (value: boolean) => { emit('update:modelValue', value); }; - -const handleSubmit = () => { - emit('handleSubmit'); - closeDrawer(); -}; diff --git a/src/views/group-config/modules/groupConfig-operate-drawer.vue b/src/views/group-config/modules/groupConfig-operate-drawer.vue index f816d26..9e566b0 100644 --- a/src/views/group-config/modules/groupConfig-operate-drawer.vue +++ b/src/views/group-config/modules/groupConfig-operate-drawer.vue @@ -47,7 +47,7 @@ function createDefaultModel(): Model { }; } -type RuleKey = Extract; +type RuleKey = Extract; const rules: Record = { namespaceId: defaultRequiredRule @@ -85,12 +85,18 @@ watch(visible, () => { diff --git a/src/views/namepase/modules/namespace-operate-drawer.vue b/src/views/namepase/modules/namespace-operate-drawer.vue index 17476c5..82acfae 100644 --- a/src/views/namepase/modules/namespace-operate-drawer.vue +++ b/src/views/namepase/modules/namespace-operate-drawer.vue @@ -66,6 +66,10 @@ function handleUpdateModelWhenEdit() { } } +function closeDrawer() { + visible.value = false; +} + async function handleSubmit() { await validate(); // request @@ -79,6 +83,7 @@ async function handleSubmit() { fetchEditNamespace({ id, name, uniqueId }); } window.$message?.success($t('common.updateSuccess')); + visible.value = false; emit('submitted'); } @@ -91,7 +96,7 @@ watch(visible, () => { diff --git a/src/views/notify/recipient/modules/notify-recipient-operate-drawer.vue b/src/views/notify/recipient/modules/notify-recipient-operate-drawer.vue index 16259f5..f751ae0 100644 --- a/src/views/notify/recipient/modules/notify-recipient-operate-drawer.vue +++ b/src/views/notify/recipient/modules/notify-recipient-operate-drawer.vue @@ -114,6 +114,12 @@ watch(visible, () => { + diff --git a/src/views/notify/scene/modules/notify-config-operate-drawer.vue b/src/views/notify/scene/modules/notify-config-operate-drawer.vue index 1f54aac..26d4cfb 100644 --- a/src/views/notify/scene/modules/notify-config-operate-drawer.vue +++ b/src/views/notify/scene/modules/notify-config-operate-drawer.vue @@ -222,6 +222,12 @@ watch(visible, () => { +