| | |
| | | subtype: card.subtype, |
| | | setting: { interType: 'system' }, |
| | | wrap: { name: card.name, width: card.width || 24, linkType: 'static', position: 'relative', datatype: 'static' }, |
| | | style: { marginLeft: '0px', marginRight: '0px', marginTop: '0px', marginBottom: '0px' }, |
| | | style: { marginLeft: '0px', marginRight: '0px', marginTop: '0px', marginBottom: '0px', position: 'unset' }, |
| | | columns: [], |
| | | scripts: [], |
| | | elements: [], |
| | |
| | | |
| | | this.updateComponent(_card) |
| | | } else { |
| | | let _card = fromJS(card).toJS() |
| | | |
| | | if (!_card.style.position) { // 兼容 |
| | | if (_card.wrap.position === 'fixed' || _card.wrap.position === 'absolute') { |
| | | _card.style.position = _card.wrap.position |
| | | _card.style.zIndex = _card.wrap.position === 'fixed' ? 3 : 2 |
| | | _card.style.left = _card.wrap.left || '' |
| | | _card.style.right = _card.wrap.right || '' |
| | | _card.style.top = _card.wrap.top || '' |
| | | _card.style.bottom = _card.wrap.bottom || '' |
| | | _card.style.transform = _card.wrap.transform || '' |
| | | _card.style.width = _card.wrap.realwidth || '' |
| | | } else if (_card.wrap.left || _card.wrap.right || _card.wrap.top || _card.wrap.bottom) { |
| | | _card.style.position = 'relative' |
| | | _card.style.zIndex = 1 |
| | | _card.style.left = _card.wrap.left || '' |
| | | _card.style.right = _card.wrap.right || '' |
| | | _card.style.top = _card.wrap.top || '' |
| | | _card.style.bottom = _card.wrap.bottom || '' |
| | | } else { |
| | | _card.style.position = 'unset' |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | card: fromJS(card).toJS() |
| | | card: _card |
| | | }) |
| | | } |
| | | } |
| | |
| | | changeStyle = () => { |
| | | const { card } = this.state |
| | | |
| | | MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle) |
| | | MKEmitter.emit('changeStyle', ['width', 'height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight', 'position', 'transform'], card.style, this.getStyle) |
| | | } |
| | | |
| | | getStyle = (style) => { |