mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-25 06:51:08 +00:00
Basic fix for entire page loading: https://github.com/firefly-iii/firefly-iii/pull/4839
This commit is contained in:
@@ -57,7 +57,9 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #cell(description)="data">
|
<template #cell(description)="data">
|
||||||
<span><i class="fas fa-angle-right" v-if="data.item.split && data.item.split_parent !== null"></i></span>
|
<span><i class="fas fa-angle-right" v-if="data.item.split && data.item.split_parent !== null"></i></span>
|
||||||
<a :class="false === data.item.active ? 'text-muted' : ''" :href="'./transactions/show/' + data.item.id" :title="data.value">{{ data.value }}</a>
|
<a :class="false === data.item.active ? 'text-muted' : ''" :href="'./transactions/show/' + data.item.id" :title="data.value">{{
|
||||||
|
data.value
|
||||||
|
}}</a>
|
||||||
</template>
|
</template>
|
||||||
<template #cell(amount)="data">
|
<template #cell(amount)="data">
|
||||||
<span class="text-success" v-if="'deposit' === data.item.type">
|
<span class="text-success" v-if="'deposit' === data.item.type">
|
||||||
@@ -76,10 +78,12 @@
|
|||||||
{{ data.item.date_formatted }}
|
{{ data.item.date_formatted }}
|
||||||
</template>
|
</template>
|
||||||
<template #cell(source_account)="data">
|
<template #cell(source_account)="data">
|
||||||
<a :class="false === data.item.active ? 'text-muted' : ''" :href="'./accounts/show/' + data.item.source_id" :title="data.item.source_name">{{ data.item.source_name }}</a>
|
<a :class="false === data.item.active ? 'text-muted' : ''" :href="'./accounts/show/' + data.item.source_id"
|
||||||
|
:title="data.item.source_name">{{ data.item.source_name }}</a>
|
||||||
</template>
|
</template>
|
||||||
<template #cell(destination_account)="data">
|
<template #cell(destination_account)="data">
|
||||||
<a :class="false === data.item.active ? 'text-muted' : ''" :href="'./accounts/show/' + data.item.destination_id" :title="data.item.destination_name">{{ data.item.destination_name }}</a>
|
<a :class="false === data.item.active ? 'text-muted' : ''" :href="'./accounts/show/' + data.item.destination_id"
|
||||||
|
:title="data.item.destination_name">{{ data.item.destination_name }}</a>
|
||||||
</template>
|
</template>
|
||||||
<template #cell(menu)="data">
|
<template #cell(menu)="data">
|
||||||
<div class="btn-group btn-group-sm" v-if="! data.item.split || data.item.split_parent === null">
|
<div class="btn-group btn-group-sm" v-if="! data.item.split || data.item.split_parent === null">
|
||||||
@@ -111,7 +115,8 @@
|
|||||||
</b-table>
|
</b-table>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
<a :href="'./transactions/create/' + type" class="btn btn-success" :title="$t('firefly.create_new_transaction')">{{ $t('firefly.create_new_transaction') }}</a>
|
<a :href="'./transactions/create/' + type" class="btn btn-success"
|
||||||
|
:title="$t('firefly.create_new_transaction')">{{ $t('firefly.create_new_transaction') }}</a>
|
||||||
<a href="#" class="btn btn-info"><i class="fas fa-sync"></i></a>
|
<a href="#" class="btn btn-info"><i class="fas fa-sync"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -248,24 +253,27 @@ export default {
|
|||||||
let endStr = format(this.end, 'y-MM-dd');
|
let endStr = format(this.end, 'y-MM-dd');
|
||||||
api.get('./api/v1/transactions?type=' + this.type + '&page=' + page + "&start=" + startStr + "&end=" + endStr)
|
api.get('./api/v1/transactions?type=' + this.type + '&page=' + page + "&start=" + startStr + "&end=" + endStr)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
|
||||||
let currentPage = parseInt(response.data.meta.pagination.current_page);
|
let currentPage = parseInt(response.data.meta.pagination.current_page);
|
||||||
let totalPage = parseInt(response.data.meta.pagination.total_pages);
|
let totalPages = parseInt(response.data.meta.pagination.total_pages);
|
||||||
this.total = parseInt(response.data.meta.pagination.total);
|
this.total = parseInt(response.data.meta.pagination.total);
|
||||||
|
console.log('total is ' + this.total);
|
||||||
this.transactions.push(...response.data.data);
|
this.transactions.push(...response.data.data);
|
||||||
if (currentPage < totalPage) {
|
// if (currentPage < totalPage) {
|
||||||
let nextPage = currentPage + 1;
|
// let nextPage = currentPage + 1;
|
||||||
this.downloadTransactionList(nextPage);
|
// this.downloadTransactionList(nextPage);
|
||||||
}
|
// }
|
||||||
if (currentPage >= totalPage) {
|
// if (currentPage >= totalPage) {
|
||||||
// console.log('Looks like all downloaded.');
|
// console.log('Looks like all downloaded.');
|
||||||
this.downloaded = true;
|
this.downloaded = true;
|
||||||
this.createTransactionRows();
|
this.createTransactionRows();
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
createTransactionRows: function() {
|
createTransactionRows: function () {
|
||||||
this.transactionRows = [];
|
this.transactionRows = [];
|
||||||
for (let i in this.transactions) {
|
for (let i in this.transactions) {
|
||||||
let transaction = this.transactions[i];
|
let transaction = this.transactions[i];
|
||||||
@@ -284,7 +292,7 @@ export default {
|
|||||||
transactionRow.destination_name = '';
|
transactionRow.destination_name = '';
|
||||||
transactionRow.destination_id = '';
|
transactionRow.destination_id = '';
|
||||||
|
|
||||||
if (! transactionRow.collapsed) {
|
if (!transactionRow.collapsed) {
|
||||||
for (let i = 0; i < transaction.attributes.transactions.length; i++) {
|
for (let i = 0; i < transaction.attributes.transactions.length; i++) {
|
||||||
let splitTransactionRow = this.getTransactionRow(transaction, i);
|
let splitTransactionRow = this.getTransactionRow(transaction, i);
|
||||||
splitTransactionRow.key = splitTransactionRow.id + "." + i
|
splitTransactionRow.key = splitTransactionRow.id + "." + i
|
||||||
@@ -300,7 +308,7 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
getTransactionRow(transaction, index) {
|
getTransactionRow(transaction, index) {
|
||||||
let transactionRow = { };
|
let transactionRow = {};
|
||||||
let currentTransaction = transaction.attributes.transactions[index];
|
let currentTransaction = transaction.attributes.transactions[index];
|
||||||
|
|
||||||
transactionRow.key = transaction.id;
|
transactionRow.key = transaction.id;
|
||||||
@@ -323,16 +331,16 @@ export default {
|
|||||||
|
|
||||||
return transactionRow;
|
return transactionRow;
|
||||||
},
|
},
|
||||||
toggleCollapse: function(row) {
|
toggleCollapse: function (row) {
|
||||||
let transaction = this.transactions.filter(transaction => transaction.id === row.id)[0];
|
let transaction = this.transactions.filter(transaction => transaction.id === row.id)[0];
|
||||||
if (transaction.collapsed === undefined) {
|
if (transaction.collapsed === undefined) {
|
||||||
transaction.collapsed = false;
|
transaction.collapsed = false;
|
||||||
} else {
|
} else {
|
||||||
transaction.collapsed = ! transaction.collapsed;
|
transaction.collapsed = !transaction.collapsed;
|
||||||
}
|
}
|
||||||
this.createTransactionRows();
|
this.createTransactionRows();
|
||||||
},
|
},
|
||||||
tableSortCompare: function(aRow, bRow, key, sortDesc, formatter, compareOptions, compareLocale) {
|
tableSortCompare: function (aRow, bRow, key, sortDesc, formatter, compareOptions, compareLocale) {
|
||||||
let a = aRow[key]
|
let a = aRow[key]
|
||||||
let b = bRow[key]
|
let b = bRow[key]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user