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 @@ - + - +