import type { DescItem } from '@eciol/ant-ui'; import { BasicColumn } from '@eciol/ant-ui'; import { useI18n } from '@eciol/locale'; const { t } = useI18n(); export const getReceiptsInfoSchema: () => DescItem[] = () => [ { field: 'billingName', label: t('partnerPortal.recelptsInfomation.addr'), }, { field: 'billingAddress', label: t('partnerPortal.recelptsInfomation.billing'), }, ]; export const getReceiptsMethodSchema: () => DescItem[] = () => [ { field: 'paymentType', label: t('partnerPortal.recelptsInfomation.cycle'), }, { field: 'defaultaccount', label: t('partnerPortal.recelptsInfomation.draccount'), }, { field: 'specialacase', label: t('partnerPortal.recelptsInfomation.special'), }, { field: 'specialaccount', label: t('partnerPortal.recelptsInfomation.sraccount'), }, ]; export const getReceiptsDetailSchema: () => DescItem[] = () => [ { field: 'accountNumber', label: t('partnerPortal.recelptsInfomation.raccount'), }, { field: 'accountDisplay', label: t('partnerPortal.recelptsInfomation.atype'), render(val) { return val.split(' - ')?.[1] ?? ''; }, }, { field: 'shortName', label: t('partnerPortal.recelptsInfomation.acurrency'), }, { field: 'bankName', label: t('partnerPortal.recelptsInfomation.abank'), }, { field: 'beneficiaryName', label: t('partnerPortal.recelptsInfomation.aaccountname'), }, { field: 'bankAddress', label: t('partnerPortal.recelptsInfomation.bankadd'), }, { field: 'ibanCode', label: t('partnerPortal.recelptsInfomation.iban'), }, { field: 'swiftCode', label: t('partnerPortal.recelptsInfomation.swift'), }, { field: 'otherInformation', label: t('partnerPortal.recelptsInfomation.other'), }, ]; export function getBasicColumns({ openModal }): BasicColumn[] { return [ { title: t('partnerPortal.recelptsInfomation.aaccountNumber'), dataIndex: 'accountNumber', customRender({ value, record }) { return h( record.accountType === 1 ? 'a' : 'div', { onClick: () => { record.accountType === 1 && openModal(true, record); }, }, value, ); }, }, { title: t('partnerPortal.recelptsInfomation.atype'), dataIndex: 'accountDisplay', customRender({ value }) { return value.split(' - ')?.[1] ?? ''; }, }, { title: t('partnerPortal.recelptsInfomation.acurrency'), dataIndex: 'shortName', }, { title: t('partnerPortal.recelptsInfomation.abank'), dataIndex: 'bankName', }, { title: t('partnerPortal.recelptsInfomation.aaccountname'), dataIndex: 'beneficiaryName', }, ]; }