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