From 53b9fb93d0376eb02bb996935f1720b4e95cd897 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 12 十月 2022 14:41:06 +0800
Subject: [PATCH] 2022-10-12

---
 src/menu/components/share/normalheader/index.jsx |   25 ++++++++++---------------
 1 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/src/menu/components/share/normalheader/index.jsx b/src/menu/components/share/normalheader/index.jsx
index 3f051bc..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,19 +53,19 @@
       options.push('padding')
     }
 
-    MKEmitter.emit('changeStyle', [config.uuid, 'header'], options, config.headerStyle)
+    MKEmitter.emit('changeStyle', options, config.headerStyle, this.getStyle)
   }
 
   render() {
     const { config, hideSearch } = this.props
-    const { appType } = this.state
+    // const { appType } = this.state
 
     let title = config.plot ? config.plot.title : config.wrap.title
     let show = true
 
-    if (!title && appType === 'mob' && config.type === 'card' && config.subtype === 'datacard' && config.action && config.action.length) {
-      title = ' '
-    }
+    // if (!title && appType === 'mob' && config.type === 'card' && config.subtype === 'datacard' && config.action && config.action.length) {
+    //   title = ' '
+    // }
 
     if (!title && (!config.search || config.search.length === 0 || hideSearch === 'true')) {
       show = false

--
Gitblit v1.8.0