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
ffda7fb0
Commit
ffda7fb0
authored
Jun 21, 2022
by
崔佳豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 云平台站点选择支持只显示关注站点
parent
4b949302
Pipeline
#53511
waiting for manual action with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
BasicLayout.js
src/layouts/BasicLayout.js
+21
-1
BasicLayout.less
src/layouts/BasicLayout.less
+1
-1
No files found.
src/layouts/BasicLayout.js
View file @
ffda7fb0
...
@@ -96,7 +96,18 @@ const StationsItem = (item, action, onChangeVisible, actionRef, setMenuLoading)
...
@@ -96,7 +96,18 @@ const StationsItem = (item, action, onChangeVisible, actionRef, setMenuLoading)
);
);
};
};
const
Stations
=
props
=>
{
const
OnlyFocusStations
=
props
=>
{
const
data
=
props
.
data
.
stations
;
return
(
<
Spin
spinning
=
{
props
.
loading
}
tip
=
"加载中"
size
=
"small"
>
<
div
className
=
{
layoutStyles
.
focusStations
}
style
=
{{
border
:
'none'
}}
>
<
ul
>
{
Array
.
isArray
(
data
)
?
data
.
map
(
item
=>
StationsItem
(
item
,
props
.
action
,
props
.
setVisible
,
props
.
actionRef
,
props
.
setMenuLoading
))
:
null
}
<
/ul
>
<
/div
>
<
/Spin
>
)
}
const
AllStations
=
props
=>
{
const
data
=
props
.
data
.
stations
;
const
data
=
props
.
data
.
stations
;
const
[
targetOffset
,
setTargetOffset
]
=
useState
(
undefined
);
const
[
targetOffset
,
setTargetOffset
]
=
useState
(
undefined
);
const
cityPane
=
useRef
(
null
);
const
cityPane
=
useRef
(
null
);
...
@@ -153,6 +164,15 @@ const Stations = props => {
...
@@ -153,6 +164,15 @@ const Stations = props => {
);
);
};
};
const
Stations
=
props
=>
{
const
isAll
=
props
.
data
&&
props
.
data
.
siteCityList
&&
((
props
.
data
.
siteCityList
.
letters
&&
props
.
data
.
siteCityList
.
letters
.
length
)
||
(
props
.
data
.
siteCityList
.
content
&&
props
.
data
.
siteCityList
.
content
.
length
));
return
isAll
?
<
AllStations
{...
props
}
/> : <OnlyFocusStations {...props}/
>
;
}
const
renderSite
=
({
data
,
config
,
loading
,
setLoading
,
action
,
actionRef
,
setMenuLoading
})
=>
{
const
renderSite
=
({
data
,
config
,
loading
,
setLoading
,
action
,
actionRef
,
setMenuLoading
})
=>
{
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
));
...
...
src/layouts/BasicLayout.less
View file @
ffda7fb0
...
@@ -504,7 +504,7 @@
...
@@ -504,7 +504,7 @@
}
}
}
}
}
}
:global(.@{ant-prefix}-spin) {
:global(.@{ant-prefix}-spin
-nested-loading .@{ant-prefix}-spin
) {
position: absolute;
position: absolute;
left: 50%;
left: 50%;
top: 50%;
top: 50%;
...
...
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