| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | |
| | | |
| | | class NormalGroup extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.object, // 组件配置信息 |
| | | config: PropTypes.object |
| | | } |
| | | |
| | | state = {} |
| | | state = { |
| | | visible: true, |
| | | mergeAble: this.props.config.setting.mergeAble === 'true' |
| | | } |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { config, style } = this.props |
| | | const { visible, mergeAble } = this.state |
| | | |
| | | if (config.components.length === 0) return (<div style={config.style}></div>) |
| | | if (config.components.length === 0) return (<div className={'ant-col ant-col-' + config.width} style={style}><div style={config.style}></div></div>) |
| | | |
| | | return ( |
| | | <div className={'normal-group-wrap ' + (config.setting.layout || '')} id={'anchor' + config.uuid} style={config.style}> |
| | | {config.setting && config.setting.title ? <div className="group-header" style={config.headerStyle}> |
| | | <span className="title">{config.setting.title}</span> |
| | | </div> : null} |
| | | <TabTransfer config={config}/> |
| | | {/* <Row className="component-wrap">{this.getComponents()}</Row> */} |
| | | <div className={`ant-col ant-col-${config.width} ${mergeAble ? ' mk-merge-able mk-ctrl-' + (config.setting.ctrlNumber || 1) : ''} ${visible ? '' : ' close'}`} style={style}> |
| | | <div className={'normal-group-wrap ' + (config.setting.layout || '')} id={'anchor' + config.uuid} style={config.style}> |
| | | <div className="mk-control"> |
| | | <DoubleLeftOutlined onClick={() => this.setState({visible: false})}/> |
| | | <DoubleRightOutlined onClick={() => this.setState({visible: true})}/> |
| | | </div> |
| | | {config.setting && config.setting.title ? <div className="group-header" style={config.headerStyle}> |
| | | <span className="title">{config.setting.title}</span> |
| | | </div> : null} |
| | | <TabTransfer config={config}/> |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |