fix(瀑布式流): 修复页码持续上升的问题,如果最新的页码没有数据,计数返回上一页
This commit is contained in:
parent
600f636819
commit
caf28fba28
|
@ -270,6 +270,9 @@ export default {
|
||||||
getFiles () {
|
getFiles () {
|
||||||
const that = this
|
const that = this
|
||||||
get(`/v1/files/query?projectName=${that.projectName}&pageNumber=${that.pageNumber}&pageSize=${that.pageSize}`, function (info) {
|
get(`/v1/files/query?projectName=${that.projectName}&pageNumber=${that.pageNumber}&pageSize=${that.pageSize}`, function (info) {
|
||||||
|
if (!info || info.length === 0) {
|
||||||
|
that.pageNumber -= 1
|
||||||
|
}
|
||||||
let newFiles = info.map((item) => {
|
let newFiles = info.map((item) => {
|
||||||
if (typeof item === 'string') return item
|
if (typeof item === 'string') return item
|
||||||
that.isAnnoDic[`${that.projectName}_${item.fileName}`] = item.isAnno
|
that.isAnnoDic[`${that.projectName}_${item.fileName}`] = item.isAnno
|
||||||
|
@ -294,10 +297,7 @@ export default {
|
||||||
},
|
},
|
||||||
nextPage () {
|
nextPage () {
|
||||||
const that = this
|
const that = this
|
||||||
// if (that.files.length === that.pageSize) {
|
|
||||||
that.pageNumber = that.pageNumber + 1
|
|
||||||
that.getFiles()
|
that.getFiles()
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
goHome: function () {
|
goHome: function () {
|
||||||
this.$router.push({path: '/'})
|
this.$router.push({path: '/'})
|
||||||
|
|
Loading…
Reference in New Issue