update 国内标准-批量删除页面效果修改,树查询数据
This commit is contained in:
@@ -372,30 +372,40 @@ export const ConfigurableTableMixin = {
|
||||
}
|
||||
if (this.selectedRowKeys.length <= 0) {
|
||||
this.$message.warning(this.$t('selectARecord'))
|
||||
} else {
|
||||
let ids = this.selectedRowKeys.join(',')
|
||||
const that = this
|
||||
this.$confirm({
|
||||
title: this.$t('confirmBatchDeletion'),
|
||||
content: this.$t('deleteAData'),
|
||||
onOk: function () {
|
||||
that.loading = true
|
||||
postAction(that.url.delete, { ids: ids }).then((res) => {
|
||||
if (res.success) {
|
||||
// 重新计算分页问题
|
||||
that.reCalculatePage(that.selectedRowKeys.length)
|
||||
that.$message.success(res.message)
|
||||
that.loadData()
|
||||
that.onClearSelected()
|
||||
} else {
|
||||
that.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
that.loading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.selectedRowKeys.join(',')
|
||||
this.$confirm({
|
||||
title: this.$t('confirmBatchDeletion'),
|
||||
content: this.$t('deleteAData'),
|
||||
onOk: () => {
|
||||
this.loading = true
|
||||
postAction(this.url.delete, { ids: ids }).then((res) => {
|
||||
if (res.success) {
|
||||
// 重新计算分页问题
|
||||
this.reCalculatePage(this.selectedRowKeys.length)
|
||||
this.$message.success(res.message)
|
||||
this.loadData()
|
||||
this.onClearSelected()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
reCalculatePage (count) {
|
||||
// 总数量-count
|
||||
const total = this.ipagination.total - count
|
||||
// 获取删除后的分页数
|
||||
const currentIndex = Math.ceil(total / this.ipagination.pageSize)
|
||||
// 删除后的分页数<所在当前页
|
||||
if (currentIndex < this.ipagination.current) {
|
||||
this.ipagination.current = currentIndex
|
||||
}
|
||||
console.log('currentIndex', currentIndex)
|
||||
},
|
||||
/**
|
||||
* 删除
|
||||
|
||||
Reference in New Issue
Block a user