diff --git a/frontend/src/views/organization/member/index.vue b/frontend/src/views/organization/member/index.vue index 26beebfade..0f882c1a8d 100644 --- a/frontend/src/views/organization/member/index.vue +++ b/frontend/src/views/organization/member/index.vue @@ -51,10 +51,12 @@ import { useI18n } from '@/hooks/useI18n'; import MsBaseTable from '@/components/pure/ms-table/base-table.vue'; import MsButton from '@/components/pure/ms-button/index.vue'; + import { Message } from '@arco-design/web-vue'; import useTable from '@/components/pure/ms-table/useTable'; import addMemberModal from './components/addMemberModal.vue'; import { getMemberList } from '@/api/modules/system/member'; import type { MsTableColumn } from '@/components/pure/ms-table/type'; + import useModal from '@/hooks/useModal'; const columns: MsTableColumn = [ { @@ -124,9 +126,29 @@ }); const { t } = useI18n(); + const { openModal } = useModal(); function deleteMember(record: any) { - console.log(record, 1); + openModal({ + type: 'warning', + title: t('organization.member.deleteMemberTip', { name: record.name }), + content: '', + okText: t('organization.member.deleteMemberConfirm'), + cancelText: t('organization.member.deleteMemberCancel'), + okButtonProps: { + status: 'danger', + }, + onBeforeOk: async () => { + try { + Message.success(t('organization.member.deleteMemberSuccess')); + return true; + } catch (error) { + console.log(error); + return false; + } + }, + hideCancel: false, + }); } const tableSelected = ref<(string | number)[]>([]); function handleTableSelect(selectArr: (string | number)[]) { diff --git a/frontend/src/views/organization/member/locale/en-US.ts b/frontend/src/views/organization/member/locale/en-US.ts index d0bc0de9d1..e38ec26dc3 100644 --- a/frontend/src/views/organization/member/locale/en-US.ts +++ b/frontend/src/views/organization/member/locale/en-US.ts @@ -2,7 +2,7 @@ export default { 'organization.member.addMember': 'Add Member', 'organization.member.searchMember': 'Search by name or email address', 'organization.member.remove': 'Remove', - 'organization.member.batchActionAddProject': 'dd to project', + 'organization.member.batchActionAddProject': 'Add to project', 'organization.member.batchActionAddUsergroup': 'Add to usergroup', 'organization.member.tableEnable': 'Enabled', 'organization.member.tableDisable': 'Disabled', @@ -17,4 +17,10 @@ export default { 'organization.member.selectMemberScope': 'Select the member you want to add. Multiple selection is supported', 'organization.member.pleaseSelectMember': 'Please select user', 'organization.member.Save': 'Save', + 'organization.member.deleteMemberTip': 'Are you sure to delete the user `{name}` ?', + 'system.user.deleteUserTip': 'Are you sure to delete the user `{name}` ?', + 'organization.member.deleteMemberConfirm': 'Delete', + 'organization.member.deleteMemberCancel': 'Cancel', + 'organization.member.deleteMemberSuccess': 'Delete successful', + 'organization.member.batchModalSuccess': 'Successfully added', }; diff --git a/frontend/src/views/organization/member/locale/zh-CN.ts b/frontend/src/views/organization/member/locale/zh-CN.ts index 745911d4a7..b49ae0334f 100644 --- a/frontend/src/views/organization/member/locale/zh-CN.ts +++ b/frontend/src/views/organization/member/locale/zh-CN.ts @@ -17,4 +17,9 @@ export default { 'organization.member.selectMemberScope': '请选择需要添加的成员支持多选', 'organization.member.pleaseSelectMember': '请选择成员', 'organization.member.Save': '保存', + 'organization.member.deleteMemberTip': '确认删除 `{name}` 这个成员吗?', + 'organization.member.deleteMemberConfirm': '确认删除', + 'organization.member.deleteMemberCancel': '取消', + 'organization.member.deleteMemberSuccess': '删除成功', + 'organization.member.batchModalSuccess': '添加成功', };