| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Collapse, Form, Col, InputNumber, Select, Radio, Drawer, Button } from 'antd' |
| | | import { Collapse, Form, Col, InputNumber, Input, Select, Radio, Drawer, Button } from 'antd' |
| | | import { |
| | | ColumnHeightOutlined, |
| | | FontSizeOutlined, |
| | |
| | | */ |
| | | changeBackgroundColor = (val) => { |
| | | this.updateStyle({backgroundColor: val}) |
| | | } |
| | | |
| | | changeBackground = (val) => { |
| | | const { comIds, card } = this.state |
| | | |
| | | let _style = { ...card } |
| | | |
| | | _style.background = val |
| | | |
| | | delete _style.backgroundColor |
| | | delete _style.backgroundImage |
| | | |
| | | if (!val) { |
| | | delete _style.background |
| | | } |
| | | |
| | | this.setState({ |
| | | card: _style, |
| | | }) |
| | | |
| | | if (!val || /(^linear-gradient|^radial-gradient)\(.*\)$/.test(val)) { |
| | | MKEmitter.emit('submitStyle', comIds, _style) |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | <ColorSketch value={card.backgroundColor || '#ffffff'} onChange={this.changeBackgroundColor} /> |
| | | </Form.Item> |
| | | </Col> |
| | | {window.develop === true ? <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<BgColorsOutlined title="背景颜色"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <Input value={card.background || ''} onChange={(e) => this.changeBackground(e.target.value)} /> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!options.includes('backgroundColor') ? <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |