From 0b8381328068394891541b6e3824f9afb2cc9fa1 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 04 七月 2023 13:53:33 +0800 Subject: [PATCH] 2023-07-04 --- src/menu/components/card/balcony/index.jsx | 30 +++++++++++++++++++++++++++--- 1 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/menu/components/card/balcony/index.jsx b/src/menu/components/card/balcony/index.jsx index 691e7f3..58f0f1f 100644 --- a/src/menu/components/card/balcony/index.jsx +++ b/src/menu/components/card/balcony/index.jsx @@ -47,7 +47,7 @@ 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: [], @@ -72,8 +72,32 @@ 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 }) } } @@ -155,7 +179,7 @@ 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) => { -- Gitblit v1.8.0