[update] 修改bug79086
This commit is contained in:
@@ -151,36 +151,48 @@ export default {
|
|||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
handleDelete (id) {
|
handleDelete (id) {
|
||||||
deleteSearchHistoryById({ id: id }).then(res => {
|
this.$confirm({
|
||||||
if (res.success) {
|
title: this.$t('confirmDeletion'),
|
||||||
this.$message.success(res.message)
|
content: this.$t('areYouSure'),
|
||||||
// 判断当前删除的数据是否是最后一页的最后一条数据,如果是的话页码减一
|
onOk: () => {
|
||||||
// if (this.page.pageNo > 1 && ((this.page.pageNo - 1) * this.page.pageSize) + 1 === this.page.total) {
|
deleteSearchHistoryById({ id: id }).then(res => {
|
||||||
// this.page.pageNo -= 1
|
if (res.success) {
|
||||||
// }
|
this.$message.success(res.message)
|
||||||
this.model = {}
|
// 判断当前删除的数据是否是最后一页的最后一条数据,如果是的话页码减一
|
||||||
this.dataList = []
|
// if (this.page.pageNo > 1 && ((this.page.pageNo - 1) * this.page.pageSize) + 1 === this.page.total) {
|
||||||
this.initData(1)
|
// this.page.pageNo -= 1
|
||||||
this.indeterminate = !!this.checkedArr.length && this.checkedArr.length < this.dataList.length
|
// }
|
||||||
this.checkAll = this.checkedArr.length === this.dataList.length
|
this.model = {}
|
||||||
} else {
|
this.dataList = []
|
||||||
this.$message.warning(res.message)
|
this.initData(1)
|
||||||
|
this.indeterminate = !!this.checkedArr.length && this.checkedArr.length < this.dataList.length
|
||||||
|
this.checkAll = this.checkedArr.length === this.dataList.length
|
||||||
|
} else {
|
||||||
|
this.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 批量删除
|
// 批量删除
|
||||||
handleBatchDel () {
|
handleBatchDel () {
|
||||||
batchDeleteSearchHistory({ id: this.checkedArr.join(',') }).then(res => {
|
this.$confirm({
|
||||||
if (res.success) {
|
title: this.$t('confirmDeletion'),
|
||||||
this.$message.success(res.message)
|
content: this.$t('areYouSure'),
|
||||||
this.checkedArr = []
|
onOk: () => {
|
||||||
this.model = {}
|
batchDeleteSearchHistory({ id: this.checkedArr.join(',') }).then(res => {
|
||||||
this.dataList = []
|
if (res.success) {
|
||||||
this.initData(1)
|
this.$message.success(res.message)
|
||||||
this.indeterminate = !!this.checkedArr.length && this.checkedArr.length < this.dataList.length
|
this.checkedArr = []
|
||||||
this.checkAll = this.checkedArr.length > 0 && this.checkedArr.length === this.dataList.length
|
this.model = {}
|
||||||
} else {
|
this.dataList = []
|
||||||
this.$message.warning(res.message)
|
this.initData(1)
|
||||||
|
this.indeterminate = !!this.checkedArr.length && this.checkedArr.length < this.dataList.length
|
||||||
|
this.checkAll = this.checkedArr.length > 0 && this.checkedArr.length === this.dataList.length
|
||||||
|
} else {
|
||||||
|
this.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user