这段代码是一个 Redux 的 reducer 函数,根据不同的 action 来更新 state 的值。

在 'getInit' 函数中,它接收一个 action 对象作为参数,action 对象包含了一个 'payload' 属性,该属性是一个 'MCBHS010RequestInitRequest' 类型的对象。首先,它将 state 的 'hasCloseWindow' 属性设为 true,然后将 action.payload 赋值给 state 的 'submissionInitRequest' 属性,并将 'submissionInitRequest' 的 'sysVersionNumber' 和 'recruitmentManagementDivision' 属性分别赋值为 'initRequest' 的 'sysVersionNumber' 和 'recruitmentManagementDivision' 属性。最后,它返回更新后的 state。

在 'setInit' 函数中,它接收一个 action 对象作为参数,action 对象包含了一个 'payload' 属性,该属性是一个 'apiConfig.InitResult' 类型的对象。它将 state 的 'hasCloseWindow' 属性设为 false,将 action.payload 赋值给 state 的 'initResult' 属性,并将 'attachDisableFlag' 和 'optionDisableFlag' 属性都设为 false。最后,它返回更新后的 state。

Redux Reducer 函数:管理提交初始化数据

原文地址: https://www.cveoy.top/t/topic/pf5E 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录