| | |
| | | fonts: null, |
| | | backgroundImage: '', |
| | | options: [], |
| | | borposition: 'outer' |
| | | borposition: 'outer', |
| | | type: '' |
| | | } |
| | | |
| | | callback = null |
| | |
| | | MKEmitter.removeListener('changeStyle', this.initStyle) |
| | | } |
| | | |
| | | initStyle = (options, style = {}, callback) => { |
| | | initStyle = (options, style = {}, callback, type) => { |
| | | let backgroundImage = '' |
| | | if (style.backgroundImage && /^url/ig.test(style.backgroundImage)) { |
| | | backgroundImage = style.backgroundImage.replace(/^url\(/ig, '').replace(/\)$/ig, '') |
| | |
| | | |
| | | this.setState({ |
| | | visible: true, |
| | | type: type || '', |
| | | fonts: fonts, |
| | | card: card, |
| | | options: options, |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { card, options, backgroundImage, borposition, fonts } = this.state |
| | | const { card, options, backgroundImage, borposition, fonts, type } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | maskStyle={{opacity: 0.1}} |
| | | visible={this.state.visible} |
| | | > |
| | | <div className="menu-style-controller"> |
| | | <div className={'menu-style-controller ' + (type || '')}> |
| | | <Form {...formItemLayout}> |
| | | {card ? <Collapse expandIconPosition="right" destroyInactivePanel={true} defaultActiveKey={options[0]}> |
| | | {options.includes('width') ? <Panel header="宽度" key="width"> |
| | |
| | | </Col> : null} |
| | | </Panel> : null} |
| | | {options.includes('background') || options.includes('backgroundColor') ? <Panel header="背景" key="background"> |
| | | <Col span={24}> |
| | | <Col span={24} className="bg-color-panel"> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<BgColorsOutlined title="背景颜色"/>} |
| | |
| | | <Input value={card.background || ''} onChange={(e) => this.changeBackground(e.target.value)} /> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!options.includes('backgroundColor') ? <Col span={24}> |
| | | {!options.includes('backgroundColor') ? <Col span={24} className="bg-image-panel"> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<PictureOutlined title="背景图片"/>} |