workspace del confirm

This commit is contained in:
Captain.B 2020-02-13 11:21:12 +08:00
parent aaf36843f2
commit fe9d6a44c6
1 changed files with 14 additions and 11 deletions

View File

@ -13,15 +13,10 @@
<el-table :data="items" style="width: 100%"> <el-table :data="items" style="width: 100%">
<el-table-column prop="name" label="名称"/> <el-table-column prop="name" label="名称"/>
<el-table-column prop="description" label="描述"/> <el-table-column prop="description" label="描述"/>
<el-table-column width="100"> <el-table-column>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="edit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle <el-button @click="edit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
class="edit"/> <el-button @click="del(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
<el-popconfirm title="这个工作空间确定要删除吗?" @onConfirm="del(scope.row)">
<el-button slot="reference" type="primary" icon="el-icon-delete" size="mini"
circle
class="edit"/>
</el-popconfirm>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -88,9 +83,17 @@
// }); // });
}, },
del(row) { del(row) {
this.$get('/workspace/delete/' + row.id, () => { this.$confirm('这个工作空间确定要删除吗?', '提示', {
Message.success('删除成功'); confirmButtonText: '确定',
this.list(); cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$get('/workspace/delete/' + row.id, () => {
Message.success('删除成功');
this.list();
});
}).catch(() => {
}); });
window.console.log(row); window.console.log(row);
}, },