Skip to content

Commit

Permalink
fix: 前端bug修复
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri0528 authored and EmilyMei committed Jul 14, 2023
1 parent 7089f79 commit 5437632
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 23 deletions.
12 changes: 0 additions & 12 deletions src/pages/src/components/organization/mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,5 @@ export default {
console.warn(e);
}
},
// 删除
deleteDepartment(node) {
this.stopBubbling(node);
if (!node.activated) {
this.$emit('deleteDepartment', node);
}
if (node.has_children || node.default || (node.activated && node.configured)) {
node.showDeleteTips = false;
return;
}
this.$emit('deleteDepartment', node);
},
},
};
6 changes: 4 additions & 2 deletions src/pages/src/language/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,12 +500,14 @@ export default {
清空筛选条件: 'Clear filter',
默认目录不能被停用: 'The default directory cannot be disabled',
'请先停用,方可删除目录': 'Disable the directory before deleting it',
'确认要删除当前目录?': 'Delete the current directory?',
'delete-directory': 'Delete the {name} directory?',
'删除后,该目录下的数据将为你保存': 'After deletion, the data under the directory will be saved for you',
'天。': 'days.',
你可以在: 'You can visit',
'回收站中查看已删除的目录数据,并进行还原、彻底删除的操作。': 'View the deleted directory data in the Recycle bin and restore or delete it completely.',
'确认要删除当前组织?': 'Delete the current organization?',
'delete-organization': 'Delete the {name} organization?',
'确认要删除当前用户?': 'Delete the current users?',
'delete-user': 'Delete the {name} user?',
'删除后,跨组织的用户数据将不会受到影响;': 'After the deletion, user data across the organization will not be affected.',
该用户将为你保存: 'The user will save it for you',
'天,你可以在': 'days, You can be in',
Expand Down
6 changes: 4 additions & 2 deletions src/pages/src/language/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,14 @@ export default {
清空筛选条件: '清空筛选条件',
默认目录不能被停用: '默认目录不能被停用',
'请先停用,方可删除目录': '请先停用,方可删除目录',
'确认要删除当前目录?': '确认要删除当前目录?',
'delete-directory': '确认要删除{name}目录?',
'删除后,该目录下的数据将为你保存': '删除后,该目录下的数据将为你保存',
'天。': '天。',
你可以在: '你可以在',
'回收站中查看已删除的目录数据,并进行还原、彻底删除的操作。': '回收站中查看已删除的目录数据,并进行还原、彻底删除的操作。',
'确认要删除当前组织?': '确认要删除当前组织?',
'确认要删除当前用户?': '确认要删除当前用户?',
'delete-user': '确认要删除{username}用户?',
'delete-organization': '确认要删除{name}组织?',
'删除后,跨组织的用户数据将不会受到影响;': '删除后,跨组织的用户数据将不会受到影响;',
该用户将为你保存: '该用户将为你保存',
'天,你可以在': '天,你可以在',
Expand Down
19 changes: 14 additions & 5 deletions src/pages/src/views/organization/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1257,9 +1257,9 @@ export default {
});
},
// 删除某一条用户信息,更新用户信息列表
deleteProfile(id) {
deleteProfile({ id, username }) {
this.$bkInfo({
title: this.$t('确认要删除当前用户?'),
title: this.$t('delete-user', { name: username }),
extCls: 'king-info long-title',
confirmFn: () => {
if (this.clickSecond) {
Expand Down Expand Up @@ -1502,13 +1502,22 @@ export default {
}
},
// 删除组织节点
deleteDepartment(deleteItem) {
deleteDepartment(deleteItem, event) {
if (event) {
event.stopPropagation();
deleteItem.showOption = false;
if (deleteItem.activated) return;
if (deleteItem.has_children || deleteItem.default || (deleteItem.activated && deleteItem.configured)) {
deleteItem.showDeleteTips = false;
return;
}
}
const h = this.$createElement;
let instance1 = null;
let instance2 = null;
deleteItem.display_name
? this.$bkInfo({
title: this.$t('确认要删除当前目录?'),
title: this.$t('delete-directory', { name: deleteItem.display_name }),
subHeader: h(
'div',
{
Expand Down Expand Up @@ -1549,7 +1558,7 @@ export default {
confirmFn: this.syncConfirmDeleteDepartment.bind(this, deleteItem),
})
: this.$bkInfo({
title: this.$t('确认要删除当前组织?'),
title: this.$t('delete-organization', { name: deleteItem.name }),
extCls: 'king-info long-title',
confirmFn: this.syncConfirmDeleteDepartment.bind(this, deleteItem),
});
Expand Down
2 changes: 1 addition & 1 deletion src/pages/src/views/organization/table/UserTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<li class="dot-menu-item" @click="changeStatus(props.row)">
{{ props.row.status === 'DISABLED' ? $t('启用') : $t('禁用') }}
</li>
<li class="dot-menu-item" @click="$emit('deleteProfile', props.row.id)">{{ $t('删除') }}</li>
<li class="dot-menu-item" @click="$emit('deleteProfile', props.row)">{{ $t('删除') }}</li>
</ul>
</bk-popover>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/src/views/organization/tree/OrganizationTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export default {
<div class="specific-menu">
<a href="javascript:;"
class={['delete', { 'delete-disable': this.deleteDisabled(node) }]}
onClick={this.deleteDepartment.bind(this, node)}
onClick={() => this.$emit('deleteDepartment', node, event)}
onMouseenter={this.checkDeleteTips.bind(this, node)}
onMouseleave={this.closeDeleteTips.bind(this, node)}>
{this.$t('删除')}
Expand Down

0 comments on commit 5437632

Please sign in to comment.