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: '',
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()
},
}