Showing
2 changed files
with
4 additions
and
2 deletions
| ... | ... | @@ -79,6 +79,8 @@ |
| 79 | 79 | const originMenus = ref(); |
| 80 | 80 | const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { |
| 81 | 81 | allCheckedKeys.value = []; |
| 82 | + originMenus.value = []; | |
| 83 | + allCheckedKeys.value.length = 0; | |
| 82 | 84 | resetFields(); |
| 83 | 85 | roleId.value = ''; |
| 84 | 86 | // 在打开弹窗时清除所有选择的菜单 |
| ... | ... | @@ -141,7 +143,6 @@ |
| 141 | 143 | status: values.status, |
| 142 | 144 | menu: allCheckedKeys.value.length ? allCheckedKeys.value : originMenus.value, |
| 143 | 145 | }; |
| 144 | - if (allCheckedKeys.value.length == 0) return createMessage.error('请勾选权限菜单'); | |
| 145 | 146 | if (req.menu == undefined) return createMessage.error('请勾选权限菜单'); |
| 146 | 147 | saveOrUpdateRoleInfoWithMenu(req).then(() => { |
| 147 | 148 | closeDrawer(); | ... | ... |
| ... | ... | @@ -85,6 +85,8 @@ |
| 85 | 85 | const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { |
| 86 | 86 | setDrawerProps({ confirmLoading: false }); |
| 87 | 87 | allCheckedKeys.value = []; |
| 88 | + originMenus.value = []; | |
| 89 | + allCheckedKeys.value.length = 0; | |
| 88 | 90 | resetFields(); |
| 89 | 91 | roleId.value = ''; |
| 90 | 92 | // 在打开弹窗时清除所有选择的菜单 |
| ... | ... | @@ -145,7 +147,6 @@ |
| 145 | 147 | roleType: RoleEnum.TENANT_ADMIN, |
| 146 | 148 | menu: allCheckedKeys.value.length ? allCheckedKeys.value : originMenus.value, |
| 147 | 149 | }; |
| 148 | - if (allCheckedKeys.value.length == 0) return createMessage.error('请勾选权限菜单'); | |
| 149 | 150 | if (req.menu == undefined) return createMessage.error('请勾选权限菜单'); |
| 150 | 151 | saveOrUpdateRoleInfoWithMenu(req).then(() => { |
| 151 | 152 | closeDrawer(); | ... | ... |