| | |
| | | ArrowRightOutlined, |
| | | SwapOutlined, |
| | | EnterOutlined, |
| | | DragOutlined |
| | | DragOutlined, |
| | | EyeOutlined |
| | | } from '@ant-design/icons' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | |
| | | } |
| | | |
| | | callback = null |
| | | timer = null |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | |
| | | } |
| | | |
| | | this.callback = callback |
| | | this.timer = null |
| | | |
| | | let card = fromJS(style).toJS() |
| | | let borposition = 'outer' |
| | | |
| | |
| | | this.callback = null |
| | | } |
| | | |
| | | updateStyle = (style) => { |
| | | updateStyle = (style, delay) => { |
| | | const { card } = this.state |
| | | |
| | | let _style = { |
| | |
| | | card: _style, |
| | | }) |
| | | |
| | | this.callback && this.callback(_style) |
| | | this.timer && clearTimeout(this.timer) |
| | | |
| | | if (delay) { |
| | | this.timer = setTimeout(() => { |
| | | this.callback && this.callback(_style) |
| | | }, 300) |
| | | } else { |
| | | this.callback && this.callback(_style) |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | value = 300 |
| | | } |
| | | |
| | | this.updateStyle({fontSize: `${value}px`}) |
| | | this.updateStyle({fontSize: `${value}px`}, true) |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | if (isNaN(value) || value < 1 || value > 10) return |
| | | |
| | | this.updateStyle({lineHeight: value}) |
| | | this.updateStyle({lineHeight: value}, true) |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | if (isNaN(value) || value < 0 || value > 100) return |
| | | |
| | | this.updateStyle({letterSpacing: `${value}px`}) |
| | | this.updateStyle({letterSpacing: `${value}px`}, true) |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | if (isNaN(value) || value < 0 || value > 100) return |
| | | |
| | | this.updateStyle({textIndent: `${value}px`}) |
| | | this.updateStyle({textIndent: `${value}px`}, true) |
| | | } |
| | | |
| | | changeBackground = (val) => { |
| | |
| | | delete style.right |
| | | } else if (n === 'transform') { |
| | | delete style.transform |
| | | } else if (n === 'overflow') { |
| | | delete style.overflow |
| | | } |
| | | }) |
| | | } |
| | |
| | | </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}> |