import { EStepType } from '@/constant' ; import { IStepInfo } from '@/types/step' ; export default class StepUtils { export param { number } currentStep param { IStepInfo [ ] } stepList returns { * } public static getCurrentStepInfo ( currentStep , stepList ) { const currentStepInfo = this . getStepInfo ( currentStep , stepList ) ; const useDataSourceStep = [ EStepType . QUALITY_INSPECTION , EStepType . MANUAL_CORRECTION ] . includes ( currentStepInfo ?. type ) ; /** 人工修正、质检获取 dataSourceStep 作为步骤配置 */ if ( useDataSourceStep ) { return this . getStepInfo ( currentStepInfo . dataSourceStep , stepList ) ; } return currentStepInfo ; } param step param stepList returns public static getStepInfo ( step , stepList ) { return stepList ?. filter ( ( info ) => info . step === step ) [ 0 ] ; } }