add types to calculation sections list

This commit is contained in:
Владислав Чикалкин 2020-09-21 15:04:12 +03:00
parent 1e72022551
commit e507868826
3 changed files with 38 additions and 5 deletions

View File

@ -14,8 +14,9 @@ import {
validateKpp,
validatePhone,
} from 'client/tools/validate';
import { ISections } from 'core/types/Calculation/components';
export default [
const sections: ISections[] = [
{
title: 'Интерес/ЛС',
groups: [
@ -1656,3 +1657,5 @@ export default [
],
},
];
export default sections;

View File

@ -0,0 +1,29 @@
import { ElementsNames } from 'core/types/elements';
import { ValuesNames } from 'core/types/values';
interface IElement {
isTable?: boolean;
title?: string;
Component: () => JSX.Element;
props: {
name: ElementsNames;
valueName?: ValuesNames;
[key: string]: any;
};
}
interface IBlock {
title?: string;
elements: IElement[];
[key: string]: any;
}
interface IGroup {
title?: string;
blocks?: IBlock[];
}
export interface ISections {
title?: string;
groups?: IGroup[];
}

View File

@ -2,7 +2,7 @@ export type ElementsNames =
| 'selectLead'
| 'selectOpportunity'
| 'selectQuote'
| 'cbxRecalcWthtRevision'
| 'cbxRecalcWithRevision'
| 'selectTemplate'
| 'selectChannel'
| 'tbxNewClient'
@ -110,7 +110,7 @@ export type ElementsNames =
| 'cbxAddEquipment'
| 'cbxRegistrationQuote'
| 'cbxTechnicalCardQuote'
| 'cbxNSiB'
| 'cbxNSIB'
| 'tbxQuoteName'
| 'radioQuoteContactGender'
| 'btnCreateKP'
@ -123,7 +123,7 @@ export type ElementsNames =
| 'cbxInsuranceDecentral'
| 'tbxMaxPriceChange'
| 'tbxImporterRewardPerc'
| 'tbxImrovterRewardRub'
| 'tbxImporterRewardRub'
| 'cbxDisableChecks'
| 'btnFranschise'
| 'btnDriversApplication'
@ -131,7 +131,8 @@ export type ElementsNames =
| 'tbxBusinessUnit'
| 'tbxLeadNumber'
| 'tbxOpportunityNumber'
| 'radioInsuranceOPF';
| 'radioInsuranceOPF'
| 'tableInsurance';
export type TElements<T> = {
[elementName in ElementsNames]?: T;