diff --git a/orion-ops-ui/src/components/system/menu/grant/menu-grant-table.vue b/orion-ops-ui/src/components/system/menu/grant/menu-grant-table.vue new file mode 100644 index 00000000..ce97e26f --- /dev/null +++ b/orion-ops-ui/src/components/system/menu/grant/menu-grant-table.vue @@ -0,0 +1,194 @@ + + + + + + + diff --git a/orion-ops-ui/src/views/user/role/components/role-menu-grant-modal.vue b/orion-ops-ui/src/views/user/role/components/role-menu-grant-modal.vue index 1340206d..16a0e118 100644 --- a/orion-ops-ui/src/views/user/role/components/role-menu-grant-modal.vue +++ b/orion-ops-ui/src/views/user/role/components/role-menu-grant-modal.vue @@ -3,9 +3,9 @@ body-class="modal-form" title-align="start" title="分配菜单" + width="80%" :top="80" - :width="480" - :body-style="{padding: '16px 16px 0 16px'}" + :body-style="{padding: '16px 16px 0 16px', 'margin-bottom': '16px'}" :align-center="false" :draggable="true" :mask-closable="false" @@ -14,25 +14,15 @@ :cancel-button-props="{ disabled: loading }" :on-before-ok="handlerOk" @close="handleClose"> - -
- -
- 角色名称 - {{ roleRecord.name }} -
- -
- 角色编码 - {{ roleRecord.code }} -
- - -
-
+
+ + {{ roleRecord.name }} {{ roleRecord.code }} + - + 菜单分配后需要用户手动刷新页面才会生效 + + + +
@@ -51,13 +41,12 @@ import { Message } from '@arco-design/web-vue'; import { useCacheStore } from '@/store'; import { getMenuList } from '@/api/system/menu'; - - import MenuSelectorTree from '@/components/system/menu/selector/menu-selector-tree.vue'; + import MenuGrantTable from '@/components/system/menu/grant/menu-grant-table.vue'; const { visible, setVisible } = useVisible(); const { loading, setLoading } = useLoading(); - const tree = ref(); + const table = ref(); const roleRecord = ref({} as RoleQueryResponse); // 打开新增 @@ -75,7 +64,7 @@ } // 获取角色菜单 const { data: roleMenuIdList } = await getRoleMenuId(record.id); - tree.value.init(roleMenuIdList); + table.value.init(roleMenuIdList); } catch (e) { } finally { setLoading(false); @@ -96,7 +85,7 @@ // 修改 await grantRoleMenu({ roleId: roleRecord.value.id, - menuIdList: [...tree.value.getValue()] + menuIdList: [...table.value.getValue()] } as RoleGrantMenuRequest); Message.success('分配成功'); // 清空 @@ -123,25 +112,8 @@