Skip to content

Commit

Permalink
feature: 蓝盾侧组织架构限制勾选提示由tooltip改成dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
lhzzforever committed Dec 27, 2024
1 parent 7d3dca0 commit 6adf189
Show file tree
Hide file tree
Showing 7 changed files with 577 additions and 470 deletions.
14 changes: 12 additions & 2 deletions frontend/src/components/dialog-infinite-list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@
},
nameType () {
return (payload) => {
const { name, type, username, full_name: fullName, disabled, disabledTip } = payload;
const { name, type, username, full_name: fullName, disabled } = payload;
if (disabled) {
return disabledTip || this.$t(`m.common['该成员已添加']`);
return this.$t(`m.common['该成员已添加']`);
}
const typeMap = {
user: () => {
Expand Down Expand Up @@ -302,6 +302,11 @@
if (this.isDisabled || (this.getGroupAttributes && this.getGroupAttributes().source_from_role && node.type === 'depart')) {
return;
}
// 增加蓝盾侧限制勾选组织架构业务
if (node.limitOrgNodeTip) {
this.$emit('on-show-limit', { title: node.limitOrgNodeTip });
return;
}
this.$emit('on-click', node);
if (!node.disabled) {
if (this.isStaff || this.isUnLimitedScope) {
Expand All @@ -322,6 +327,11 @@
async handleNodeClick (node) {
const isDisabled = node.disabled || this.isDisabled || (this.getGroupAttributes && this.getGroupAttributes().source_from_role && node.type === 'depart');
if (!isDisabled) {
// 增加蓝盾侧限制勾选组织架构业务
if (node.limitOrgNodeTip) {
this.$emit('on-show-limit', { title: node.limitOrgNodeTip });
return;
}
if (this.isStaff) {
node.isSelected = !node.isSelected;
this.$emit('on-checked', node.isSelected, !node.isSelected, true, node);
Expand Down
78 changes: 78 additions & 0 deletions frontend/src/components/iam-limit-org-dialog/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<template>
<bk-dialog
v-model="isShowDialog"
:width="width"
:close-icon="true"
:show-footer="false"
:ext-cls="`iam-limit-org-dialog ${extCls}`"
@after-leave="handleAfterLeave"
>
<div slot="header" class="confirm-content-wrapper">
<Icon bk type="info-circle-shape" class="warn" />
<div class="header-title">{{ title }}</div>
</div>
</bk-dialog>
</template>

<script>
export default {
props: {
show: {
type: Boolean,
default: false
},
width: {
type: Number,
default: 400
},
title: {
type: String,
default: ''
},
extCls: {
type: String,
default: ''
}
},
data () {
return {
isShowDialog: false
};
},
watch: {
show: {
handler (value) {
this.isShowDialog = !!value;
},
immediate: true
}
},
methods: {
handleAfterLeave () {
this.$emit('update:show', false);
this.$emit('on-after-leave');
}
}
};
</script>

<style lang="postcss" scoped>
.iam-limit-org-dialog {
.confirm-content-wrapper {
display: flex;
align-items: center;
padding-top: 8px;
padding-bottom: 16px;
word-break: break-all;
.warn {
font-size: 22px;
color: #ffb848;
}
.header-title {
font-size: 14px;
padding-left: 8px;
text-align: left;
}
}
}
</style>
19 changes: 15 additions & 4 deletions frontend/src/components/infinite-tree/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@
},
nameType () {
return (payload) => {
const { name, type, username, full_name: fullName, disabled, disabledTip } = payload;
const { name, type, username, full_name: fullName, disabled } = payload;
if (disabled) {
return disabledTip || this.$t(`m.common['该成员已添加']`);
return this.$t(`m.common['该成员已添加']`);
}
const typeMap = {
user: () => {
Expand Down Expand Up @@ -307,6 +307,11 @@
if (this.isDisabled || (this.getGroupAttributes && this.getGroupAttributes().source_from_role && node.type === 'depart')) {
return;
}
// 增加蓝盾侧限制勾选组织架构业务
if (node.limitOrgNodeTip) {
this.$emit('on-show-limit', { title: node.limitOrgNodeTip });
return;
}
if ((node.level === 0 || (node.async && node.disabled)) && !this.isRatingManager) {
this.expandNode(node);
return;
Expand Down Expand Up @@ -396,9 +401,15 @@
},
handleNodeClick (node) {
const isDisabled = node.disabled || this.isDisabled || (this.getGroupAttributes && this.getGroupAttributes().source_from_role && node.type === 'depart');
const { type, disabled, isSelected, limitOrgNodeTip } = node;
const isDisabled = disabled || this.isDisabled || (this.getGroupAttributes && this.getGroupAttributes().source_from_role && type === 'depart');
if (!isDisabled) {
node.isSelected = !node.isSelected;
// 增加蓝盾侧限制勾选组织架构业务
if (limitOrgNodeTip) {
this.$emit('on-show-limit', { title: limitOrgNodeTip });
return;
}
node.isSelected = !isSelected;
if (node.type === 'user') {
this.handleBanUser(node, node.isSelected);
}
Expand Down
24 changes: 13 additions & 11 deletions frontend/src/language/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,33 +573,35 @@ export const m = {
'管理员不可重复添加': 'Administrators cannot be added repeatedly',
'有关联的用户组, 无法删除': 'Associated user groups cannot be deleted',
'不可续期的用户组如下': 'The non renewable user groups are as follows: {value}',
'不可移出的用户组如下': 'The user groups that cannot be removed are as follows'
'不可移出的用户组如下': 'The user groups that cannot be removed are as follows',
'手动输入蓝盾侧限制勾选组织架构提示': 'The range of user [{value}] is too large, please select again'
},
// 二次确认弹窗相关
dialog: {
'确认删除': 'Confirm Delete?',
'确认移除': 'Confirm Remove?',
'将删除': 'Will be deleted',
'确认退出': 'Confirm quit?',
'确认解除关联': 'Confirm Disassociation?',
'确认退出用户组': 'Confirm to quit the group?',
'确认删除用户组': 'Confirm Delete?',
'将产生以下影响': 'will have the following impact',
'组内用户和组织将被全部移除': 'All users and organizations in the group will be removed',
'组权限将被全部移除': 'The group permissions will be removed',
'组内用户继承该组的权限将失效': 'The permissions of the users inherit from the group will be invalid',
'确认退出': 'Confirm quit?',
'确认删除内容?': 'Are you sure to delete {value}?',
'删除操作权限': 'the operation permission',
'删除实例权限': 'instance permission',
'删除一组实例权限': 'a set of instance permissions',
'确定要删除系统下的所有操作权限?': 'Confirm to delete all action permissions under the {value} system?',
'确认批量退出所选的用户组吗?': 'Are you sure to batch quit the selected user groups?',
'确认删除该人员模板?': 'Are you sure to delete the member template?',
'确认解除与该用户组的关联?': 'Are you sure to dissociate from this user group?',
'确认批量删除所选的人员模板吗?': 'Are you sure to batch delete the selected member templates?',
'确认把用户/组织移出该用户组?': 'Are you sure to move the user/organization out of this user group?',
'确认删除同步记录?': 'Are you sure you want to delete the synchronization record?',
'确认恢复默认?': 'Are you sure to restore defaults?'
'确认恢复默认?': 'Are you sure to restore defaults?',
'将删除': 'Will be deleted',
'将产生以下影响': 'will have the following impact',
'组内用户和组织将被全部移除': 'All users and organizations in the group will be removed',
'组权限将被全部移除': 'The group permissions will be removed',
'组内用户继承该组的权限将失效': 'The permissions of the users inherit from the group will be invalid',
'删除操作权限': 'the operation permission',
'删除实例权限': 'instance permission',
'删除一组实例权限': 'a set of instance permissions',
'用户范围过大,请重新选择': 'The user range is too large, please select again'
},
nav: {
'蓝鲸权限中心': 'BlueKing-IAM',
Expand Down
23 changes: 12 additions & 11 deletions frontend/src/language/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,33 +573,34 @@ export const m = {
'有关联的用户组, 无法删除': '有关联的用户组, 无法删除',
'不可续期的用户组如下': '不可续期的用户组如下:{value}',
'不可移出的用户组如下': '不可移出的用户组如下:{value}',
'手动输入蓝盾侧限制勾选组织架构提示': '当前组织架构人员存在权限限制'
'手动输入蓝盾侧限制勾选组织架构提示': '用户【{value}】范围过大,请重新选择'
},
// 二次确认弹窗相关
dialog: {
'确认删除': '确认删除 ?',
'确认移除': '确认移除 ?',
'将删除': '将删除',
'确认退出': '确认退出 ?',
'确认解除关联': '确认解除关联 ?',
'确认退出用户组': '确认退出用户组 ?',
'确认删除用户组': '确认删除用户组 ?',
'将产生以下影响': '将产生以下影响',
'组内用户和组织将被全部移除': '组内用户和组织将被全部移除',
'组权限将被全部移除': '组权限将被全部移除',
'组内用户继承该组的权限将失效': '组内用户继承该组的权限将失效',
'确认退出': '确认退出 ?',
'确认删除内容?': '确认删除{value}?',
'删除操作权限': '操作权限',
'删除实例权限': '实例权限',
'删除一组实例权限': '一组实例权限',
'确定要删除系统下的所有操作权限?': '确定要删除{value}的所有操作权限?',
'确认批量退出所选的用户组吗?': '确认批量退出所选的用户组吗?',
'确认删除该人员模板?': '确认删除该人员模板?',
'确认解除与该用户组的关联?': '确认解除与该用户组的关联?',
'确认批量删除所选的人员模板吗?': '确认批量删除所选的人员模板吗?',
'确认把用户/组织移出该用户组?': '确认把用户/组织移出该用户组?',
'确认删除同步记录?': '确认删除同步记录?',
'确认恢复默认?': '确认恢复默认?'
'确认恢复默认?': '确认恢复默认?',
'将删除': '将删除',
'将产生以下影响': '将产生以下影响',
'组内用户和组织将被全部移除': '组内用户和组织将被全部移除',
'组权限将被全部移除': '组权限将被全部移除',
'组内用户继承该组的权限将失效': '组内用户继承该组的权限将失效',
'删除操作权限': '操作权限',
'删除实例权限': '实例权限',
'删除一组实例权限': '一组实例权限',
'用户范围过大,请重新选择': '用户范围过大,请重新选择'
},
nav: {
'蓝鲸权限中心': '蓝鲸权限中心',
Expand Down
Loading

0 comments on commit 6adf189

Please sign in to comment.