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,35 +40,20 @@ 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: 10,
size: 10000, current: this.current
}, },
withoutToken: true, withoutToken: true,
}) }).then((res) => {
.then((res) => { if (res.code === 0) {
if (res.code === 0) { const list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
// if (!res.data.records.length) { this.pages = res.data.pages
// this.loadingStatus = 'nomore' this.list = list
// 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'
// }
}
})
}, },
toDetail(url) { toDetail(url) {
@@ -77,6 +62,7 @@ export default {
}, },
onReachBottom() { onReachBottom() {
this.current++
this.getList() this.getList()
}, },
} }