mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into review-bugfixed
This commit is contained in:
commit
4f964545f1
@ -113,7 +113,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
currentPage: 1,
|
||||
startDecay: 0,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
||||
@ -127,27 +127,56 @@
|
||||
</b-row>
|
||||
</div>
|
||||
</b-collapse>
|
||||
|
||||
<!-- Collaps ENDE -->
|
||||
</div>
|
||||
</div>
|
||||
<pagination-buttons
|
||||
v-if="transactionGdtCount > pageSize"
|
||||
:has-next="hasNext"
|
||||
:has-previous="hasPrevious"
|
||||
:total-pages="totalPages"
|
||||
:current-page="currentPage"
|
||||
@show-next="showNext"
|
||||
@show-previous="showPrevious"
|
||||
></pagination-buttons>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import communityAPI from '../../../apis/communityAPI'
|
||||
import PaginationButtons from '../../../components/PaginationButtons'
|
||||
|
||||
export default {
|
||||
name: 'gdt-transaction-list',
|
||||
components: {
|
||||
PaginationButtons,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
transactionsGdt: { default: () => [] },
|
||||
transactionGdtCount: { type: Number, default: 0 },
|
||||
currentPage: 1,
|
||||
pageSize: 25,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
hasNext() {
|
||||
return this.currentPage * this.pageSize < this.transactionGdtCount
|
||||
},
|
||||
hasPrevious() {
|
||||
return this.currentPage > 1
|
||||
},
|
||||
totalPages() {
|
||||
return Math.ceil(this.transactionGdtCount / this.pageSize)
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async updateGdt() {
|
||||
const result = await communityAPI.transactionsgdt(this.$store.state.sessionId)
|
||||
const result = await communityAPI.transactionsgdt(
|
||||
this.$store.state.sessionId,
|
||||
this.currentPage,
|
||||
this.pageSize,
|
||||
)
|
||||
if (result.success) {
|
||||
this.transactionsGdt = result.result.data.gdtEntries
|
||||
this.transactionGdtCount = result.result.data.count
|
||||
@ -155,6 +184,16 @@ export default {
|
||||
this.$toasted.error(result.result.message)
|
||||
}
|
||||
},
|
||||
showNext() {
|
||||
this.currentPage++
|
||||
this.updateGdt()
|
||||
window.scrollTo(0, 0)
|
||||
},
|
||||
showPrevious() {
|
||||
this.currentPage--
|
||||
this.updateGdt()
|
||||
window.scrollTo(0, 0)
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.updateGdt()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user