Skip to content

Commit

Permalink
Merge pull request #2078 from TencentBlueKing/develop
Browse files Browse the repository at this point in the history
v1.10.9
  • Loading branch information
zhu327 authored Jul 7, 2023
2 parents 504677c + a964cb0 commit 7e544ed
Show file tree
Hide file tree
Showing 23 changed files with 884 additions and 336 deletions.
458 changes: 283 additions & 175 deletions frontend/src/components/choose-ip/sideslider.vue

Large diffs are not rendered by default.

20 changes: 18 additions & 2 deletions frontend/src/components/custom-perm-system-policy/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@
<span class="number">{{ permLength }}</span>
{{ $t(`m.common['个']`) }}
{{ $t(`m.perm['操作权限']`) }}
<span
v-if="isAllDelete"
class="del-all-icon">
<Icon type="delete-line" @click.stop="handleDeleteAll" />
</span>
</div>
</div>
<div class="content" v-if="isExpanded">
<div class="slot-content">
<slot />
</div>
<p class="expand-action" @click="handlePackup">
<p class="expand-action" @click="handleCollapse">
<Icon :type="isExpanded ? 'up-angle' : 'down-angle'" />
{{ $t(`m.common['点击收起']`) }}
</p>
Expand Down Expand Up @@ -44,6 +49,10 @@
onePerm: {
type: Number,
default: 0
},
isAllDelete: {
type: Boolean,
default: false
}
},
data () {
Expand All @@ -64,7 +73,7 @@
}
},
methods: {
handlePackup () {
handleCollapse () {
this.isExpanded = false;
this.$emit('update:expanded', false);
this.$emit('on-expanded', false);
Expand All @@ -74,6 +83,9 @@
this.isExpanded = !this.isExpanded;
this.$emit('update:expanded', true);
this.$emit('on-expanded', true);
},
handleDeleteAll () {
this.$emit('on-delete-all');
}
}
};
Expand Down Expand Up @@ -118,6 +130,10 @@
font-weight: 600;
}
}
.del-all-icon {
margin-left: 5px;
font-size: 14px;
}
}
.content {
position: relative;
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/render-renewal-dialog/display.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@
if (this.status === 'yet') {
return this.$t(`m.common['已过期']`);
}
return `${this.curRestDays}${this.$t(`m.common['天']`)}`;
return this.$t(`m.info['天数']`, { value: this.curRestDays });
},
afterRenewalDisplay () {
if (this.renewalTime === PERMANENT_TIMESTAMP) {
return this.$t(`m.common['永久']`);
}
const days = Math.floor(this.renewalTime / (24 * 60 * 60));
if (this.status === 'yet') {
return `${days}${this.$t(`m.common['天']`)}`;
return this.$t(`m.info['天数']`, { value: days });
}
return `${days + this.curRestDays}${this.$t(`m.common['天']`)}`;
return this.$t(`m.info['天数']`, { value: days + this.curRestDays });
}
}
};
Expand Down
23 changes: 18 additions & 5 deletions frontend/src/language/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const m = {
'取消全选': 'Deselect All',
'理由': 'Reason',
'操作': 'Action name',
'操作-table': 'Actions',
'申请期限': 'Expiration date',
'无需关联实例': 'No need to associate instance',
'无生效条件': 'No effective condition',
Expand Down Expand Up @@ -265,7 +266,8 @@ export const m = {
'关联到以下用户组': ' will be associated with the following groups',
'离开': 'LEAVE',
'更多': 'More',
'资源实例': 'Resource instance'
'资源实例': 'Resource instance',
'批量无限制': 'Unlimited batch size'
},
// 校验
verify: {
Expand Down Expand Up @@ -500,7 +502,10 @@ export const m = {
'已选数量': '{value} selected',
'tab操作实例': '{value} Instance',
'解除与权限模板名称的关联,当前用户将不再继承该模板权限。': 'Disassociate from the permission template {value}, and the current user will no longer inherit the template permissions.',
'用户组成员添加权限': 'Add permissions to user group {value}'
'用户组成员添加权限': 'Add permissions to user group {value}',
'天数': '{value} days',
'第几项实例和属性不能都为空': 'The instance and attribute of item {value} cannot be empty',
'权限个数': '{value} permissions'
},
// 二次确认弹窗相关
dialog: {
Expand All @@ -518,7 +523,8 @@ export const m = {
'确认删除内容?': 'Are you sure to delete {value}?',
'删除操作权限': 'the operation permission',
'删除实例权限': 'instance permission',
'删除一组实例权限': 'a set of instance permissions'
'删除一组实例权限': 'a set of instance permissions',
'确定要删除系统下的所有操作权限?': 'Confirm to delete all action permissions under the {value} system?'
},
nav: {
'蓝鲸权限中心': 'BlueKing-IAM',
Expand Down Expand Up @@ -708,7 +714,9 @@ export const m = {
'临时权限申请': 'Apply for temporary permissions',
'一组实例权限': ' A Set of Instance Permissions',
'不能删除当前操作': 'Unable to delete current permission',
'个操作关联了': ' related actions have been completed '
'个操作关联了': ' related actions have been completed ',
'查看实例资源权限组': 'View instance resource permission groups',
'删除实例资源权限组': 'Delete instance resource permission groups'
},
permTemplate: {
'模板名': 'Template name',
Expand Down Expand Up @@ -793,7 +801,12 @@ export const m = {
'用户组名': 'Group name: ',
'描述': 'Description: ',
'ID': 'ID: ',
'创建时间': 'Created at: '
'创建时间': 'Created at: ',
'查看实例权限': 'View instance permissions',
'删除操作权限': 'Delete action permissions',
'暂无关联实例': 'No associated instance',
'所属组织架构': 'Organizational structure',
'请输入至少3个字符的用户/组织,按enter键搜索': 'Please enter user/organization with at least 3 characters and press enter to search'
},
resource: {
'无限制总文案': 'If the action does not require restricted instances, select unlimited',
Expand Down
23 changes: 18 additions & 5 deletions frontend/src/language/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const m = {
'取消全选': '取消全选',
'理由': '理由',
'操作': '操作名',
'操作-table': '操作',
'申请期限': '申请期限',
'无需关联实例': '无需关联实例',
'无生效条件': '无生效条件',
Expand Down Expand Up @@ -264,7 +265,8 @@ export const m = {
'关联到以下用户组': '关联到以下用户组',
'离开': '离开',
'更多': '更多',
'资源实例': '资源实例'
'资源实例': '资源实例',
'批量无限制': '批量无限制'
},
// 校验
verify: {
Expand Down Expand Up @@ -501,7 +503,10 @@ export const m = {
'已选数量': '已选 {value} 条',
'tab操作实例': '{value}实例',
'解除与权限模板名称的关联,当前用户将不再继承该模板权限。': '解除与权限模板{value}的关联,当前用户将不再继承该模板权限。',
'用户组成员添加权限': '用户组{value}添加权限'
'用户组成员添加权限': '用户组{value}添加权限',
'天数': '{value}天',
'第几项实例和属性不能都为空': '第{value}项实例和属性不能都为空',
'权限个数': '{value}个权限'
},
// 二次确认弹窗相关
dialog: {
Expand All @@ -519,7 +524,8 @@ export const m = {
'确认删除内容?': '确认删除{value}?',
'删除操作权限': '操作权限',
'删除实例权限': '实例权限',
'删除一组实例权限': '一组实例权限'
'删除一组实例权限': '一组实例权限',
'确定要删除系统下的所有操作权限?': '确定要删除{value}的所有操作权限?'
},
nav: {
'蓝鲸权限中心': '蓝鲸权限中心',
Expand Down Expand Up @@ -710,7 +716,9 @@ export const m = {
'临时权限申请': '临时权限申请',
'一组实例权限': '一组实例权限',
'不能删除当前操作': '不能删除当前操作',
'个操作关联了': '个操作关联了'
'个操作关联了': '个操作关联了',
'查看实例资源权限组': '查看实例资源权限组',
'删除实例资源权限组': '删除实例资源权限组'
},
permTemplate: {
'模板名': '模板名',
Expand Down Expand Up @@ -796,7 +804,12 @@ export const m = {
'用户组名': '用户组名:',
'描述': '描述:',
'ID': 'ID:',
'创建时间': '创建时间:'
'创建时间': '创建时间:',
'查看实例权限': '查看实例权限',
'删除操作权限': '删除操作权限',
'暂无关联实例': '暂无关联实例',
'所属组织架构': '所属组织架构',
'请输入至少3个字符的用户/组织,按enter键搜索': '请输入至少3个字符的用户/组织,按enter键搜索'
},
resource: {
'无限制总文案': '如果该操作无需限制实例,请选择无限制',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/views/group/add-perm/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,7 @@
display: flex;
justify-content: flex-end;
margin-top: 16px;
margin-bottom: 10px;
line-height: 24px;
.tips,
.text {
Expand Down
38 changes: 26 additions & 12 deletions frontend/src/views/group/common/render-perm-item-new.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<div :class="['iam-perm-item', extCls]">
<div class="header" @click="handleExpanded">
<div
class="header"
@click="handleExpanded">
<Icon bk class="expanded-icon" :type="isExpanded ? 'down-shape' : 'right-shape'" />
<template v-if="!externalSystemsLayout.userGroup.groupDetail.hideGroupPermExpandTitle">
<label class="title">{{ title }}</label>
Expand All @@ -10,23 +12,28 @@
{{ $t(`m.common['个']`) }}
{{ $t(`m.nav['权限模板']`) }}
</div>
<template v-if="templateCount > 0 && policyCount > 0 && !externalCustom"></template>
<template v-if="templateCount > 0 && policyCount > 0 && !externalCustom">{{ $t(`m.common[',']`) }}</template>
<div :class="['sub-title', { 'no-margin': templateCount }, { 'set-margin': !templateCount }]"
v-if="policyCount > 0 && !externalCustom">
<span class="number">{{ policyCount }}</span>
<span>{{ $t(`m.common['个']`) }}{{ $t(`m.perm['自定义权限']`) }}</span>
</div>
</template>
<template v-else>
<label class="title">{{ templateCount + policyCount }}</label>
<span>{{ $t(`m.common['个']`) }}</span>
<span :class="
[
{ 'external-perm-text': !['zh-cn'].includes(language) }
]">
{{ $t(`m.common['权限']`) }}
</span>
</template>
<div
v-else
ref="externalCustomContent"
class="flex-between"
>
<span class="title">{{ title }}</span>
<div class="external-custom-count">
<span :class="
[
{ 'external-perm-text': !['zh-cn'].includes(language) }
]">
{{ $t(`m.info['权限个数']`, { value: templateCount + policyCount }) }}
</span>
</div>
</div>
</div>
<div class="content" v-if="isExpanded">
<div class="slot-content">
Expand Down Expand Up @@ -109,6 +116,9 @@
this.isExpanded = !this.isExpanded;
this.$emit('update:expanded', true); // 更新expanded
this.$emit('on-expanded', this.isExpanded); // 执行on-expanded
if (this.$refs.externalCustomContent) {
this.$emit('on-set-external', { width: this.$refs.externalCustomContent.offsetWidth });
}
}
}
};
Expand Down Expand Up @@ -162,6 +172,10 @@
.external-perm-text {
padding-left: 5px;
}
.external-custom-count {
margin-left: 5px;
}
}
.content {
position: relative;
Expand Down
13 changes: 9 additions & 4 deletions frontend/src/views/group/common/render-template-item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@
externalDelete: {
type: Boolean,
default: false
},
externalHeaderWidth: {
type: Number,
default: 0
}
},
data () {
Expand Down Expand Up @@ -167,11 +171,12 @@
methods: {
fetchDynamicStyle () {
if (this.externalSystemsLayout.userGroup.groupDetail.hideGroupPermExpandTitle) {
const len = String(this.count).length;
const langLen = !['zh-cn'].includes(this.language) ? 80 : this.initDistance;
const distance = len > 2 ? (len - 1) * this.initDistance : langLen;
// const len = String(this.count).length;
// const isCN = ['zh-cn'].includes(this.language);
// const langLen = isCN ? this.initDistance : 80;
// const distance = len > 2 ? (len - 1) * this.initDistance : langLen;
const root = document.querySelector(':root');
root.style.setProperty('--translate-icon', `translate(${distance}px, -40px)`);
root.style.setProperty('--translate-icon', `translate(${this.externalHeaderWidth}px, -40px)`);
}
},
handleExpanded () {
Expand Down
Loading

0 comments on commit 7e544ed

Please sign in to comment.