From 9ee3d1f9a09a865188baffdffb85f6ad329c7b09 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 19 十二月 2021 01:09:20 +0800 Subject: [PATCH] 2021-12-19 --- src/menu/components/share/normalheader/index.jsx | 26 +++++++++++++++++++------- 1 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/menu/components/share/normalheader/index.jsx b/src/menu/components/share/normalheader/index.jsx index f2274ba..dc85e5b 100644 --- a/src/menu/components/share/normalheader/index.jsx +++ b/src/menu/components/share/normalheader/index.jsx @@ -12,10 +12,13 @@ class NormalHeader extends Component { static propTpyes = { - defaultshow: PropTypes.any, // 鏍囬涓庢悳绱㈡潯浠朵笉瀛樺湪鏃堕殣钘� hideSearch: PropTypes.any, // 闅愯棌鎼滅储鏉′欢 config: PropTypes.object, // 閰嶇疆淇℃伅 updateComponent: PropTypes.func // 閰嶇疆鏇存柊 + } + + state = { + appType: sessionStorage.getItem('appType') } componentDidMount () { @@ -49,18 +52,27 @@ changeStyle = () => { const { config } = this.props - MKEmitter.emit('changeStyle', [config.uuid, 'header'], ['font', 'border'], config.headerStyle) + let options = ['font', 'border'] + if (config.type === 'menubar') { + options.push('padding') + } + + MKEmitter.emit('changeStyle', [config.uuid, 'header'], options, config.headerStyle) } render() { - const { config, defaultshow, hideSearch } = this.props + const { config, hideSearch } = this.props + const { appType } = this.state let title = config.plot ? config.plot.title : config.wrap.title let show = true - if (defaultshow === 'hidden') { - if (!title && (!config.search || config.search.length === 0)) { - show = false - } + + 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 } let _style = resetStyle(config.headerStyle) -- Gitblit v1.8.0