king
2023-12-14 0eb129a9beddbb86ae74d7106a8e60823206b8d5
src/menu/stylecontroller/index.jsx
@@ -29,7 +29,8 @@
  ArrowRightOutlined,
  SwapOutlined,
  EnterOutlined,
  DragOutlined
  DragOutlined,
  EyeOutlined
} from '@ant-design/icons'
import MKEmitter from '@/utils/events.js'
@@ -56,6 +57,7 @@
  }
  callback = null
  timer = null
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
@@ -96,6 +98,8 @@
    }
    this.callback = callback
    this.timer = null
    let card = fromJS(style).toJS()
    let borposition = 'outer'
@@ -163,7 +167,7 @@
    this.callback = null
  }
  updateStyle = (style) => {
  updateStyle = (style, delay) => {
    const { card } = this.state
    let _style = {
@@ -191,7 +195,15 @@
      card: _style,
    })
    this.timer && clearTimeout(this.timer)
    if (delay) {
      this.timer = setTimeout(() => {
    this.callback && this.callback(_style)
      }, 300)
    } else {
      this.callback && this.callback(_style)
    }
  }
  /**
@@ -208,7 +220,7 @@
      value = 300
    }
    this.updateStyle({fontSize: `${value}px`})
    this.updateStyle({fontSize: `${value}px`}, true)
  }
  /**
@@ -219,7 +231,7 @@
    if (isNaN(value) || value < 1 || value > 10) return
    this.updateStyle({lineHeight: value})
    this.updateStyle({lineHeight: value}, true)
  }
  /**
@@ -230,7 +242,7 @@
    if (isNaN(value) || value < 0 || value > 100) return
    this.updateStyle({letterSpacing: `${value}px`})
    this.updateStyle({letterSpacing: `${value}px`}, true)
  }
  /**
@@ -241,7 +253,7 @@
    if (isNaN(value) || value < 0 || value > 100) return
    this.updateStyle({textIndent: `${value}px`})
    this.updateStyle({textIndent: `${value}px`}, true)
  }
  changeBackground = (val) => {
@@ -510,6 +522,8 @@
          delete style.right
        } else if (n === 'transform') {
          delete style.transform
        } else if (n === 'overflow') {
          delete style.overflow
        }
      })
    }
@@ -1064,6 +1078,20 @@
                  </Form.Item>
                </Col>
              </Panel> : null}
              {options.includes('overflow') ? <Panel header="溢出" key="overflow">
                <Col span={24}>
                  <Form.Item
                    colon={false}
                    label={<EyeOutlined title="溢出"/>}
                    labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
                  >
                    <Radio.Group style={{whiteSpace: 'nowrap'}} defaultValue={card.overflow || 'hidden'} onChange={(e) => this.changeNormalStyle(e.target.value, 'overflow')}>
                      <Radio value="hidden">隐藏</Radio>
                      <Radio value="visible">显示</Radio>
                    </Radio.Group>
                  </Form.Item>
                </Col>
              </Panel> : null}
              {options.includes('position') ? <Panel header="定位" key="position">
                <div style={{paddingLeft: '35px', fontSize: '12px'}}>注:定位效果请在运行环境中查看。</div>
                <Col span={24}>