feat: refs #7134 vnTable setTableFooter
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
09804e06c7
commit
e948253bea
|
@ -0,0 +1,12 @@
|
|||
export default function (initialFooter, data) {
|
||||
const footer = data.reduce(
|
||||
(acc, row) => {
|
||||
Object.entries(initialFooter).forEach(([key, initialValue]) => {
|
||||
acc[key] += row?.[key] !== undefined ? row[key] : initialValue;
|
||||
});
|
||||
return acc;
|
||||
},
|
||||
{ ...initialFooter }
|
||||
);
|
||||
return footer;
|
||||
}
|
|
@ -6,7 +6,7 @@ import { useAcl } from 'src/composables/useAcl';
|
|||
import axios from 'axios';
|
||||
import { useQuasar } from 'quasar';
|
||||
import { getSupplierRisk } from 'src/composables/getRisk';
|
||||
|
||||
import tableFooter from 'src/components/VnTable/filters/tableFooter';
|
||||
import { dashIfEmpty, toCurrency, toDate, toDateHourMin } from 'src/filters';
|
||||
import { useState } from 'composables/useState';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
|
@ -187,7 +187,15 @@ async function getCurrentBalance() {
|
|||
});
|
||||
return currentBalance && currentBalance.amount;
|
||||
}
|
||||
function setFooter(data) {
|
||||
const initialFooter = {
|
||||
invoiceEuros: 0,
|
||||
paymentEuros: 0,
|
||||
euroBalance: 0,
|
||||
};
|
||||
|
||||
tableRef.value.footer = tableFooter(initialFooter, data);
|
||||
}
|
||||
async function onFetch(data) {
|
||||
return;
|
||||
// balances.value = [];
|
||||
|
|
Loading…
Reference in New Issue