import * as React from 'react'; import { withRouter, RouteChildrenProps } from 'react-router-dom'; import Risk from './riskinfo' import PlainList from './plain'; import FlowList from './flow'; import agent from '../Server'; import Rank from './rank'; /** Props接口 */ interface IProps { } class UIComponents extends React.Component { constructor(props) { super(props); this.state = { radioValue: props.location.query?.radio, enabled: false }; } radioChange = (value) => { this.setState({ radioValue: value }) } componentDidMount() { this.getData() } getData = async () => { const res: any = await agent.post('/web/verifierparty/riskconfig/get', {}, this); if (res.err) { return; } else { if (res.res.enabled) { this.setState({ enabled: res.res.enabled, radioValue: this.state.radioValue || 'customer' }) } else { this.setState({ enabled: res.res.enabled, radioValue: this.state.radioValue || 'list' }) } } } render() { const { radioValue, enabled } = this.state; return (
{radioValue === 'customer' && } {radioValue === 'list' && } {radioValue === 'echart' && } {radioValue === 'rank' && }
); } } export default withRouter(UIComponents as any)