type for options

This commit is contained in:
Владислав Чикалкин 2020-09-21 16:02:55 +03:00
parent e507868826
commit 3ff877fcec
4 changed files with 31 additions and 12 deletions

View File

@ -1,6 +1,7 @@
import { TElements } from 'core/types/elements';
import { TElementOption } from 'core/types/Calculation/options';
const initialOptions: TElements<any> = {
const initialOptions: TElements<TElementOption[]> = {
selectChannel: [
{
name: 'От агента-ФЛ-сотрудника поставщика',

View File

@ -1,7 +1,8 @@
import { TElementOption } from 'core/types/Calculation/options';
import { TElements } from 'core/types/elements';
import faker from 'faker';
const calculationFakeData: TElements<any> = {
const calculationFakeData: TElements<TElementOption[]> = {
selectSupplier: [
{
name: 'RENAULT (Престиж)',
@ -282,43 +283,54 @@ const calculationFakeData: TElements<any> = {
selectLead: [
{
name: '100_ООО "Архимаг',
value: faker.random.uuid(),
id: 'arhimagLead',
value: 'arhimagLead',
evo_opportunityid: 'arhimagOpportunity',
},
{
name: '150_ООО "Некромант',
value: faker.random.uuid(),
id: 'nekrolead',
value: 'nekrolead',
},
{
name: '200_ООО "Кардинал',
value: faker.random.uuid(),
id: 'kardinalLead',
value: 'kardinalLead',
},
],
selectOpportunity: [
{
name: '112345_ООО "Архимаг',
value: faker.random.uuid(),
id: 'arhimagOpportunity',
value: 'arhimagOpportunity',
},
{
name: '145678_ООО "Некромант',
value: faker.random.uuid(),
id: 'nekroOpportunity',
value: 'nekroOpportunity',
},
{
name: '243910_ООО Кардинал',
value: faker.random.uuid(),
id: 'kardinalOpportunity',
value: 'kardinalOpportunity',
},
],
selectQuote: [
{
name: '2345_ООО "Архимаг"',
value: faker.random.uuid(),
id: 'arhimagQuote',
value: 'arhimagQuote',
evo_leadid: 'arhimagLead',
},
{
name: '6789_ООО "Некромант"',
value: faker.random.uuid(),
id: 'nekroQuote',
value: 'nekroQuote',
},
{
name: '8765_ООО "Кардинал',
value: faker.random.uuid(),
id: 'kardinalQuote',
value: 'kardinalQuote',
},
],
selectBroker: [

View File

@ -0,0 +1,5 @@
export type TElementOption = {
name: string;
value: any;
[key: string]: any;
};

View File

@ -7,9 +7,10 @@ import {
import { TValues, ValuesNames } from './values';
import { TElements, ElementsNames } from './elements';
import { TStatuses, Status } from './statuses';
import { TElementOption } from 'core/types/Calculation/options';
export interface ICalculationStore {
options: TElements<any>;
options: TElements<TElementOption[]>;
applyOptions: (options: TElements<any>) => void;
filters: TElements<any>;