Commit d888f421 authored by 邓晓峰's avatar 邓晓峰

feat:优化三级菜单样式

parent 87e31f24
Pipeline #34790 passed with stages
in 29 minutes 46 seconds
...@@ -106,7 +106,7 @@ export const getConfig = (widgets, url, key) => { ...@@ -106,7 +106,7 @@ export const getConfig = (widgets, url, key) => {
return widgetconfig; return widgetconfig;
}; };
const GlobalHeaderRight = props => { const GlobalHeaderRight = props => {
const [options, setOptions] = useState([]);
const homeRef = useRef(null); const homeRef = useRef(null);
const favitorRef = useRef(null); const favitorRef = useRef(null);
...@@ -159,9 +159,55 @@ const GlobalHeaderRight = props => { ...@@ -159,9 +159,55 @@ const GlobalHeaderRight = props => {
window.share.event.emit('event:theme'); window.share.event.emit('event:theme');
} }
const handleSelect = (value, data) => {
window.share.event.emit('addTips', options, data);
};
const handleSearch = value => {
// eslint-disable-next-line no-undef
const search = new AMap.Autocomplete();
const areaName =
// eslint-disable-next-line no-undef
createStoreage.get('globalConfig').mapsettings.areasettings &&
// eslint-disable-next-line no-undef
createStoreage.get('globalConfig').mapsettings.areasettings.areaName;
const area = (areaName || '') + value;
setOptions([]);
// eslint-disable-next-line no-unused-expressions
value
? search.search(area, (status, res) => {
if (res && res.tips) {
const result = res.tips.map(item => {
item.value = item.name;
item.label = (
<>
<span>{item.name}</span>
<span style={{ color: '#c1c1c1' }}>
{item.district + item.address}
</span>
</>
);
return item;
});
setOptions(result);
}
})
: setOptions([]);
};
return ( return (
<div className={className}> <div className={className}>
<HeaderSearch
className={`${styles.action} ${styles.search} ${styles.extendsearch}`}
placeholder={intl.formatMessage({id:'component.search.menu.placeholder'})}
defaultValue=""
options={options}
{...props}
onSelect={handleSelect}
onChange={handleSearch}
onSearch={handleSearch}
/>
<div className={styles.nav}> <div className={styles.nav}>
<div className={classNames(styles.item)} onClick={goHome} ref={homeRef}> <div className={classNames(styles.item)} onClick={goHome} ref={homeRef}>
<HomeIcon title={intl.formatMessage({id: 'component.header.icon.home'})} /> <HomeIcon title={intl.formatMessage({id: 'component.header.icon.home'})} />
......
...@@ -40,6 +40,12 @@ ...@@ -40,6 +40,12 @@
background: transparent; background: transparent;
} }
} }
.extendsearch {
& :global(.ant-input-affix-wrapper) {
padding: 3px 11px!important;
background: #fff;
}
}
.account { .account {
.avatar { .avatar {
margin: ~'calc((@{layout-header-height} - 24px) / 2)' 0; margin: ~'calc((@{layout-header-height} - 24px) / 2)' 0;
......
...@@ -44,7 +44,7 @@ const HeaderSearch = props => { ...@@ -44,7 +44,7 @@ const HeaderSearch = props => {
onChange: onVisibleChange, onChange: onVisibleChange,
}); });
const inputClass = classNames(styles.input, styles.search, { const inputClass = classNames(styles.input, styles.search, props.className, {
[styles.show]: searchMode, [styles.show]: searchMode,
}); });
......
...@@ -276,7 +276,7 @@ ...@@ -276,7 +276,7 @@
} }
} }
.menu-item-children { .menu-item-children {
height: 47px; height: 36px;
background: #fff; background: #fff;
box-shadow: rgb(240 241 242) 0px 2px 8px; box-shadow: rgb(240 241 242) 0px 2px 8px;
position: fixed; position: fixed;
...@@ -297,6 +297,7 @@ ...@@ -297,6 +297,7 @@
& :global { & :global {
.ant-tabs-tab { .ant-tabs-tab {
padding: 7px 0!important;
&:hover { &:hover {
svg path, svg rect, svg circle { svg path, svg rect, svg circle {
fill: @primary-color!important; fill: @primary-color!important;
...@@ -326,6 +327,7 @@ ...@@ -326,6 +327,7 @@
position: relative; position: relative;
align-items: center; align-items: center;
color: #737983; color: #737983;
transform: scale(0.92);
} }
& :global(.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn) { & :global(.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn) {
color: @primary-color!important; color: @primary-color!important;
...@@ -348,9 +350,14 @@ ...@@ -348,9 +350,14 @@
} }
& :global { & :global {
.ant-divider-vertical { .ant-divider-vertical {
left: 15px; left: 20px;
margin: 0 1px!important; margin: 0 1px!important;
} }
.ant-tabs-nav-operations {
.ant-tabs-nav-more {
margin-right: 0px!important;
}
}
} }
& :global(.ant-tabs-ink-bar) { & :global(.ant-tabs-ink-bar) {
background: @primary-color!important; background: @primary-color!important;
......
...@@ -182,7 +182,7 @@ const renderSite = ({data, config, loading, setLoading, action}) => { ...@@ -182,7 +182,7 @@ const renderSite = ({data, config, loading, setLoading, action}) => {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
let loaded = !!((data && !data.stations) || (Array.isArray(data.weathers) && data.weathers.length === 0)); let loaded = !!((data && !data.stations) || (Array.isArray(data.weathers) && data.weathers.length === 0));
if (config && config.userInfo && config.userInfo.site === '') { if (config && config.userInfo && config.userInfo.site === '') {
loaded = true; loaded = false;
}; };
return ( return (
<> <>
...@@ -544,8 +544,8 @@ const BasicLayout = props => { ...@@ -544,8 +544,8 @@ const BasicLayout = props => {
</div> </div>
</div> </div>
<div className={layoutStyles['menu-item-children']}> <div className={layoutStyles['menu-item-children']} style={{width: collapse ? 'calc(100% - 46px)': 'calc(100% - 100px)'}}>
<Tabs accessKey={tabActiveKey} tabBarGutter={30} onTabClick={(event) => handleSelectMenuItem(event)}> <Tabs accessKey={tabActiveKey} tabBarGutter={30} tabPosition="top" onTabClick={(event) => handleSelectMenuItem(event)}>
{childrenRoutes.map((item, index) => ( {childrenRoutes.map((item, index) => (
<> <>
<TabPane <TabPane
...@@ -559,14 +559,17 @@ const BasicLayout = props => { ...@@ -559,14 +559,17 @@ const BasicLayout = props => {
item.icon ? item.icon: item.extData && /.svg/.test(item.extData.icon) ? <ReactSVG src={item.extData.icon} style={{width: '18px', height: '18px'}}/>:item.extData && <img src={item.extData.icon} style={{width: '18px', height: '18px'}}/> item.icon ? item.icon: item.extData && /.svg/.test(item.extData.icon) ? <ReactSVG src={item.extData.icon} style={{width: '18px', height: '18px'}}/>:item.extData && <img src={item.extData.icon} style={{width: '18px', height: '18px'}}/>
} }
<span className={layoutStyles['menu-item-name']}>{item.name}</span> <span className={layoutStyles['menu-item-name']}>{item.name}</span>
<Divider type="vertical" /> {
childrenRoutes.length === 1 ? null: <Divider type="vertical" />
}
</> </>
) )
} }
</> </>
} }
key={item.path} key={item.path}
disabled={index === 16}> >
</TabPane> </TabPane>
</> </>
))} ))}
...@@ -576,7 +579,7 @@ const BasicLayout = props => { ...@@ -576,7 +579,7 @@ const BasicLayout = props => {
<div className='ant-pro-grid-content'> <div className='ant-pro-grid-content'>
<div className="ant-pro-grid-content-children"> <div className="ant-pro-grid-content-children">
<div className={layoutStyles['ant-pro-page-container-children-content']}> <div className={layoutStyles['ant-pro-page-container-children-content']}>
<div id="micro-container" className="subapp-container" style={{height: '89.8vh', position: 'relative', top: '64px'}}/> <div id="micro-container" className="subapp-container" style={{height: '90.4vh', position: 'relative', top: '59px'}}/>
</div> </div>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment