[update] 修改bug79086
This commit is contained in:
@@ -151,36 +151,48 @@ export default {
|
||||
},
|
||||
// 删除
|
||||
handleDelete (id) {
|
||||
deleteSearchHistoryById({ id: id }).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
// 判断当前删除的数据是否是最后一页的最后一条数据,如果是的话页码减一
|
||||
// if (this.page.pageNo > 1 && ((this.page.pageNo - 1) * this.page.pageSize) + 1 === this.page.total) {
|
||||
// this.page.pageNo -= 1
|
||||
// }
|
||||
this.model = {}
|
||||
this.dataList = []
|
||||
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)
|
||||
this.$confirm({
|
||||
title: this.$t('confirmDeletion'),
|
||||
content: this.$t('areYouSure'),
|
||||
onOk: () => {
|
||||
deleteSearchHistoryById({ id: id }).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
// 判断当前删除的数据是否是最后一页的最后一条数据,如果是的话页码减一
|
||||
// if (this.page.pageNo > 1 && ((this.page.pageNo - 1) * this.page.pageSize) + 1 === this.page.total) {
|
||||
// this.page.pageNo -= 1
|
||||
// }
|
||||
this.model = {}
|
||||
this.dataList = []
|
||||
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 () {
|
||||
batchDeleteSearchHistory({ id: this.checkedArr.join(',') }).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.checkedArr = []
|
||||
this.model = {}
|
||||
this.dataList = []
|
||||
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)
|
||||
this.$confirm({
|
||||
title: this.$t('confirmDeletion'),
|
||||
content: this.$t('areYouSure'),
|
||||
onOk: () => {
|
||||
batchDeleteSearchHistory({ id: this.checkedArr.join(',') }).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.checkedArr = []
|
||||
this.model = {}
|
||||
this.dataList = []
|
||||
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