From 3b103caa6bfc9ed410e67156c3ca1785bf1cecc9 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 19 八月 2022 01:15:31 +0800
Subject: [PATCH] 2022-08-19

---
 src/menu/components/share/normalheader/index.jsx |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/menu/components/share/normalheader/index.jsx b/src/menu/components/share/normalheader/index.jsx
index e5345f5..2f552fd 100644
--- a/src/menu/components/share/normalheader/index.jsx
+++ b/src/menu/components/share/normalheader/index.jsx
@@ -22,10 +22,6 @@
     appType: sessionStorage.getItem('appType')
   }
 
-  componentDidMount () {
-    MKEmitter.addListener('submitStyle', this.getStyle)
-  }
-
   shouldComponentUpdate (nextProps, nextState) {
     return !is(fromJS(this.props.config), fromJS(nextProps.config))
   }
@@ -37,15 +33,14 @@
     this.setState = () => {
       return
     }
-    MKEmitter.removeListener('submitStyle', this.getStyle)
   }
 
-  getStyle = (comIds, style) => {
-    const { config } = this.props
+  getStyle = (style) => {
+    if (!style.borderBottomWidth) {
+      style.borderBottomWidth = '0px'
+    }
 
-    if (comIds[0] !== config.uuid || comIds[1] !== 'header') return
-
-    let _config = {...config, headerStyle: style}
+    let _config = {...this.props.config, headerStyle: style}
     
     this.props.updateComponent(_config)
   }
@@ -58,7 +53,7 @@
       options.push('padding')
     }
 
-    MKEmitter.emit('changeStyle', [config.uuid, 'header'], options, config.headerStyle)
+    MKEmitter.emit('changeStyle', options, config.headerStyle, this.getStyle)
   }
 
   render() {

--
Gitblit v1.8.0