From dddb2c96f42d9c852dba26ff9a27daa12bd85008 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 14 十月 2021 00:07:20 +0800 Subject: [PATCH] 2021-10-14 --- src/menu/components/share/normalheader/index.jsx | 21 ++++++++++++++++++--- 1 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/menu/components/share/normalheader/index.jsx b/src/menu/components/share/normalheader/index.jsx index 7295929..fca49ac 100644 --- a/src/menu/components/share/normalheader/index.jsx +++ b/src/menu/components/share/normalheader/index.jsx @@ -5,6 +5,7 @@ import asyncComponent from '@/utils/asyncComponent' import MKEmitter from '@/utils/events.js' +import { resetStyle } from '@/utils/utils-custom.js' import './index.scss' const SearchComponent = asyncComponent(() => import('@/menu/components/share/searchcomponent')) @@ -12,8 +13,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 () { @@ -47,22 +53,30 @@ changeStyle = () => { const { config } = this.props + // MKEmitter.emit('changeStyle', [config.uuid, 'header'], ['font', 'height', 'border'], config.headerStyle) MKEmitter.emit('changeStyle', [config.uuid, 'header'], ['font', 'border'], config.headerStyle) } render() { - const { config, defaultshow } = this.props + const { config, defaultshow, hideSearch } = this.props + 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 (defaultshow === 'hidden') { if (!title && (!config.search || config.search.length === 0)) { show = false } } + let _style = resetStyle(config.headerStyle) return ( - <div className={'normal-header' + (!show ? ' hidden' : '')} style={config.headerStyle}> + <div className={'normal-header' + (!show ? ' hidden' : '') + (config.wrap && config.wrap.searchable === 'true' ? ' tree-search' : '')} style={_style}> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" /> @@ -70,7 +84,8 @@ } trigger="hover"> <span className="title">{title}</span> </Popover> - {config.search ? <SearchComponent config={config} updatesearch={this.props.updateComponent}/> : null} + {config.wrap && config.wrap.searchable === 'true' ? <span className="ant-input-search ant-input-affix-wrapper"><span className="ant-input-suffix"><Icon type="search" /></span></span> : null} + {hideSearch !== 'true' && config.search ? <SearchComponent config={config} updatesearch={this.props.updateComponent}/> : null} </div> ) } -- Gitblit v1.8.0