Calculation/Form: add CreateKP tab

This commit is contained in:
Chika 2022-06-14 19:15:06 +03:00
parent bbbf4d6d3e
commit a349a17649
5 changed files with 35 additions and 4 deletions

View File

@ -0,0 +1,13 @@
/* eslint-disable object-curly-newline */
import type { FormTabRows } from '../../lib/render-rows';
export const id = 'create-kp';
export const title = 'Создание КП';
export const rows: FormTabRows = [
[['cbxPriceWithDiscount', 'cbxFullPriceWithDiscount', 'cbxCostIncrease']],
[['cbxInsurance', 'cbxRegistrationQuote', 'cbxTechnicalCardQuote']],
[['cbxNSIB', 'cbxQuoteRedemptionGraph', 'cbxShowFinGAP']],
[['tbxQuoteName', 'radioQuoteContactGender'], { gridTemplateColumns: '1fr 1fr' }],
[['btnCreateKP', 'linkDownloadKp'], { gridTemplateColumns: '1fr 1fr' }],
];

View File

@ -0,0 +1,12 @@
import renderFormRows from 'Components/Calculation/lib/render-rows';
import { id, rows, title } from './config';
function CreateKP() {
return renderFormRows(rows);
}
export default {
id,
title,
Component: CreateKP,
};

View File

@ -1,13 +1,14 @@
import Background from 'Elements/layout/Background';
import { Tabs, Wrapper } from 'Elements/layout/Tabs';
import AddProduct from './AddProduct';
import CreateKP from './CreateKP';
import Insurance from './Insurance';
import Leasing from './Leasing';
import LeasingObject from './LeasingObject';
import Payments from './Payments';
import SupplierAgent from './SupplierAgent';
const formTabs = [Leasing, Payments, LeasingObject, SupplierAgent, Insurance, AddProduct];
const formTabs = [Leasing, Payments, LeasingObject, SupplierAgent, Insurance, AddProduct, CreateKP];
function Form() {
return (

View File

@ -145,7 +145,7 @@ const titles: Record<ValuesElements | ComputedElements | ActionElements, string>
labelResultFirstPaymentRiskPolicy: 'Первый платеж по риск политике, %',
/** Link Elements */
linkDownloadKp: 'Скачать КП',
linkDownloadKp: '',
/** Computed Elements */
labelIrrInfo: 'Диапазон IRR (Номинал)',

View File

@ -8,7 +8,12 @@ type ElementProps = {
text: string;
};
export default function Button({ status, action, text }: BaseElementProps<never> & ElementProps) {
export default function Button({
status,
action,
text,
...props
}: BaseElementProps<never> & ElementProps) {
const throttledAction = throttle(action, 1200, {
trailing: false,
});
@ -18,7 +23,7 @@ export default function Button({ status, action, text }: BaseElementProps<never>
disabled={status === 'Disabled'}
loading={status === 'Loading'}
onClick={throttledAction}
ghost
{...props}
>
{text}
</AntButton>