import request from "***/request";
const list = {
methods: {
handleSelectionChange(row) {
this.multipleSelection = row
},
handleDelete(id) {
if (!id) {
if (this.multipleSelection.length === 0) {
this.$message.info('未选中数据!');
return
}
}
this.$confirm("确定删除?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.delete(id)
})
},
delete(id) {
if (!id) {
id = this.multipleSelection.map((value) => { return value.id}).join(',');
}
request.request({
url: this.delUrl,
method: "delete",
data: {
ids: id
}
}).then((response) => {
this.$message({
showClose: true,
message: response.message,
type: response.success ? 'success' : 'error'
});
if (response.success) {
this.fetchList()
}
})
}
},
data() {
return {
delUrl:'',
dialogVisible: false,
tableData: [],
currentId: '',
searchMap: {},
multipleSelection:[],
data: {},
page: {
page: 1,
size: 10,
total: 0,
},
pageInfo: {
page: 0,
size: 10,
total: 0,
}
}
},
}
export default list