diff --git a/src/mods/work/AppProgressNew/AppProgressNew.vue b/src/mods/work/AppProgressNew/AppProgressNew.vue index 96e5924..f7186db 100644 --- a/src/mods/work/AppProgressNew/AppProgressNew.vue +++ b/src/mods/work/AppProgressNew/AppProgressNew.vue @@ -24,9 +24,9 @@ export default { id: '', title: '', subTitle: '', - current: 0, + current: 1, list: [], - // loadingStatus: 'loadmore', + pages: 2 } }, @@ -40,35 +40,20 @@ export default { methods: { getList() { - // this.loadingStatus = 'loading' - this.$instance - .post(`/app/approval-process-def/list-xcx?processType=2`, null, { - params: { - size: 10000, - }, - withoutToken: true, - }) - .then((res) => { - if (res.code === 0) { - // if (!res.data.records.length) { - // this.loadingStatus = 'nomore' - // return false - // } - - const data = res.data.records.map((item) => { - return item - }) - if (this.current === 0) this.list = [] - - this.list.push(...data) - this.current = this.current + 1 - // this.loadingStatus = 'loadmore' - - // if (this.list.length < 10) { - // this.loadingStatus = 'nomore' - // } - } - }) + if(this.current > this.pages) return + this.$instance.post(`/app/approval-process-def/list-xcx?processType=2`, null, { + params: { + size: 10, + current: this.current + }, + withoutToken: true, + }).then((res) => { + if (res.code === 0) { + const list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records + this.pages = res.data.pages + this.list = list + } + }) }, toDetail(url) { @@ -77,6 +62,7 @@ export default { }, onReachBottom() { + this.current++ this.getList() }, }