king
2022-06-28 0472ec32cadb4f9bca6dbab82ac33a42e76f37ed
src/menu/stylecontroller/index.jsx
@@ -1,7 +1,7 @@
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,
@@ -259,6 +259,29 @@
   */
  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)
    }
  }
  /**
@@ -578,6 +601,15 @@
                    <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}