Calculation/Form: add CreateKP tab
This commit is contained in:
parent
bbbf4d6d3e
commit
a349a17649
13
Components/Calculation/Form/CreateKP/config.ts
Normal file
13
Components/Calculation/Form/CreateKP/config.ts
Normal 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' }],
|
||||
];
|
||||
12
Components/Calculation/Form/CreateKP/index.jsx
Normal file
12
Components/Calculation/Form/CreateKP/index.jsx
Normal 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,
|
||||
};
|
||||
@ -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 (
|
||||
|
||||
@ -145,7 +145,7 @@ const titles: Record<ValuesElements | ComputedElements | ActionElements, string>
|
||||
labelResultFirstPaymentRiskPolicy: 'Первый платеж по риск политике, %',
|
||||
|
||||
/** Link Elements */
|
||||
linkDownloadKp: 'Скачать КП',
|
||||
linkDownloadKp: '',
|
||||
|
||||
/** Computed Elements */
|
||||
labelIrrInfo: 'Диапазон IRR (Номинал)',
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user