weaver_trunk_cli/pc4mobx/portal4public/wea-system-setting/index.js

34 lines
1.0 KiB
JavaScript

import React from 'react';
import Loadable from 'react-loadable';
import './style';
const loadable = (loader, loading = () => null) => Loadable({ loader, loading });
const WeaSystemSetting = loadable(() => import('./WeaSystemSetting'));
class Index extends React.Component {
constructor(props) {
super(props);
const { location = {}, visible = false } = props;
const { query = {} } = location;
const { display = '' } = query;
this.state = { display, visible };
}
render() {
const { display, visible, style } = this.state;
const { callbackFn={} } = this.props;
return display == 'page' || visible ? <WeaSystemSetting ecId={`${this && this.props && this.props.ecId || ''}_WeaSystemSetting@9etnma`} {...this.props} display={display} visible={visible} style={style} onShow={this.onShow} callbackFn={callbackFn}/> : null;
}
onShow = (visible = true, style = {}) => {
this.setState({ visible, style });
};
onHide = () => {
this.setState({ visible: false });
};
}
export default Index;