Commit bd847eb6 by 前端

修复关联数据分页问题

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