32 lines
747 B
TypeScript
32 lines
747 B
TypeScript
/* eslint-disable import/prefer-default-export */
|
|
import type { ColumnsType } from 'antd/lib/table';
|
|
import InputNumber from 'Elements/InputNumber';
|
|
|
|
import { buildValueComponent } from './builders';
|
|
|
|
type Payment = {
|
|
key: number;
|
|
num: number;
|
|
paymentRelation: number;
|
|
};
|
|
|
|
export const columns: ColumnsType<Payment> = [
|
|
{
|
|
key: 'num',
|
|
dataIndex: 'num',
|
|
title: '#',
|
|
width: '7%',
|
|
render: (_value, payment) => payment.num + 1,
|
|
},
|
|
{
|
|
key: 'paymentRelation',
|
|
dataIndex: 'paymentRelation',
|
|
title: '% платежа',
|
|
render: (_value, payment) => {
|
|
const Component = buildValueComponent(payment.num, InputNumber);
|
|
|
|
return <Component min={0.01} max={100} step={1} precision={2} />;
|
|
},
|
|
},
|
|
];
|