diff --git a/cmdb-ui/src/components/RoleTransfer/index.js b/cmdb-ui/src/components/RoleTransfer/index.js new file mode 100644 index 0000000..d7698dc --- /dev/null +++ b/cmdb-ui/src/components/RoleTransfer/index.js @@ -0,0 +1,2 @@ +import RolesTransfer from './index.vue' +export default RolesTransfer diff --git a/cmdb-ui/src/components/RoleTransfer/index.vue b/cmdb-ui/src/components/RoleTransfer/index.vue new file mode 100644 index 0000000..d08bf62 --- /dev/null +++ b/cmdb-ui/src/components/RoleTransfer/index.vue @@ -0,0 +1,202 @@ + + + + + + + + {{ item.name }} + + + + + + + + + + {{ getLabel(right) }} + + + + + + + + diff --git a/cmdb-ui/src/modules/acl/views/resources.vue b/cmdb-ui/src/modules/acl/views/resources.vue index 25db291..f888088 100644 --- a/cmdb-ui/src/modules/acl/views/resources.vue +++ b/cmdb-ui/src/modules/acl/views/resources.vue @@ -299,7 +299,6 @@ export default { if (rtypeId) { this.currentType = this.allResourceTypes.find((item) => item.id === rtypeId) } - p this.searchData() }, handlePerm(record) { diff --git a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/ciTypeGrant.vue b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/ciTypeGrant.vue index 3c904c4..74df098 100644 --- a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/ciTypeGrant.vue +++ b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/ciTypeGrant.vue @@ -27,7 +27,7 @@ 授权用户/部门 - + 授权角色 diff --git a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/grantComp.vue b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/grantComp.vue index bf7da2b..a86593c 100644 --- a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/grantComp.vue +++ b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/grantComp.vue @@ -199,24 +199,33 @@ export default { this.$refs.grantModal.open('depart') this.grantType = grantType }, - // 授权common-setting中的角色 从中拿到roleid + // 授权最古老的角色权限 grantRole(grantType) { this.$refs.grantModal.open('role') this.grantType = grantType }, - handleOk(params) { + handleOk(params, type) { const { grantType } = this - console.log(params) - const rids = [ - ...params.department.map((rid) => { - const _find = this.allDepartments.find((dep) => dep.acl_rid === rid) - return { rid, name: _find?.department_name ?? rid } - }), - ...params.user.map((rid) => { - const _find = this.allEmployees.find((dep) => dep.acl_rid === rid) - return { rid, name: _find?.nickname ?? rid } - }), - ] + let rids + if (type === 'depart') { + rids = [ + ...params.department.map((rid) => { + const _find = this.allDepartments.find((dep) => dep.acl_rid === rid) + return { rid, name: _find?.department_name ?? rid } + }), + ...params.user.map((rid) => { + const _find = this.allEmployees.find((dep) => dep.acl_rid === rid) + return { rid, name: _find?.nickname ?? rid } + }), + ] + } + if (type === 'role') { + rids = [ + ...params.map((role) => { + return { rid: role.id, name: role.name } + }), + ] + } if (grantType === 'ci_type') { this.tableData.unshift( ...rids.map(({ rid, name }) => { diff --git a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/grantModal.vue b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/grantModal.vue index 03a859b..994f12b 100644 --- a/cmdb-ui/src/modules/cmdb/components/cmdbGrant/grantModal.vue +++ b/cmdb-ui/src/modules/cmdb/components/cmdbGrant/grantModal.vue @@ -7,14 +7,16 @@ ref="employeeTransfer" :height="350" /> +