Skip to content

Commit

Permalink
Merge pull request #2396 from lhzzforever/dev/develop_ci
Browse files Browse the repository at this point in the history
feature: 处理i人员选择器组件在iam系统和蓝盾系统中不需要校验授权范围的页面
  • Loading branch information
huangpeng0428 authored Nov 28, 2023
2 parents 92e28fd + 0223aa0 commit 744a470
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 72 deletions.
8 changes: 6 additions & 2 deletions frontend/src/components/dialog-infinite-list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
currentFocusIndex: this.focusIndex,
organizationIndex: -1,
userIndex: -1,
enableOrganizationCount: window.ENABLE_ORGANIZATION_COUNT.toLowerCase() === 'true'
enableOrganizationCount: window.ENABLE_ORGANIZATION_COUNT.toLowerCase() === 'true',
noVerifyRoutes: ['authorBoundaryEditFirstLevel', 'authorBoundaryEditSecondLevel', 'applyJoinUserGroup', 'addMemberBoundary', 'gradingAdminCreate', 'gradingAdminEdit']
};
},
computed: {
Expand Down Expand Up @@ -280,7 +281,10 @@
node.is_selected = !node.is_selected;
this.$emit('on-checked', node.is_selected, !node.is_selected, node.is_selected, node);
} else {
if (getParamsValue('search_scene') && getParamsValue('search_scene') === 'add') {
if (
(getParamsValue('search_scene') && getParamsValue('search_scene') === 'add')
|| this.noVerifyRoutes.includes(this.$route.name)
) {
node.is_selected = !node.is_selected;
this.$emit('on-checked', node.is_selected, !node.is_selected, node.is_selected, node);
} else {
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/components/header/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ $cubic-bezier: cubic-bezier(0.4, 0, 0.2, 1);
&.has-cursor {
cursor: pointer;
}
.breadcrumbs-content {
display: flex;
align-items: center;
}
.breadcrumbs-back {
position: relative;
left: -5px;
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/header/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
:class="backRouter ? 'has-cursor' : ''"
v-show="isShowExternal || (!mainContentLoading && !externalSystemsLayout.hideIamBreadCrumbs)"
@click="back">
<div v-if="!isHide">
<div v-if="!isHide" class="breadcrumbs-content">
<Icon type="arrows-left" class="breadcrumbs-back" v-if="backRouter" />
<h2 v-if="customBreadCrumbTitles.includes(routeName)" class="breadcrumbs-current">
<h2 v-if="customBreadCrumbTitles.includes(routeName)" class="breadcrumbs-current single-hide">
{{ $t(`m.info['用户组成员添加权限']`, { value: `${$t(`m.common['【']`)}${userGroupName}${$t(`m.common['】']`)}` }) }}
</h2>
<h2 v-else class="breadcrumbs-current">{{ headerTitle }}</h2>
<h2 v-else class="breadcrumbs-current single-hide">{{ headerTitle }}</h2>
</div>
</div>
<!-- <div class="user fr">
Expand Down
67 changes: 35 additions & 32 deletions frontend/src/views/group/components/iam-add-member.vue
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,8 @@
manualTableList: [],
manualTableListStorage: [],
hasSelectedManualDepartments: [],
hasSelectedManualUsers: []
hasSelectedManualUsers: [],
noVerifyRoutes: ['authorBoundaryEditFirstLevel', 'authorBoundaryEditSecondLevel', 'applyJoinUserGroup', 'addMemberBoundary', 'gradingAdminCreate', 'gradingAdminEdit']
};
},
computed: {
Expand Down Expand Up @@ -1088,39 +1089,41 @@
// 校验部门/用户范围是否满足条件
async fetchSubjectScopeCheck (payload, mode) {
const subjects = payload.map((item) => {
const { id, type, username } = item;
const typeMap = {
depart: () => {
return {
type: 'department',
id
};
},
user: () => {
return {
type: 'user',
id: username
};
}
};
return typeMap[type || mode]();
});
try {
const { code, data } = await this.$store.dispatch('organization/getSubjectScopeCheck', { subjects });
if (code === 0 && data) {
const idList = data.map((v) => v.id);
const result = payload.filter((item) => {
if (item.type === 'depart') {
item.type = 'department';
if (!this.noVerifyRoutes.includes(this.$route.name)) {
const subjects = payload.map((item) => {
const { id, type, username } = item;
const typeMap = {
depart: () => {
return {
type: 'department',
id
};
},
user: () => {
return {
type: 'user',
id: username
};
}
return data.map((v) => v.type).includes(item.type)
&& (idList.includes(String(item.id)) || idList.includes(item.username));
});
return result;
};
return typeMap[type || mode]();
});
try {
const { code, data } = await this.$store.dispatch('organization/getSubjectScopeCheck', { subjects });
if (code === 0 && data) {
const idList = data.map((v) => v.id);
const result = payload.filter((item) => {
if (item.type === 'depart') {
item.type = 'department';
}
return data.map((v) => v.type).includes(item.type)
&& (idList.includes(String(item.id)) || idList.includes(item.username));
});
return result;
}
} catch (e) {
this.messageAdvancedError(e);
}
} catch (e) {
this.messageAdvancedError(e);
}
},
Expand Down
67 changes: 35 additions & 32 deletions frontend/src/views/my-manage-space/add-member-boundary/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,8 @@
manualTableList: [],
manualTableListStorage: [],
hasSelectedManualDepartments: [],
hasSelectedManualUsers: []
hasSelectedManualUsers: [],
noVerifyRoutes: ['authorBoundaryEditFirstLevel', 'authorBoundaryEditSecondLevel', 'applyJoinUserGroup', 'addMemberBoundary', 'gradingAdminCreate', 'gradingAdminEdit']
};
},
computed: {
Expand Down Expand Up @@ -1083,39 +1084,41 @@
// 校验部门/用户范围是否满足条件
async fetchSubjectScopeCheck (payload, mode) {
const subjects = payload.map((item) => {
const { id, type, username } = item;
const typeMap = {
depart: () => {
return {
type: 'department',
id
};
},
user: () => {
return {
type: 'user',
id: username
};
}
};
return typeMap[type || mode]();
});
try {
const { code, data } = await this.$store.dispatch('organization/getSubjectScopeCheck', { subjects });
if (code === 0 && data) {
const idList = data.map((v) => v.id);
const result = payload.filter((item) => {
if (item.type === 'depart') {
item.type = 'department';
if (!this.noVerifyRoutes.includes(this.$route.name)) {
const subjects = payload.map((item) => {
const { id, type, username } = item;
const typeMap = {
depart: () => {
return {
type: 'department',
id
};
},
user: () => {
return {
type: 'user',
id: username
};
}
return data.map((v) => v.type).includes(item.type)
&& (idList.includes(String(item.id)) || idList.includes(item.username));
});
return result;
};
return typeMap[type || mode]();
});
try {
const { code, data } = await this.$store.dispatch('organization/getSubjectScopeCheck', { subjects });
if (code === 0 && data) {
const idList = data.map((v) => v.id);
const result = payload.filter((item) => {
if (item.type === 'depart') {
item.type = 'department';
}
return data.map((v) => v.type).includes(item.type)
&& (idList.includes(String(item.id)) || idList.includes(item.username));
});
return result;
}
} catch (e) {
this.messageAdvancedError(e);
}
} catch (e) {
this.messageAdvancedError(e);
}
},
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/views/my-manage-space/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1089,4 +1089,10 @@
}
}
}
.custom-perm-del-info {
.bk-dialog-footer {
padding: 0 65px 33px !important;
}
}
</style>
2 changes: 1 addition & 1 deletion frontend/src/views/perm-apply/apply-custom-perm/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
<span v-if="row.expired_at_display">
{{ row.expired_at === 4102444800 ?
`(${row.expired_at_display})`
: `(${$t(`m.common['有效期']`)}${row.expired_at_display})`}}
: `(${$t(`m.common['有效期']`)} ${row.expired_at_display})`}}
</span>
</template>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@
<span v-else>
{{ row.expired_at === 4102444800 ?
`(${row.expired_at_display})`
: `(${$t(`m.common['有效期']`)}${row.expired_at_display})`}}
:
`(${$t(`m.common['有效期']`)} ${row.expired_at_display})`}}
</span>
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/perm/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
this.formatCheckGroups();
this.isEmpty = personalGroupList.length < 1 && customData.length < 1
this.isEmpty = personalGroupList.length < 1 && systemList.length < 1
&& teporarySystemList.length < 1 && departmentGroupList.length < 1;
this.soonGroupLength = data3 && data3.results ? data3.results.length : 0;
this.soonPermLength = data4 ? data4.length : 0;
Expand Down

0 comments on commit 744a470

Please sign in to comment.