删除工作空间提示

This commit is contained in:
chenjianxing 2020-06-08 13:17:14 +08:00
parent ad2f41f07a
commit bd320ff002
6 changed files with 41 additions and 55 deletions

View File

@ -181,21 +181,6 @@
this.list();
});
},
del(row) {
this.getRelatedResource(row.id).then(tip => {
this.$confirm(tip + this.$t('project.delete_confirm'), this.$t('commons.prompt'), {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.$get('/project/delete/' + row.id, () => {
Message.success(this.$t('commons.delete_success'));
this.list();
});
}).catch(() => {
});
});
},
search() {
this.list();
},

View File

@ -16,7 +16,7 @@
</el-table-column>
<el-table-column>
<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>
</el-table-column>
</el-table>
@ -144,6 +144,8 @@
</template>
</el-dialog>
<ms-delete-confirm :title="$t('workspace.delete')" @delete="_handleDelete" ref="deleteConfirm"/>
</div>
</template>
@ -158,10 +160,12 @@
import MsTableOperatorButton from "../../common/components/MsTableOperatorButton";
import MsDialogFooter from "../../common/components/MsDialogFooter";
import {getCurrentUser, getCurrentWorkspaceId, refreshSessionAndCookies} from "../../../../common/js/utils";
import MsDeleteConfirm from "../../common/components/MsDeleteConfirm";
export default {
name: "MsOrganizationWorkspace",
components: {
MsDeleteConfirm,
MsCreateBox,
MsTablePagination,
MsTableHeader,
@ -204,24 +208,19 @@
this.dialogWsAddVisible = true;
this.form = Object.assign({}, row);
},
del(row) {
this.$confirm(this.$t('workspace.delete_confirm'), '', {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.$get('/workspace/delete/' + row.id, () => {
let lastWorkspaceId = getCurrentWorkspaceId();
let sourceId = row.id;
if (lastWorkspaceId === sourceId) {
let sign = DEFAULT;
refreshSessionAndCookies(sign, sourceId);
}
this.$success(this.$t('commons.delete_success'));
this.list();
});
}).catch(() => {
handleDelete(workspace) {
this.$refs.deleteConfirm.open(workspace);
},
_handleDelete(workspace) {
this.$get('/workspace/delete/' + workspace.id, () => {
let lastWorkspaceId = getCurrentWorkspaceId();
let sourceId = workspace.id;
if (lastWorkspaceId === sourceId) {
let sign = DEFAULT;
refreshSessionAndCookies(sign, sourceId);
}
this.$success(this.$t('commons.delete_success'));
this.list();
});
},
list() {

View File

@ -19,7 +19,7 @@
</el-table-column>
<el-table-column>
<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>
</el-table-column>
</el-table>
@ -184,6 +184,8 @@
</el-dialog>
<ms-delete-confirm :title="$t('workspace.delete')" @delete="_handleDelete" ref="deleteConfirm"/>
</div>
</template>
@ -198,10 +200,12 @@
import MsDialogFooter from "../../common/components/MsDialogFooter";
import {getCurrentUser, getCurrentWorkspaceId, refreshSessionAndCookies} from "../../../../common/js/utils";
import {DEFAULT, WORKSPACE} from "../../../../common/js/constants";
import MsDeleteConfirm from "../../common/components/MsDeleteConfirm";
export default {
name: "MsSystemWorkspace",
components: {
MsDeleteConfirm,
MsCreateBox,
MsTablePagination,
MsTableHeader,
@ -311,26 +315,6 @@
}
})
},
del(row) {
this.$confirm(this.$t('workspace.delete_confirm'), this.$t('commons.prompt'), {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.$get('/workspace/special/delete/' + row.id, () => {
let lastWorkspaceId = getCurrentWorkspaceId();
let sourceId = row.id;
if (lastWorkspaceId === sourceId) {
let sign = DEFAULT;
refreshSessionAndCookies(sign, sourceId);
}
Message.success(this.$t('commons.delete_success'));
this.list();
});
}).catch(() => {
});
},
handleClose() {
this.memberForm = {};
},
@ -384,6 +368,21 @@
//
this.$set(this.memberForm, 'roleIds', roleIds);
},
handleDelete(workspace) {
this.$refs.deleteConfirm.open(workspace);
},
_handleDelete(workspace) {
this.$get('/workspace/special/delete/' + workspace.id, () => {
let lastWorkspaceId = getCurrentWorkspaceId();
let sourceId = workspace.id;
if (lastWorkspaceId === sourceId) {
let sign = DEFAULT;
refreshSessionAndCookies(sign, sourceId);
}
Message.success(this.$t('commons.delete_success'));
this.list();
});
},
delMember(row) {
this.$confirm(this.$t('member.remove_member'), '', {
confirmButtonText: this.$t('commons.confirm'),

View File

@ -102,6 +102,7 @@ export default {
workspace: {
'create': 'Create Workspace',
'update': 'Update Workspace',
'delete': 'Delete Workspace',
'delete_confirm': 'Are you sure you want to delete this workspace?',
'add': 'Add Workspace',
'input_name': 'Please enter a workspace name',

View File

@ -101,6 +101,7 @@ export default {
workspace: {
'create': '创建工作空间',
'update': '修改工作空间',
'delete': '删除工作空间',
'delete_confirm': '删除工作空间会关联删除该工作空间下的资源,确定要删除吗?',
'add': '添加工作空间',
'input_name': '请输入工作空间名称',

View File

@ -101,6 +101,7 @@ export default {
workspace: {
'create': '創建工作空間',
'update': '修改工作空間',
'delete': '刪除工作空間',
'delete_confirm': '刪除工作空間會關聯刪除該工作空間下的資源,確定要刪除嗎?',
'add': '添加工作空間',
'input_name': '請輸入工作空間名稱',