|
|
@ -1040,14 +1040,14 @@ export default { |
|
|
|
await this.api.delete(id) |
|
|
|
await this.api.delete(id) |
|
|
|
} |
|
|
|
} |
|
|
|
this.data.splice(this.rowContextMenu.index, 1) |
|
|
|
this.data.splice(this.rowContextMenu.index, 1) |
|
|
|
this.$toast.success('Deleted row successfully').goAway(3000) |
|
|
|
// this.$toast.success('Deleted row successfully').goAway(3000) |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
this.$toast.error(`Failed to delete row : ${e.message}`).goAway(3000) |
|
|
|
this.$toast.error(`Failed to delete row : ${e.message}`).goAway(3000) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
async deleteSelectedRows() { |
|
|
|
async deleteSelectedRows() { |
|
|
|
let row = this.rowLength |
|
|
|
let row = this.rowLength |
|
|
|
let success = 0 |
|
|
|
// let success = 0 |
|
|
|
while (row--) { |
|
|
|
while (row--) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
const { row: rowObj, rowMeta } = this.data[row] |
|
|
|
const { row: rowObj, rowMeta } = this.data[row] |
|
|
@ -1064,12 +1064,12 @@ export default { |
|
|
|
await this.api.delete(id) |
|
|
|
await this.api.delete(id) |
|
|
|
} |
|
|
|
} |
|
|
|
this.data.splice(row, 1) |
|
|
|
this.data.splice(row, 1) |
|
|
|
success++ |
|
|
|
// success++ |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
return this.$toast.error(`Failed to delete row : ${e.message}`).goAway(3000) |
|
|
|
return this.$toast.error(`Failed to delete row : ${e.message}`).goAway(3000) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (success) { this.$toast.success(`Deleted ${success} selected row${success > 1 ? 's' : ''} successfully`).goAway(3000) } |
|
|
|
// if (success) { this.$toast.success(`Deleted ${success} selected row${success > 1 ? 's' : ''} successfully`).goAway(3000) } |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async clearCellValue() { |
|
|
|
async clearCellValue() { |
|
|
|