From 50955551f7aebd3f664d3840ded3d1cb4aed3beb Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 07 二月 2025 17:54:52 +0800 Subject: [PATCH] 2025-02-07 --- src/menu/components/code/sandbox/index.scss | 7 --- src/menu/components/card/balcony/index.jsx | 13 +++++- src/menu/components/card/balcony/index.scss | 4 ++ src/menu/components/editor/braft-editor/index.jsx | 2 src/menu/components/tree/antd-tree/index.scss | 7 --- src/tabviews/custom/components/editor/braft-editor/index.jsx | 22 +++++++++++ src/menu/components/editor/braft-editor/index.scss | 18 ++++++++- 7 files changed, 54 insertions(+), 19 deletions(-) diff --git a/src/menu/components/card/balcony/index.jsx b/src/menu/components/card/balcony/index.jsx index c1bef15..06c6691 100644 --- a/src/menu/components/card/balcony/index.jsx +++ b/src/menu/components/card/balcony/index.jsx @@ -160,8 +160,17 @@ changeStyle = () => { const { card } = this.state + let options = ['width', 'height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight', 'position', 'transform'] - MKEmitter.emit('changeStyle', ['width', 'height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight', 'position', 'transform'], card.style, this.getStyle) + if (card.style && !card.style.width) { + if (card.style.height) { + options = ['height', 'width', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight', 'position', 'transform'] + } else if (card.style.position && ['fixed', 'absolute'].includes(card.style.position)) { + options = ['position', 'width', 'height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight', 'transform'] + } + } + + MKEmitter.emit('changeStyle', options, card.style, this.getStyle) } getStyle = (style) => { @@ -277,7 +286,7 @@ let _style = resetStyle(card.style) return ( - <div className="menu-balcony-edit-box" style={_style} id={card.uuid}> + <div className={'menu-balcony-edit-box' + (['fixed', 'absolute'].includes(_style.position) ? ' ctrl-position' : '')} style={_style} id={card.uuid}> {card.style.height ? <ColumnHeightOutlined className="fixed-height" title="瀹氶珮" /> : null} <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> diff --git a/src/menu/components/card/balcony/index.scss b/src/menu/components/card/balcony/index.scss index efe4ce6..765264d 100644 --- a/src/menu/components/card/balcony/index.scss +++ b/src/menu/components/card/balcony/index.scss @@ -58,6 +58,10 @@ color: orange; } } +.menu-balcony-edit-box.ctrl-position { + width: auto!important; + height: auto!important; +} .menu-balcony-edit-box::after { display: block; content: ' '; diff --git a/src/menu/components/code/sandbox/index.scss b/src/menu/components/code/sandbox/index.scss index c096ca8..2f98095 100644 --- a/src/menu/components/code/sandbox/index.scss +++ b/src/menu/components/code/sandbox/index.scss @@ -17,13 +17,6 @@ padding: 5px; background: rgba(255, 255, 255, 0.55); } - .empty-content { - text-align: center; - font-size: 30px; - margin: 0; - line-height: 90px; - color: #bcbcbc; - } } .menu-editor-sand-box::after { display: block; diff --git a/src/menu/components/editor/braft-editor/index.jsx b/src/menu/components/editor/braft-editor/index.jsx index 67fcb70..8765707 100644 --- a/src/menu/components/editor/braft-editor/index.jsx +++ b/src/menu/components/editor/braft-editor/index.jsx @@ -212,7 +212,7 @@ } trigger="hover"> <ToolOutlined /> </Popover> - <BraftContent value={card.wrap.datatype !== 'static' ? '<p class="empty-content">瀵屾枃鏈�</p>' : card.html}/> + <BraftContent value={card.wrap.datatype !== 'static' ? '<p class="empty-content"><span>瀵屾枃鏈�<span>瀛楃鏇挎崲锛氱┖鏍�(blank_space_**)锛屽叾涓�**浠h〃绌烘牸鏁般�� </span></span></p>' : card.html}/> <div className="component-name"> <div className="center"> <div className="title">{card.name}</div> diff --git a/src/menu/components/editor/braft-editor/index.scss b/src/menu/components/editor/braft-editor/index.scss index 6e533e8..4fbde76 100644 --- a/src/menu/components/editor/braft-editor/index.scss +++ b/src/menu/components/editor/braft-editor/index.scss @@ -18,11 +18,25 @@ background: rgba(255, 255, 255, 0.55); } .empty-content { - text-align: center; font-size: 30px; margin: 0; - line-height: 90px; + height: 90px; color: #bcbcbc; + display: flex; + align-items: center; + justify-content: center; + overflow: hidden; + + span { + display: inline-block; + text-align: center; + span { + display: block; + font-size: 14px; + color: rgba(0, 0, 0, 0.65); + white-space: nowrap; + } + } } } .menu-normal-editor-box.th-light { diff --git a/src/menu/components/tree/antd-tree/index.scss b/src/menu/components/tree/antd-tree/index.scss index a0eeef9..67dbffc 100644 --- a/src/menu/components/tree/antd-tree/index.scss +++ b/src/menu/components/tree/antd-tree/index.scss @@ -19,13 +19,6 @@ padding: 5px; background: rgba(255, 255, 255, 0.55); } - .empty-content { - text-align: center; - font-size: 30px; - margin: 0; - line-height: 90px; - color: #bcbcbc; - } .model-menu-action-list:not(.length0) { margin: 10px 0px; } diff --git a/src/tabviews/custom/components/editor/braft-editor/index.jsx b/src/tabviews/custom/components/editor/braft-editor/index.jsx index 067b69f..5729372 100644 --- a/src/tabviews/custom/components/editor/braft-editor/index.jsx +++ b/src/tabviews/custom/components/editor/braft-editor/index.jsx @@ -63,6 +63,17 @@ } else { _data = [_data] } + } else if (config.html) { + if (/blank_space_\d+/ig.test(config.html)) { + config.html = config.html.replace(/blank_space_\d+/ig, (w) => { + let n = +w.replace(/blank_space_/ig, '') + if (n) { + return new Array(n).fill(' ').join('') + } + + return w + }) + } } if (_config.wrap.minHeight) { @@ -261,6 +272,17 @@ item.$html = item.$html.replace(reg, item[key]) }) } + + if (/blank_space_\d+/ig.test(item.$html)) { + item.$html = item.$html.replace(/blank_space_\d+/ig, (w) => { + let n = +w.replace(/blank_space_/ig, '') + if (n) { + return new Array(n).fill(' ').join('') + } + + return w + }) + } } }) -- Gitblit v1.8.0