calculationStore: fix selectFuelCard filter
This commit is contained in:
parent
43c194b18a
commit
a9b0eee6bf
@ -1469,35 +1469,6 @@ const reactionEffects: IReactionEffect[] = [
|
||||
},
|
||||
}),
|
||||
|
||||
(calculationStore, calculationProcess) => ({
|
||||
expression: () => {
|
||||
return calculationStore.getValue('leasingPeriod');
|
||||
},
|
||||
effect: () => {
|
||||
if (calculationProcess.hasProcess(Process.LoadKp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const fuelCard = calculationStore.getOption('selectFuelCard');
|
||||
if (fuelCard) {
|
||||
const selectFuelCard_filter =
|
||||
calculationStore.getFilter('selectFuelCard');
|
||||
const selectFueldCard_options =
|
||||
calculationStore.getOptions('selectFuelCard');
|
||||
|
||||
if (selectFuelCard_filter && selectFueldCard_options) {
|
||||
const filtered_technicalCards = selectFuelCard_filter(
|
||||
selectFueldCard_options,
|
||||
);
|
||||
calculationStore.setValue(
|
||||
'fuelCard',
|
||||
filtered_technicalCards?.[0]?.evo_addproduct_typeid,
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
}),
|
||||
|
||||
calculationStore => ({
|
||||
expression: () => {
|
||||
const {
|
||||
|
||||
@ -6,9 +6,6 @@ import { TElementFilter } from 'core/types/Calculation/Store/filters';
|
||||
|
||||
const initialFilters: TElements<TElementFilter> = {};
|
||||
|
||||
export const noResetValueElements: ElementsNames[] = [
|
||||
'selectTechnicalCard',
|
||||
'selectFuelCard',
|
||||
];
|
||||
export const noResetValueElements: ElementsNames[] = ['selectTechnicalCard'];
|
||||
|
||||
export default initialFilters;
|
||||
|
||||
Reference in New Issue
Block a user