Commit 0f4a09e3 authored by 张烨's avatar 张烨

style: 优化站点管理样式

parent d7dbb073
...@@ -181,6 +181,23 @@ const SiteManage = () => { ...@@ -181,6 +181,23 @@ const SiteManage = () => {
console.log(err); console.log(err);
}); });
}; };
const renderListItem = items =>
items.map(t => (
<List.Item
onClick={() => {
setCurrentStation(t);
}}
key={t.id}
className={classnames({
[styles.listItem]: true,
[styles.selected]: currentStation.id === t.id,
})}
>
{t.text}
</List.Item>
));
return ( return (
<PageContainer> <PageContainer>
<GridContent> <GridContent>
...@@ -192,22 +209,7 @@ const SiteManage = () => { ...@@ -192,22 +209,7 @@ const SiteManage = () => {
spinning={spinLoading} spinning={spinLoading}
style={{ marginTop: '20px' }} style={{ marginTop: '20px' }}
> >
<List> <List>{renderListItem(treeData)}</List>
{treeData.map(t => (
<List.Item
onClick={() => {
setCurrentStation(t);
}}
key={t.id}
className={classnames({
[styles.listItem]: true,
[styles.selected]: currentStation.id === t.id,
})}
>
{t.text}
</List.Item>
))}
</List>
</Spin> </Spin>
<AddModal <AddModal
visible={modalVisible} visible={modalVisible}
......
.cardBox{ .cardBox{
min-height: calc(100vh - 200px); height: calc(100vh - 200px);
overflow: auto;
} }
.cardBoxR{ .cardBoxR{
min-height: calc(100vh - 292px); min-height: calc(100vh - 292px);
......
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