diff --git a/src/pages/src/components/organization/mixin.js b/src/pages/src/components/organization/mixin.js index ee5dd6008..4a31f9605 100644 --- a/src/pages/src/components/organization/mixin.js +++ b/src/pages/src/components/organization/mixin.js @@ -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); - }, }, }; diff --git a/src/pages/src/language/lang/en.js b/src/pages/src/language/lang/en.js index 7959d1ecb..fcc6c129d 100644 --- a/src/pages/src/language/lang/en.js +++ b/src/pages/src/language/lang/en.js @@ -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', diff --git a/src/pages/src/language/lang/zh.js b/src/pages/src/language/lang/zh.js index fe84f2f06..c535fe0fc 100644 --- a/src/pages/src/language/lang/zh.js +++ b/src/pages/src/language/lang/zh.js @@ -502,12 +502,14 @@ export default { 清空筛选条件: '清空筛选条件', 默认目录不能被停用: '默认目录不能被停用', '请先停用,方可删除目录': '请先停用,方可删除目录', - '确认要删除当前目录?': '确认要删除当前目录?', + 'delete-directory': '确认要删除{name}目录?', '删除后,该目录下的数据将为你保存': '删除后,该目录下的数据将为你保存', '天。': '天。', 你可以在: '你可以在', '回收站中查看已删除的目录数据,并进行还原、彻底删除的操作。': '回收站中查看已删除的目录数据,并进行还原、彻底删除的操作。', - '确认要删除当前组织?': '确认要删除当前组织?', + '确认要删除当前用户?': '确认要删除当前用户?', + 'delete-user': '确认要删除{username}用户?', + 'delete-organization': '确认要删除{name}组织?', '删除后,跨组织的用户数据将不会受到影响;': '删除后,跨组织的用户数据将不会受到影响;', 该用户将为你保存: '该用户将为你保存', '天,你可以在': '天,你可以在', diff --git a/src/pages/src/views/organization/index.vue b/src/pages/src/views/organization/index.vue index 6224741fb..11bd2999f 100644 --- a/src/pages/src/views/organization/index.vue +++ b/src/pages/src/views/organization/index.vue @@ -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) { @@ -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', { @@ -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), }); diff --git a/src/pages/src/views/organization/table/UserTable.vue b/src/pages/src/views/organization/table/UserTable.vue index 0c49341eb..37c92dba0 100644 --- a/src/pages/src/views/organization/table/UserTable.vue +++ b/src/pages/src/views/organization/table/UserTable.vue @@ -52,7 +52,7 @@