delete(item){
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$post(url).then((data) => {
if (data.code === 200) {
this.$message({
type: 'success',
message: '删除成功!'
});
let totalPage = Math.ceil((this.total - 1) / this.pageSize);
let current = this.currentPage > totalPage ? totalPage : this.currentPage;
this.currentPage = current < 1 ? 1 : current;
//请求
this.search();
}else{
this.$message({
type: 'success',
message: '删除失败!'
});
}
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},