Commit ffda7fb0 authored by 崔佳豪's avatar 崔佳豪

perf: 云平台站点选择支持只显示关注站点

parent 4b949302
Pipeline #53511 waiting for manual action with stages
......@@ -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 [targetOffset, setTargetOffset] = useState(undefined);
const cityPane = useRef(null);
......@@ -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 [visible, setVisible] = useState(false);
let loaded = !!((data && !data.stations) || (Array.isArray(data.weathers) && data.weathers.length === 0));
......
......@@ -504,7 +504,7 @@
}
}
}
:global(.@{ant-prefix}-spin) {
:global(.@{ant-prefix}-spin-nested-loading .@{ant-prefix}-spin) {
position: absolute;
left: 50%;
top: 50%;
......
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