Skip to content

Commit

Permalink
perf: 账号删除添加提示确认框
Browse files Browse the repository at this point in the history
  • Loading branch information
w940853815 authored and BaiJiangJie committed Dec 27, 2023
1 parent 7df11b9 commit 3c900ce
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
15 changes: 12 additions & 3 deletions src/components/Apps/AccountListTable/AccountList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,18 @@ export default {
can: this.$hasPerm('accounts.delete_account'),
type: 'primary',
callback: ({ row }) => {
this.$axios.delete(`/api/v1/accounts/accounts/${row.id}/`).then(() => {
this.$message.success(this.$tc('common.deleteSuccessMsg'))
this.$refs.ListTable.reloadTable()
const msg = this.$t('accounts.AccountDeleteConfirmMsg')
this.$confirm(msg, this.$tc('common.Info'), {
type: 'warning',
confirmButtonClass: 'el-button--danger',
beforeClose: async(action, instance, done) => {
if (action !== 'confirm') return done()
this.$axios.delete(`/api/v1/accounts/accounts/${row.id}/`).then(() => {
done()
this.$refs.ListTable.reloadTable()
this.$message.success(this.$tc('common.deleteSuccessMsg'))
})
}
})
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/i18n/langs/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
"AddAccountResult": "Add account result",
"AutoPush": "Auto Push",
"GeneralAccounts": "General Accounts",
"VirtualAccounts": "Virtual Accounts"
"VirtualAccounts": "Virtual Accounts",
"AccountDeleteConfirmMsg": "Delete account, do you want to continue?"
},
"acl": {
"CommandFilterACLHelpMsg": "You can control whether commands can be executed on assets. Based on the rules, certain commands can be allowed while others are prohibited.",
Expand Down Expand Up @@ -2111,7 +2112,7 @@
"passwordWillExpiredPrefixMsg": "The password will expire in ",
"passwordWillExpiredSuffixMsg": " days.Please change your password as soon as possible.",
"dateLastLogin": "Date last login",
"AddAllMembersWarningMsg": "Are you sure you want to add all members"
"AddAllMembersWarningMsg": "Are you sure you want to add all members?"
},
"notifications": {
"MessageType": "Message Type",
Expand Down
5 changes: 3 additions & 2 deletions src/i18n/langs/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
"AddAccountResult": "账号批量添加结果",
"AutoPush": "自動プッシュ",
"GeneralAccounts": "一般アカウント",
"VirtualAccounts": "仮想アカウント"
"VirtualAccounts": "仮想アカウント",
"AccountDeleteConfirmMsg": "アカウントを削除します,続行しますか?"
},
"acl": {
"CommandFilterACLHelpMsg": "コマンドフィルタリングを使用すると、コマンドがアセット上で実行されるかどうかを制御できます。ルールに基づいて、特定のコマンドは許可され、他のコマンドは禁止されることがあります。",
Expand Down Expand Up @@ -2100,7 +2101,7 @@
"passwordExpired": "パスワードが期限切れです",
"passwordWillExpiredPrefixMsg": "パスワードはまもなく",
"passwordWillExpiredSuffixMsg": "期限が切れた後、できるだけ早くパスワードを変更してください。",
"AddAllMembersWarningMsg": "すべてのメンバーを追加してもよろしいですか"
"AddAllMembersWarningMsg": "すべてのメンバーを追加してもよろしいですか"
},
"notifications": {
"MessageType": "メッセージタイプ",
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/langs/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"PleaseClickLeftAssetToViewGatheredUser": "收集用户列表,点击左侧资产进行查看",
"AutoCreate": "自动创建",
"AccountExportTips": "导出信息中包含账号密文涉及敏感信息,导出的格式为一个加密的zip文件(若没有设置加密密码,请前往个人信息中设置文件加密密码)。",
"AccountDeleteConfirmMsg": "删除账号,是否继续?",
"AccountPush": {
"WindowsPushHelpText": "windows 资产暂不支持推送密钥",
"AccountPushList": "账号推送",
Expand Down Expand Up @@ -1966,7 +1967,7 @@
"KokoSettingUpdate": "Koko 配置设置",
"UserSetting": "偏好设置",
"AllMembers": "全部成员",
"AddAllMembersWarningMsg": "你确定要添加全部成员",
"AddAllMembersWarningMsg": "你确定要添加全部成员",
"UnbindHelpText": "本地用户为此认证来源用户,无法解绑",
"SetStatus": "设置状态",
"Set": "已设置",
Expand Down
5 changes: 3 additions & 2 deletions src/views/users/Group/UserGroupDetail/GroupUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default {
},
callbacks: Object.freeze({
click: () => {
const msg = `${this.$t('users.AddAllMembersWarningMsg')} ?`
const msg = this.$t('users.AddAllMembersWarningMsg')
this.$confirm(msg, this.$tc('common.Info'), {
type: 'warning',
confirmButtonClass: 'el-button--danger',
Expand All @@ -60,7 +60,8 @@ export default {
window.location.reload()
})
}
}).catch(() => {})
}).catch(() => {
})
}
})
}
Expand Down

0 comments on commit 3c900ce

Please sign in to comment.