引入工具方法
import { queryMapIdpValue
} from '../../services/api';
在DVA数据池定义一部函数方法
*feacthSelectOption({payload
},{call
, put
}){
const res
= getResponse( yield call(queryMapIdpValue
,{
seal_status_code
:"CSGN.SEAL_STATUS_2"
}));
if(res
){
yield put({
type
:"updateState",
payload
:{
list
:res
}
})
}
return res
}
3.在类组件中周期函数中调用方法
componentWillMount = () => {
const { dispatch
} = this.props
;
dispatch({
type
: 'stampapply/feacthSelectOption',
}).then( ()=> {
const { selecteoption
} = this.props
;
this.setState({
selecteoption
,
});
});
};
转载请注明原文地址: https://lol.8miu.com/read-15625.html