删除组织提示

This commit is contained in:
chenjianxing 2020-06-08 13:22:46 +08:00
parent bd320ff002
commit f247cab1f1
4 changed files with 21 additions and 19 deletions

View File

@ -18,7 +18,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('commons.operating')"> <el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope"> <template v-slot:default="scope">
<ms-table-operator @editClick="edit(scope.row)" @deleteClick="del(scope.row)"/> <ms-table-operator @editClick="edit(scope.row)" @deleteClick="handleDelete(scope.row)"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -164,6 +164,8 @@
</template> </template>
</el-dialog> </el-dialog>
<ms-delete-confirm :title="$t('organization.delete')" @delete="_handleDelete" ref="deleteConfirm"/>
</div> </div>
</template> </template>
@ -177,10 +179,12 @@
import MsDialogFooter from "../../common/components/MsDialogFooter"; import MsDialogFooter from "../../common/components/MsDialogFooter";
import {getCurrentOrganizationId, getCurrentUser, refreshSessionAndCookies} from "../../../../common/js/utils"; import {getCurrentOrganizationId, getCurrentUser, refreshSessionAndCookies} from "../../../../common/js/utils";
import {DEFAULT, ORGANIZATION} from "../../../../common/js/constants"; import {DEFAULT, ORGANIZATION} from "../../../../common/js/constants";
import MsDeleteConfirm from "../../common/components/MsDeleteConfirm";
export default { export default {
name: "MsOrganization", name: "MsOrganization",
components: { components: {
MsDeleteConfirm,
MsCreateBox, MsCreateBox,
MsTablePagination, MsTablePagination,
MsTableHeader, MsTableHeader,
@ -312,24 +316,19 @@
this.dialogTotal = data.itemCount; this.dialogTotal = data.itemCount;
}); });
}, },
del(row) { handleDelete(organization) {
this.$confirm(this.$t('organization.delete_confirm'), '', { this.$refs.deleteConfirm.open(organization);
confirmButtonText: this.$t('commons.confirm'), },
cancelButtonText: this.$t('commons.cancel'), _handleDelete(organization) {
type: 'warning' this.result = this.$get(this.deletePath + organization.id, () => {
}).then(() => { let lastOrganizationId = getCurrentOrganizationId();
this.result = this.$get(this.deletePath + row.id, () => { let sourceId = organization.id;
let lastOrganizationId = getCurrentOrganizationId(); if (lastOrganizationId === sourceId) {
let sourceId = row.id; let sign = DEFAULT;
if (lastOrganizationId === sourceId) { refreshSessionAndCookies(sign, sourceId);
let sign = DEFAULT; }
refreshSessionAndCookies(sign, sourceId); this.$success(this.$t('commons.delete_success'));
} this.initTableData();
this.$success(this.$t('commons.delete_success'));
this.initTableData();
});
}).catch(() => {
this.$info(this.$t('commons.delete_cancel'));
}); });
}, },
delMember(row) { delMember(row) {

View File

@ -117,6 +117,7 @@ export default {
organization: { organization: {
'create': 'Create Organization', 'create': 'Create Organization',
'modify': 'Modify', 'modify': 'Modify',
'delete': 'Delete Organization',
'delete_confirm': 'Are you sure you want to delete this workspace?', 'delete_confirm': 'Are you sure you want to delete this workspace?',
'input_name': 'Please enter a organization name', 'input_name': 'Please enter a organization name',
'select_organization': 'Please select organization', 'select_organization': 'Please select organization',

View File

@ -116,6 +116,7 @@ export default {
organization: { organization: {
'create': '创建组织', 'create': '创建组织',
'modify': '修改组织', 'modify': '修改组织',
'delete': '删除组织',
'delete_confirm': '删除组织会关联删除该组织下的资源,确定要删除吗?', 'delete_confirm': '删除组织会关联删除该组织下的资源,确定要删除吗?',
'input_name': '请输入组织名称', 'input_name': '请输入组织名称',
'select_organization': '请选择组织', 'select_organization': '请选择组织',

View File

@ -116,6 +116,7 @@ export default {
organization: { organization: {
'create': '創建組織', 'create': '創建組織',
'modify': '修改組織', 'modify': '修改組織',
'delete': '刪除組織',
'delete_confirm': '刪除組織會關聯刪除該組織下的資源,確定要刪除嗎?', 'delete_confirm': '刪除組織會關聯刪除該組織下的資源,確定要刪除嗎?',
'input_name': '請輸入組織名稱', 'input_name': '請輸入組織名稱',
'select_organization': '請選擇組織', 'select_organization': '請選擇組織',