Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivWeb
Commits
d888f421
Commit
d888f421
authored
Sep 17, 2021
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:优化三级菜单样式
parent
87e31f24
Pipeline
#34790
passed with stages
in 29 minutes 46 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
72 additions
and
10 deletions
+72
-10
ExtendRightContent.js
src/components/GlobalHeader/ExtendRightContent.js
+47
-1
index.less
src/components/GlobalHeader/index.less
+6
-0
index.js
src/components/HeaderSearch/index.js
+1
-1
BasicLayout.less
src/layouts/BasicLayout.less
+9
-2
BasicLayout1.js
src/layouts/BasicLayout1.js
+9
-6
No files found.
src/components/GlobalHeader/ExtendRightContent.js
View file @
d888f421
...
...
@@ -106,7 +106,7 @@ export const getConfig = (widgets, url, key) => {
return
widgetconfig
;
};
const
GlobalHeaderRight
=
props
=>
{
const
[
options
,
setOptions
]
=
useState
([]);
const
homeRef
=
useRef
(
null
);
const
favitorRef
=
useRef
(
null
);
...
...
@@ -159,9 +159,55 @@ const GlobalHeaderRight = props => {
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
(
<
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
=
{
classNames
(
styles
.
item
)}
onClick
=
{
goHome
}
ref
=
{
homeRef
}
>
<
HomeIcon
title
=
{
intl
.
formatMessage
({
id
:
'component.header.icon.home'
})}
/
>
...
...
src/components/GlobalHeader/index.less
View file @
d888f421
...
...
@@ -40,6 +40,12 @@
background: transparent;
}
}
.extendsearch {
& :global(.ant-input-affix-wrapper) {
padding: 3px 11px!important;
background: #fff;
}
}
.account {
.avatar {
margin: ~'calc((@{layout-header-height} - 24px) / 2)' 0;
...
...
src/components/HeaderSearch/index.js
View file @
d888f421
...
...
@@ -44,7 +44,7 @@ const HeaderSearch = props => {
onChange
:
onVisibleChange
,
});
const
inputClass
=
classNames
(
styles
.
input
,
styles
.
search
,
{
const
inputClass
=
classNames
(
styles
.
input
,
styles
.
search
,
props
.
className
,
{
[
styles
.
show
]:
searchMode
,
});
...
...
src/layouts/BasicLayout.less
View file @
d888f421
...
...
@@ -276,7 +276,7 @@
}
}
.menu-item-children {
height:
47
px;
height:
36
px;
background: #fff;
box-shadow: rgb(240 241 242) 0px 2px 8px;
position: fixed;
...
...
@@ -297,6 +297,7 @@
& :global {
.ant-tabs-tab {
padding: 7px 0!important;
&:hover {
svg path, svg rect, svg circle {
fill: @primary-color!important;
...
...
@@ -326,6 +327,7 @@
position: relative;
align-items: center;
color: #737983;
transform: scale(0.92);
}
& :global(.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn) {
color: @primary-color!important;
...
...
@@ -348,9 +350,14 @@
}
& :global {
.ant-divider-vertical {
left:
15
px;
left:
20
px;
margin: 0 1px!important;
}
.ant-tabs-nav-operations {
.ant-tabs-nav-more {
margin-right: 0px!important;
}
}
}
& :global(.ant-tabs-ink-bar) {
background: @primary-color!important;
...
...
src/layouts/BasicLayout1.js
View file @
d888f421
...
...
@@ -182,7 +182,7 @@ const renderSite = ({data, config, loading, setLoading, action}) => {
const
[
visible
,
setVisible
]
=
useState
(
false
);
let
loaded
=
!!
((
data
&&
!
data
.
stations
)
||
(
Array
.
isArray
(
data
.
weathers
)
&&
data
.
weathers
.
length
===
0
));
if
(
config
&&
config
.
userInfo
&&
config
.
userInfo
.
site
===
''
)
{
loaded
=
tru
e
;
loaded
=
fals
e
;
};
return
(
<>
...
...
@@ -544,8 +544,8 @@ const BasicLayout = props => {
<
/div
>
<
/div
>
<
div
className
=
{
layoutStyles
[
'menu-item-children'
]}
>
<
Tabs
accessKey
=
{
tabActiveKey
}
tabBarGutter
=
{
30
}
onTabClick
=
{(
event
)
=>
handleSelectMenuItem
(
event
)}
>
<
div
className
=
{
layoutStyles
[
'menu-item-children'
]}
style
=
{{
width
:
collapse
?
'calc(100% - 46px)'
:
'calc(100% - 100px)'
}}
>
<
Tabs
accessKey
=
{
tabActiveKey
}
tabBarGutter
=
{
30
}
tabPosition
=
"top"
onTabClick
=
{(
event
)
=>
handleSelectMenuItem
(
event
)}
>
{
childrenRoutes
.
map
((
item
,
index
)
=>
(
<>
<
TabPane
...
...
@@ -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'}}/
>
}
<
span
className
=
{
layoutStyles
[
'menu-item-name'
]}
>
{
item
.
name
}
<
/span
>
<
Divider
type
=
"vertical"
/>
{
childrenRoutes
.
length
===
1
?
null
:
<
Divider
type
=
"vertical"
/>
}
<
/
>
)
}
<
/
>
}
key
=
{
item
.
path
}
disabled
=
{
index
===
16
}
>
>
<
/TabPane
>
<
/
>
))}
...
...
@@ -576,7 +579,7 @@ const BasicLayout = props => {
<
div
className
=
'ant-pro-grid-content'
>
<
div
className
=
"ant-pro-grid-content-children"
>
<
div
className
=
{
layoutStyles
[
'ant-pro-page-container-children-content'
]}
>
<
div
id
=
"micro-container"
className
=
"subapp-container"
style
=
{{
height
:
'
89.8vh'
,
position
:
'relative'
,
top
:
'64
px'
}}
/
>
<
div
id
=
"micro-container"
className
=
"subapp-container"
style
=
{{
height
:
'
90.4vh'
,
position
:
'relative'
,
top
:
'59
px'
}}
/
>
<
/div
>
<
/div
>
<
/div
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment