-
{{ isCurrentDate(key) ? '最近' : key }}
+
-
-
-
-
- {{ arrItem.searchContent }}
-
- {{ arrItem.searchContent }}
-
-
-
+
+ {{ isCurrentDate(key) ? '最近' : key }}
+
+
+
+
+ {{ arrItem.searchContent }}
+
+ {{ arrItem.searchContent }}
+
+
+
+
@@ -68,7 +70,7 @@ export default {
open () {
this.page = {
pageNo: 1,
- pageSize: 20,
+ pageSize: 100,
total: 0,
pages: 0
}
@@ -89,7 +91,7 @@ export default {
},
// 内容展示区域滚动事件
contentWrapperScroll () {
- const contentWrapper = this.$refs.contentWrapper[0]
+ const contentWrapper = this.$refs.contentWrapper
// 滚动条触底,并且还不是最后一页时获取下一页
if (contentWrapper.scrollTop + contentWrapper.clientHeight === contentWrapper.scrollHeight && this.page.pageNo < this.page.pages) {
this.page.pageNo++
@@ -97,7 +99,10 @@ export default {
}
},
// 获取列表数据
- initData () {
+ initData (arg) {
+ if (arg === 1) {
+ this.page.pageNo = 1
+ }
const param = {}
param.pageNo = this.page.pageNo
param.pageSize = this.page.pageSize
@@ -124,18 +129,6 @@ export default {
this.confirmLoading = false
})
},
- // 重新计算分页
- reCalculatePage (count) {
- // 总数量-count
- const total = this.page.total - count
- // 获取删除后的分页数
- const currentIndex = Math.ceil(total / this.page.pageSize)
- // 删除后的分页数<所在当前页
- if (currentIndex < this.page.pageNo) {
- this.page.current = currentIndex
- }
- console.log('currentIndex', currentIndex)
- },
// 多选变化
onCheckChange (checkedValue) {
this.checkedArr = checkedValue
@@ -146,10 +139,12 @@ export default {
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.initData()
+ // 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)
} else {
this.$message.warning(res.message)
}
@@ -157,12 +152,13 @@ export default {
},
// 批量删除
handleBatchDel () {
- batchDeleteSearchHistory({ ids: this.checkedArr.join(',') }).then(res => {
+ batchDeleteSearchHistory({ id: this.checkedArr.join(',') }).then(res => {
if (res.success) {
- this.reCalculatePage(this.checkedArr.length)
this.$message.success(res.message)
this.checkedArr = []
- this.initData()
+ this.model = {}
+ this.dataList = []
+ this.initData(1)
} else {
this.$message.warning(res.message)
}
@@ -186,6 +182,7 @@ export default {
overflow-y: auto;
}
.time-p {
+ margin: 10px 0;
color: @primary-color;
}
/deep/ .ant-checkbox-group {