修复角色管理数据权限回显问题

This commit is contained in:
YunaiV 2023-04-19 20:16:36 +08:00
parent 22e5b45d84
commit 75c4d6608c
3 changed files with 8 additions and 2 deletions

View File

@ -91,6 +91,7 @@ const open = async (row: RoleApi.RoleVO) => {
defineExpose({ open }) // open defineExpose({ open }) // open
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => { const submitForm = async () => {
// //
if (!formRef) return if (!formRef) return
@ -109,6 +110,8 @@ const submitForm = async () => {
await PermissionApi.assignRoleMenu(data) await PermissionApi.assignRoleMenu(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
dialogVisible.value = false dialogVisible.value = false
//
emit('success')
} finally { } finally {
formLoading.value = false formLoading.value = false
} }

View File

@ -107,6 +107,7 @@ const open = async (row: RoleApi.RoleVO) => {
defineExpose({ open }) // open defineExpose({ open }) // open
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => { const submitForm = async () => {
formLoading.value = true formLoading.value = true
try { try {
@ -121,6 +122,8 @@ const submitForm = async () => {
await PermissionApi.assignRoleDataScope(data) await PermissionApi.assignRoleDataScope(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
dialogVisible.value = false dialogVisible.value = false
//
emit('success')
} finally { } finally {
formLoading.value = false formLoading.value = false
} }

View File

@ -156,9 +156,9 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<RoleForm ref="formRef" @success="getList" /> <RoleForm ref="formRef" @success="getList" />
<!-- 表单弹窗菜单权限 --> <!-- 表单弹窗菜单权限 -->
<RoleAssignMenuForm ref="assignMenuFormRef" /> <RoleAssignMenuForm ref="assignMenuFormRef" @success="getList" />
<!-- 表单弹窗数据权限 --> <!-- 表单弹窗数据权限 -->
<RoleDataPermissionForm ref="dataPermissionFormRef" /> <RoleDataPermissionForm ref="dataPermissionFormRef" @success="getList" />
</template> </template>
<script lang="ts" name="SystemRole" setup> <script lang="ts" name="SystemRole" setup>
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'