ff465ae: поправили

This commit is contained in:
vchikalkin 2023-01-30 17:09:32 +03:00
parent d4b4fc2246
commit aab9045460
2 changed files with 29 additions and 29 deletions

View File

@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { gql } from '@apollo/client';
import { selectSeasonType } from 'config/default-options';
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import type * as CRMTypes from 'graphql/crm.types';
@ -370,10 +371,9 @@ export default function commonReactions({ store, apolloClient }: ReactionsContex
const allowedSeasonTypes = diff(seasonTypes, seasonTypesExeption);
const filteredSeasonTypesOptions = $calculation
.element('selectSeasonType')
.getOptions()
.filter((seasonTypeOption) => allowedSeasonTypes.includes(seasonTypeOption.value));
const filteredSeasonTypesOptions = selectSeasonType.filter((seasonTypeOption) =>
allowedSeasonTypes.includes(seasonTypeOption.value)
);
$calculation.element('selectSeasonType').setOptions(filteredSeasonTypesOptions);
}

View File

@ -1,6 +1,6 @@
/* eslint-disable function-paren-newline */
/* eslint-disable implicit-arrow-linebreak */
import { selectHighSeasonStart, selectSeasonType } from 'config/default-options';
import { selectHighSeasonStart } from 'config/default-options';
import { comparer, reaction, toJS } from 'mobx';
import type { ReactionsContext } from 'process/types';
import { shift } from 'radash';
@ -204,36 +204,36 @@ export default function paymentsReactions({ store }: ReactionsContext) {
}
);
/**
* Дегрессия
*/
// /**
// * Дегрессия
// */
reaction(
() => {
const graphType = $calculation.element('radioGraphType').getValue();
// reaction(
// () => {
// const graphType = $calculation.element('radioGraphType').getValue();
return graphType;
},
(graphType) => {
if (!graphType) {
$calculation.element('selectSeasonType').resetOptions();
// return graphType;
// },
// (graphType) => {
// if (!graphType) {
// $calculation.element('selectSeasonType').resetOptions();
return;
}
// return;
// }
if (graphType === 100_000_001 || graphType === 100_000_003) {
const allowedSeasonTypes = seasonsConstants.SEASON_TYPES[graphType];
// if (graphType === 100_000_001 || graphType === 100_000_003) {
// const allowedSeasonTypes = seasonsConstants.SEASON_TYPES[graphType];
const selectSeasonTypeOptions = selectSeasonType.filter((option) =>
allowedSeasonTypes.includes(option.value)
);
// const selectSeasonTypeOptions = selectSeasonType.filter((option) =>
// allowedSeasonTypes.includes(option.value)
// );
$calculation.element('selectSeasonType').setOptions(selectSeasonTypeOptions);
} else {
$calculation.element('selectSeasonType').resetOptions();
}
}
);
// $calculation.element('selectSeasonType').setOptions(selectSeasonTypeOptions);
// } else {
// $calculation.element('selectSeasonType').resetOptions();
// }
// }
// );
const degressionSteps: { [key: number]: Array<number> } = {
100_000_003: [100, 50, 25],