Commit bd847eb6 by 前端

修复关联数据分页问题

1 parent 59c2f5dc
......@@ -162,11 +162,12 @@ export default {
optionLabel: 'confValue',
optionsName: 'jdSyncOpt',
changeAttr: (value, targetItem) => {
console.log("value", value)
console.log("this.allData", this.allData)
if (['', null].includes(value)) {
this.filterData = null
this.filterFlag = false // 关闭过滤
} else {
this.filterFlag = true // 开启过滤
if (value == 0) {
this.tableData = this.allData.filter(item => !item.receipt)
this.filterData = this.allData.filter(item => !item.receipt)
......@@ -304,6 +305,7 @@ export default {
allData: [], // 从后端获取的所有数据
tableData: [], // 当前展示的数据
filterData: [], // 当前筛选的数据
filterFlag: false, // 代表是否过滤
currentRow: null,
total: 0,
page: {
......@@ -388,11 +390,14 @@ export default {
this.tableData = this.filterData.slice(start, end)
this.total = this.filterData.length
} else {
this.tableData = this.allData.slice(start, end)
this.total = this.allData.length
if (this.filterFlag) { // 过滤后的结果为空时
this.tableData = []
this.total = 0
} else {
this.total = this.allData.length
this.tableData = this.allData.slice(start, end)
}
}
console.log('start', start)
console.log('end', end)
console.log('this.tableData', this.tableData)
return this.tableData
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!