oak-pay-business/es/components/sysAccount/transferList/index.js

53 lines
1.4 KiB
JavaScript

export default OakComponent({
entity: 'withdrawTransfer',
isList: true,
projection: {
id: 1,
price: 1,
loss: 1,
externalId: 1,
iState: 1,
withdrawAccount: {
org: 1,
name: 1,
code: 1,
channel: {
entity: 1,
entityId: 1,
offlineAccount: {
id: 1,
type: 1,
}
},
id: 1,
}
},
filters: [
{
filter() {
const systemId = this.features.application.getApplication().systemId;
return {
withdrawAccount: {
ofSystemId: systemId,
},
iState: 'transferring',
};
}
}
],
formData({ data }) {
return {
transfers: data?.map((ele) => {
const { withdrawAccount, ...rest } = ele;
const { entity, offlineAccount } = withdrawAccount.channel;
const channel = entity === 'offlineAccount' ? this.t(`withdraw::channel.offlineAccount.${offlineAccount?.type}`) : this.t(`withdraw::channel.${entity}`);
return {
...rest,
withdrawAccount,
channel,
};
}),
};
},
});