fix: bugs

pull/5/MERGE
xingyu 2023-04-25 17:28:59 +08:00
parent c38e983e7b
commit 8b10a6f003
4 changed files with 8 additions and 4 deletions

View File

@ -47,6 +47,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
const res = await getRole(data.record.id)
const menuRes = await listRoleMenus(data.record.id)
res.roleId = data.record.id
res.menuIds = menuRes
setFieldsValue({ ...res })
})
@ -54,6 +55,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
values.menuIds = values.menuIds.checked
setModalProps({ confirmLoading: true })
await assignRoleMenu(values)
closeModal()

View File

@ -45,6 +45,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
treeData.value = handleTree(res, 'id')
}
const res = await getRole(data.record.id)
res.roleId = data.record.id
setFieldsValue({ ...res })
})

View File

@ -122,8 +122,8 @@ export const formSchema: FormSchema[] = [
export const menuScopeFormSchema: FormSchema[] = [
{
label: '编号',
field: 'id',
label: '角色编号',
field: 'roleId',
show: false,
component: 'Input'
},
@ -149,8 +149,8 @@ export const menuScopeFormSchema: FormSchema[] = [
export const dataScopeFormSchema: FormSchema[] = [
{
label: '编号',
field: 'id',
label: '角色编号',
field: 'roleId',
show: false,
component: 'Input'
},

View File

@ -55,6 +55,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
values.menuIds = values.menuIds.checked
setModalProps({ confirmLoading: true })
if (unref(isUpdate)) {
await updateTenantPackage(values)