File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ const open = async (row: RoleApi.RoleVO) => {
91
91
defineExpose ({ open }) // 提供 open 方法,用于打开弹窗
92
92
93
93
/** 提交表单 */
94
+ const emit = defineEmits ([' success' ]) // 定义 success 事件,用于操作成功后的回调
94
95
const submitForm = async () => {
95
96
// 校验表单
96
97
if (! formRef ) return
@@ -109,6 +110,8 @@ const submitForm = async () => {
109
110
await PermissionApi .assignRoleMenu (data )
110
111
message .success (t (' common.updateSuccess' ))
111
112
dialogVisible .value = false
113
+ // 发送操作成功的事件
114
+ emit (' success' )
112
115
} finally {
113
116
formLoading .value = false
114
117
}
Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ const open = async (row: RoleApi.RoleVO) => {
107
107
defineExpose ({ open }) // 提供 open 方法,用于打开弹窗
108
108
109
109
/** 提交表单 */
110
+ const emit = defineEmits ([' success' ]) // 定义 success 事件,用于操作成功后的回调
110
111
const submitForm = async () => {
111
112
formLoading .value = true
112
113
try {
@@ -121,6 +122,8 @@ const submitForm = async () => {
121
122
await PermissionApi .assignRoleDataScope (data )
122
123
message .success (t (' common.updateSuccess' ))
123
124
dialogVisible .value = false
125
+ // 发送操作成功的事件
126
+ emit (' success' )
124
127
} finally {
125
128
formLoading .value = false
126
129
}
Original file line number Diff line number Diff line change 156
156
<!-- 表单弹窗:添加/修改 -->
157
157
<RoleForm ref =" formRef" @success =" getList" />
158
158
<!-- 表单弹窗:菜单权限 -->
159
- <RoleAssignMenuForm ref =" assignMenuFormRef" />
159
+ <RoleAssignMenuForm ref =" assignMenuFormRef" @success = " getList " />
160
160
<!-- 表单弹窗:数据权限 -->
161
- <RoleDataPermissionForm ref =" dataPermissionFormRef" />
161
+ <RoleDataPermissionForm ref =" dataPermissionFormRef" @success = " getList " />
162
162
</template >
163
163
<script lang="ts" name="SystemRole" setup>
164
164
import { DICT_TYPE , getIntDictOptions } from ' @/utils/dict'
You can’t perform that action at this time.
0 commit comments