This commit is contained in:
liuye
2022-06-30 15:13:23 +08:00
parent 8d3d16a5f4
commit 7fa917b279

View File

@@ -24,9 +24,9 @@ export default {
id: '', id: '',
title: '', title: '',
subTitle: '', subTitle: '',
current: 0, current: 1,
list: [], list: [],
// loadingStatus: 'loadmore', pages: 2
} }
}, },
@@ -40,33 +40,18 @@ export default {
methods: { methods: {
getList() { getList() {
// this.loadingStatus = 'loading' if(this.current > this.pages) return
this.$instance this.$instance.post(`/app/approval-process-def/list-xcx?processType=2`, null, {
.post(`/app/approval-process-def/list-xcx?processType=2`, null, {
params: { params: {
size: 10000, size: 10,
current: this.current
}, },
withoutToken: true, withoutToken: true,
}) }).then((res) => {
.then((res) => {
if (res.code === 0) { if (res.code === 0) {
// if (!res.data.records.length) { const list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
// this.loadingStatus = 'nomore' this.pages = res.data.pages
// return false this.list = list
// }
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'
// }
} }
}) })
}, },
@@ -77,6 +62,7 @@ export default {
}, },
onReachBottom() { onReachBottom() {
this.current++
this.getList() this.getList()
}, },
} }