From 8753aeefb8e3a4463be9d76328c42c1b4caad90a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 09 九月 2021 19:14:07 +0800
Subject: [PATCH] 2021-09-09

---
 src/menu/components/editor/braft-editor/index.jsx            |   22 +++++++++-------------
 src/menu/components/editor/braft-editor/options.jsx          |   10 ++++++++++
 src/tabviews/custom/components/editor/braft-editor/index.jsx |    6 +++++-
 3 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/src/menu/components/editor/braft-editor/index.jsx b/src/menu/components/editor/braft-editor/index.jsx
index 994da8b..63b9cb3 100644
--- a/src/menu/components/editor/braft-editor/index.jsx
+++ b/src/menu/components/editor/braft-editor/index.jsx
@@ -51,7 +51,7 @@
         name: card.name,
         subtype: card.subtype,
         setting: { interType: 'system' },
-        wrap: { name: card.name, width: card.width || 24, encryption: 'true' },
+        wrap: { name: card.name, width: card.width || 24, encryption: 'true', minHeight: 100 },
         style: { marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' },
         headerStyle: { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: '#e8e8e8' },
         columns: [],
@@ -137,16 +137,6 @@
     this.props.updateConfig(_card)
   }
 
-  /**
-   * @description 鏇存柊鎼滅储鏉′欢閰嶇疆淇℃伅
-   */
-  updateconfig = (config) => {
-    this.setState({
-      card: config
-    })
-    this.props.updateConfig(config)
-  }
-
   getWrapForms = () => {
     const { card } = this.state
 
@@ -154,7 +144,7 @@
   }
 
   updateWrap = (res) => {
-    this.updateconfig({...this.state.card, wrap: res})
+    this.updateComponent({...this.state.card, wrap: res})
   }
 
   clickComponent = (e) => {
@@ -166,8 +156,14 @@
 
   render() {
     const { card } = this.state
+
+    let style = {...card.style}
+    if (card.wrap.minHeight) {
+      style.minHeight = card.wrap.minHeight
+    }
+
     return (
-      <div className="menu-normal-editor-box" style={{...card.style}} onClick={this.clickComponent} id={card.uuid}>
+      <div className="menu-normal-editor-box" style={style} onClick={this.clickComponent} id={card.uuid}>
         <NormalHeader defaultshow="hidden" hideSearch="true" config={card} updateComponent={this.updateComponent}/>
         <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
           <div className="mk-popover-control">
diff --git a/src/menu/components/editor/braft-editor/options.jsx b/src/menu/components/editor/braft-editor/options.jsx
index b5054fc..c3f6c06 100644
--- a/src/menu/components/editor/braft-editor/options.jsx
+++ b/src/menu/components/editor/braft-editor/options.jsx
@@ -73,6 +73,16 @@
       ]
     },
     {
+      type: 'number',
+      field: 'minHeight',
+      label: '鏈�灏忛珮搴�',
+      initval: wrap.minHeight || '',
+      min: 0,
+      max: 3000,
+      precision: 0,
+      required: false
+    },
+    {
       type: 'multiselect',
       field: 'blacklist',
       label: '榛戝悕鍗�',
diff --git a/src/tabviews/custom/components/editor/braft-editor/index.jsx b/src/tabviews/custom/components/editor/braft-editor/index.jsx
index 8b7c537..c2f8d55 100644
--- a/src/tabviews/custom/components/editor/braft-editor/index.jsx
+++ b/src/tabviews/custom/components/editor/braft-editor/index.jsx
@@ -56,6 +56,10 @@
       _data = {}
     }
 
+    if (_config.wrap.minHeight) {
+      _config.style.minHeight = _config.wrap.minHeight
+    }
+
     this.setState({
       sync: _sync,
       data: _data,
@@ -171,7 +175,7 @@
     const { config, loading, data } = this.state
 
     return (
-      <div className="custom-braft-editor-box" style={{...config.style}}>
+      <div className="custom-braft-editor-box" style={config.style}>
         {loading ?
           <div className="loading-mask">
             <div className="ant-spin-blur"></div>

--
Gitblit v1.8.0