[balance] sortable balance in adminpage
This commit is contained in:
parent
ea01742e00
commit
d2044975db
|
@ -140,14 +140,27 @@ export default defineComponent({
|
|||
name: 'limit',
|
||||
label: 'Limit',
|
||||
align: 'right',
|
||||
field: 'userid',
|
||||
format: (_: undefined, row: { userid: string }) => getLimit(row.userid),
|
||||
},
|
||||
{
|
||||
name: 'balance',
|
||||
label: 'Kontostand',
|
||||
align: 'right',
|
||||
field: 'userid',
|
||||
format: (_: undefined, row: { debit: number; credit: number }) =>
|
||||
getBalance(row.debit, row.credit),
|
||||
sortable: true,
|
||||
sort: (
|
||||
_: undefined,
|
||||
__: undefined,
|
||||
a: { debit: number; credit: number },
|
||||
b: { debit: number; credit: number }
|
||||
) => {
|
||||
return (
|
||||
parseFloat(getBalance(a.debit, a.credit)) - parseFloat(getBalance(b.debit, b.credit))
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in New Issue