From 4cc738e535d1a20701d206e12cf9de8cc5a01170 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 01 六月 2024 15:24:12 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/menu/components/share/normalheader/index.jsx |   41 ++++++++++++++++++++++++++++-------------
 1 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/src/menu/components/share/normalheader/index.jsx b/src/menu/components/share/normalheader/index.jsx
index 2f552fd..e0ed3f4 100644
--- a/src/menu/components/share/normalheader/index.jsx
+++ b/src/menu/components/share/normalheader/index.jsx
@@ -36,11 +36,22 @@
   }
 
   getStyle = (style) => {
-    if (!style.borderBottomWidth) {
-      style.borderBottomWidth = '0px'
+    let _style = fromJS(style).toJS()
+    if (!_style.borderBottomWidth) {
+      _style.borderBottomWidth = '0px'
+    }
+    if (_style.fontFamily) {
+      if (_style.fontFamily.length === 0) {
+        delete _style.fontFamily
+      } else {
+        _style.fontFamily = _style.fontFamily.join(',')
+      }
+    }
+    if (_style.lineHeight === 2.8) {
+      delete _style.lineHeight
     }
 
-    let _config = {...this.props.config, headerStyle: style}
+    let _config = {...this.props.config, headerStyle: _style}
     
     this.props.updateComponent(_config)
   }
@@ -48,24 +59,28 @@
   changeStyle = () => {
     const { config } = this.props
 
-    let options = ['font', 'border', 'background']
-    if (config.type === 'menubar') {
-      options.push('padding')
-    }
+    let _style = config.headerStyle ? fromJS(config.headerStyle).toJS() : {}
+    let options = ['font', 'border', 'background', 'padding', 'fontFamily']
 
-    MKEmitter.emit('changeStyle', options, config.headerStyle, this.getStyle)
+    _style.fontFamily = _style.fontFamily ? _style.fontFamily.split(',') : []
+    _style.lineHeight = _style.lineHeight || 2.8
+
+    MKEmitter.emit('changeStyle', options, _style, this.getStyle)
   }
 
   render() {
     const { config, hideSearch } = this.props
-    // const { appType } = this.state
 
-    let title = config.plot ? config.plot.title : config.wrap.title
+    let title = ''
     let show = true
 
-    // if (!title && appType === 'mob' && config.type === 'card' && config.subtype === 'datacard' && config.action && config.action.length) {
-    //   title = ' '
-    // }
+    if (config.plot) {
+      title = config.plot.title
+    } else if (config.type === 'group') {
+      title = config.setting.title || ''
+    } else if (config.wrap) {
+      title = config.wrap.title || ''
+    }
 
     if (!title && (!config.search || config.search.length === 0 || hideSearch === 'true')) {
       show = false

--
Gitblit v1.8.0