@@ -123,6 +123,8 @@ export default { | |||||
{ | { | ||||
this.setupFinished(true); | this.setupFinished(true); | ||||
} | } | ||||
}).catch((err) => { | |||||
this.setupError(err); | |||||
}).finally(() => { | }).finally(() => { | ||||
this.setupLoading(false); | this.setupLoading(false); | ||||
this.setupRefreshing(false); | this.setupRefreshing(false); | ||||
@@ -157,6 +159,13 @@ export default { | |||||
if(ok) | if(ok) | ||||
this.$emit('finished', this.stateTotal); | this.$emit('finished', this.stateTotal); | ||||
}, | }, | ||||
setupError(err) { | |||||
this.log(`error -> ${ok}`); | |||||
this.stateFinished = true; | |||||
if(this.stateFinished != this.finished) | |||||
this.$emit('update:finished', this.stateFinished); | |||||
this.$emit('error', err); | |||||
}, | |||||
setupRefreshing(ok) { | setupRefreshing(ok) { | ||||
this.log(`refreshing -> ${ok}`); | this.log(`refreshing -> ${ok}`); | ||||
this.stateRefreshing = ok; | this.stateRefreshing = ok; | ||||
@@ -131,6 +131,8 @@ export default { | |||||
}); | }); | ||||
this.total += response.rows.length; | this.total += response.rows.length; | ||||
this.finished = this.total >= response.total; | this.finished = this.total >= response.total; | ||||
}).catch(() => { | |||||
this.finished = true; | |||||
}).finally(() => { | }).finally(() => { | ||||
this.loading = false; | this.loading = false; | ||||
this.refreshing = false; | this.refreshing = false; | ||||
@@ -137,6 +137,8 @@ export default { | |||||
}); | }); | ||||
this.total += response.rows.length; | this.total += response.rows.length; | ||||
this.finished = this.total >= response.total; | this.finished = this.total >= response.total; | ||||
}).catch(() => { | |||||
this.finished = true; | |||||
}).finally(() => { | }).finally(() => { | ||||
this.loading = false; | this.loading = false; | ||||
this.refreshing = false; | this.refreshing = false; | ||||
@@ -131,6 +131,8 @@ export default { | |||||
}); | }); | ||||
this.total += response.rows.length; | this.total += response.rows.length; | ||||
this.finished = this.total >= response.total; | this.finished = this.total >= response.total; | ||||
}).catch(() => { | |||||
this.finished = true; | |||||
}).finally(() => { | }).finally(() => { | ||||
this.loading = false; | this.loading = false; | ||||
this.refreshing = false; | this.refreshing = false; | ||||
@@ -142,6 +142,8 @@ export default { | |||||
}); | }); | ||||
this.total += response.rows.length; | this.total += response.rows.length; | ||||
this.finished = this.total >= response.total; | this.finished = this.total >= response.total; | ||||
}).catch(() => { | |||||
this.finished = true; | |||||
}).finally(() => { | }).finally(() => { | ||||
this.loading = false; | this.loading = false; | ||||
this.refreshing = false; | this.refreshing = false; | ||||
@@ -146,6 +146,8 @@ export default { | |||||
} | } | ||||
this.total += response.rows.length; | this.total += response.rows.length; | ||||
this.finished = this.total >= response.total; | this.finished = this.total >= response.total; | ||||
}).catch(() => { | |||||
this.finished = true; | |||||
}).finally(() => { | }).finally(() => { | ||||
this.loading = false; | this.loading = false; | ||||
this.refreshing = false; | this.refreshing = false; | ||||
@@ -133,6 +133,8 @@ export default { | |||||
}); | }); | ||||
this.total += response.rows.length; | this.total += response.rows.length; | ||||
this.finished = this.total >= response.total; | this.finished = this.total >= response.total; | ||||
}).catch(() => { | |||||
this.finished = true; | |||||
}).finally(() => { | }).finally(() => { | ||||
this.loading = false; | this.loading = false; | ||||
this.refreshing = false; | this.refreshing = false; | ||||
@@ -90,6 +90,8 @@ import { getList } from "@/api/onlineHome/homestead/information"; | |||||
}); | }); | ||||
this.total += response.rows.length; | this.total += response.rows.length; | ||||
this.finished = this.total >= response.total; | this.finished = this.total >= response.total; | ||||
}).catch(() => { | |||||
this.finished = true; | |||||
}).finally(() => { | }).finally(() => { | ||||
this.loading = false; | this.loading = false; | ||||
this.refreshing = false; | this.refreshing = false; | ||||
@@ -180,6 +180,8 @@ export default { | |||||
}); | }); | ||||
this.total += response.rows.length; | this.total += response.rows.length; | ||||
this.finished = this.total >= response.total; | this.finished = this.total >= response.total; | ||||
}).catch(() => { | |||||
this.finished = true; | |||||
}).finally(() => { | }).finally(() => { | ||||
this.loading = false; | this.loading = false; | ||||
this.refreshing = false; | this.refreshing = false; | ||||
@@ -113,6 +113,8 @@ export default { | |||||
this.list.push(...response.rows); | this.list.push(...response.rows); | ||||
this.total += response.rows.length; | this.total += response.rows.length; | ||||
this.finished = this.total >= response.total; | this.finished = this.total >= response.total; | ||||
}).catch(() => { | |||||
this.finished = true; | |||||
}).finally(() => { | }).finally(() => { | ||||
this.loading = false; | this.loading = false; | ||||
this.refreshing = false; | this.refreshing = false; | ||||
@@ -129,6 +129,8 @@ export default { | |||||
this.list.push(...response.rows); | this.list.push(...response.rows); | ||||
this.total += response.rows.length; | this.total += response.rows.length; | ||||
this.finished = this.total >= response.total; | this.finished = this.total >= response.total; | ||||
}).catch(() => { | |||||
this.finished = true; | |||||
}).finally(() => { | }).finally(() => { | ||||
this.loading = false; | this.loading = false; | ||||
this.refreshing = false; | this.refreshing = false; | ||||
@@ -160,6 +160,8 @@ export default { | |||||
} | } | ||||
this.total += response.rows.length; | this.total += response.rows.length; | ||||
this.finished = this.total >= response.total; | this.finished = this.total >= response.total; | ||||
}).catch(() => { | |||||
this.finished = true; | |||||
}).finally(() => { | }).finally(() => { | ||||
this.loading = false; | this.loading = false; | ||||
this.refreshing = false; | this.refreshing = false; | ||||
@@ -160,6 +160,8 @@ export default { | |||||
} | } | ||||
this.total += response.rows.length; | this.total += response.rows.length; | ||||
this.finished = this.total >= response.total; | this.finished = this.total >= response.total; | ||||
}).catch(() => { | |||||
this.finished = true; | |||||
}).finally(() => { | }).finally(() => { | ||||
this.loading = false; | this.loading = false; | ||||
this.refreshing = false; | this.refreshing = false; | ||||
@@ -115,6 +115,8 @@ import {registrationList} from "@/api/sunVillage_info/subcontract"; | |||||
} | } | ||||
this.total += response.rows.length; | this.total += response.rows.length; | ||||
this.finished = this.total >= response.total; | this.finished = this.total >= response.total; | ||||
}).catch(() => { | |||||
this.finished = true; | |||||
}).finally(() => { | }).finally(() => { | ||||
this.loading = false; | this.loading = false; | ||||
this.refreshing = false; | this.refreshing = false; | ||||
@@ -143,6 +143,8 @@ | |||||
} | } | ||||
this.total += response.rows.length; | this.total += response.rows.length; | ||||
this.finished = this.total >= response.total; | this.finished = this.total >= response.total; | ||||
}).catch(() => { | |||||
this.finished = true; | |||||
}).finally(() => { | }).finally(() => { | ||||
this.loading = false; | this.loading = false; | ||||
this.refreshing = false; | this.refreshing = false; | ||||
@@ -158,6 +158,8 @@ export default { | |||||
} | } | ||||
this.total += response.rows.length; | this.total += response.rows.length; | ||||
this.finished = this.total >= response.total; | this.finished = this.total >= response.total; | ||||
}).catch(() => { | |||||
this.finished = true; | |||||
}).finally(() => { | }).finally(() => { | ||||
this.loading = false; | this.loading = false; | ||||
this.refreshing = false; | this.refreshing = false; | ||||