| | |
| | | }) |
| | | } |
| | | |
| | | updateStyle = (proper) => { |
| | | const { config } = this.state |
| | | |
| | | config.components = config.components.map(component => { |
| | | if (component.uuid === proper.componentId) { |
| | | Object.keys(component).forEach(key => { |
| | | if (component[key].editable && component[key].uuid === proper.uuid) { |
| | | component[key].style = {...component[key].style, ...proper.style} |
| | | } |
| | | }) |
| | | } |
| | | return component |
| | | }) |
| | | this.setState({config}) |
| | | } |
| | | |
| | | updateConfig = (config) => { |
| | | this.setState({ |
| | | config: config |
| | |
| | | </div> : null |
| | | } |
| | | <div className="mob-setting"> |
| | | {config ? <Tabs defaultActiveKey="2" animated={false} size="small"> |
| | | {config ? <Tabs defaultActiveKey="1" animated={false} size="small"> |
| | | <TabPane tab="配置" key="1"> |
| | | {/* <SketchPicker /> */} |
| | | <Controller editElem={editElem} /> |
| | | <Controller editElem={editElem} updateStyle={this.updateStyle} /> |
| | | </TabPane> |
| | | <TabPane tab="数据源" key="2"> |
| | | <DataSource config={config} updateConfig={this.updateConfig} /> |