add total amount in home page

This commit is contained in:
MaysWind
2021-01-10 21:24:02 +08:00
parent a470752d42
commit a5474d0d65
15 changed files with 576 additions and 7 deletions
+21
View File
@@ -159,6 +159,27 @@ export default {
password
});
},
getTransactionOverview: ( { today, thisWeek, thisMonth, thisYear } ) => {
const queryParams = [];
if (today) {
queryParams.push(`today_${today.startTime}_${today.endTime}`);
}
if (thisWeek) {
queryParams.push(`thisWeek_${thisWeek.startTime}_${thisWeek.endTime}`);
}
if (thisMonth) {
queryParams.push(`thisMonth_${thisMonth.startTime}_${thisMonth.endTime}`);
}
if (thisYear) {
queryParams.push(`thisYear_${thisYear.startTime}_${thisYear.endTime}`);
}
return axios.get('v1/overviews/transaction.json' + (queryParams.length ? '?query=' + queryParams.join('|') : ''));
},
getAllAccounts: ({ visibleOnly }) => {
return axios.get('v1/accounts/list.json?visible_only=' + !!visibleOnly);
},