From 75c4d6608c7657bf26a4d6d8ca918a9accc44c15 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 19 Apr 2023 20:16:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=A7=92=E8=89=B2=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90=E5=9B=9E=E6=98=BE?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/role/RoleAssignMenuForm.vue | 3 +++ src/views/system/role/RoleDataPermissionForm.vue | 3 +++ src/views/system/role/index.vue | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/views/system/role/RoleAssignMenuForm.vue b/src/views/system/role/RoleAssignMenuForm.vue index 9b7d5a15..cfd30842 100644 --- a/src/views/system/role/RoleAssignMenuForm.vue +++ b/src/views/system/role/RoleAssignMenuForm.vue @@ -91,6 +91,7 @@ const open = async (row: RoleApi.RoleVO) => { defineExpose({ open }) // 提供 open 方法,用于打开弹窗 /** 提交表单 */ +const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 const submitForm = async () => { // 校验表单 if (!formRef) return @@ -109,6 +110,8 @@ const submitForm = async () => { await PermissionApi.assignRoleMenu(data) message.success(t('common.updateSuccess')) dialogVisible.value = false + // 发送操作成功的事件 + emit('success') } finally { formLoading.value = false } diff --git a/src/views/system/role/RoleDataPermissionForm.vue b/src/views/system/role/RoleDataPermissionForm.vue index 87a33e6c..279ba973 100644 --- a/src/views/system/role/RoleDataPermissionForm.vue +++ b/src/views/system/role/RoleDataPermissionForm.vue @@ -107,6 +107,7 @@ const open = async (row: RoleApi.RoleVO) => { defineExpose({ open }) // 提供 open 方法,用于打开弹窗 /** 提交表单 */ +const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 const submitForm = async () => { formLoading.value = true try { @@ -121,6 +122,8 @@ const submitForm = async () => { await PermissionApi.assignRoleDataScope(data) message.success(t('common.updateSuccess')) dialogVisible.value = false + // 发送操作成功的事件 + emit('success') } finally { formLoading.value = false } diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index 4df19ef8..e7b8158b 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -156,9 +156,9 @@ - + - +