Commit 07452cc4 authored by tianfen's avatar tianfen

fix: 修改站点管理删除数据显示问题

parent 8b2a222a
Pipeline #22141 skipped with stages
......@@ -12,6 +12,7 @@ import {
Space,
Checkbox,
Pagination,
Empty,
} from 'antd';
import lodash, { clone } from 'lodash';
import {
......@@ -82,16 +83,17 @@ const SiteManage = props => {
if (arr[0]) {
const stations = arr[0].children || [];
setTreeData(stations);
if (stations.length < 1) {
return;
}
if (!currentStation.stationID) {
setCurrentStation(stations[0]);
if (stations.length > 0) {
if (!currentStation.stationID) {
setCurrentStation(stations[0]);
} else {
setCurrentStation(
stations.find(s => s.stationID === currentStation.stationID) ||
stations[0],
);
}
} else {
setCurrentStation(
stations.find(s => s.stationID === currentStation.stationID) ||
stations[0],
);
setdataList([]);
}
}
})
......@@ -331,12 +333,12 @@ const SiteManage = props => {
if (res.success) {
setSelectList([]);
getList();
notification.success({
message: '提示',
duration: 3,
description: '设置成功',
});
getList();
} else {
notification.error({
message: '提示',
......@@ -511,39 +513,44 @@ const SiteManage = props => {
/>
))}
</Spin>
<div style={{ textAlign: 'right' }}>
<Pagination
size="small"
total={total}
current={page.pageNum}
defaultPageSize="5"
onChange={handleChangePage}
pageSizeOptions={['5']}
/>
</div>
<p>已选择列表:</p>
<div className={styles.siteSelectList}>
<ul className={styles.siteSelectUl}>
{selectList.map((item, index) => (
<li
key={`${item.userName}${item.GroupId}`}
onClick={() => handleDel(index)}
{dataList.length > 0 ? (
<>
<div style={{ textAlign: 'right' }}>
<Pagination
size="small"
total={total}
current={page.pageNum}
defaultPageSize="5"
onChange={handleChangePage}
pageSizeOptions={['5']}
/>
</div>
<p>已选择列表:</p>
<div className={styles.siteSelectList}>
<ul className={styles.siteSelectUl}>
{selectList.map((item, index) => (
<li
key={`${item.userName}${item.GroupId}`}
onClick={() => handleDel(index)}
>
{`${item.userName}(${item.GroupName})`}
</li>
))}
</ul>
</div>
<div className={styles.siteBtn}>
<Button
type="primary"
className={styles.siteCommit}
onClick={handleCommitBtn}
>
{`${item.userName}(${item.GroupName})`}
</li>
))}
</ul>
</div>
<div style={{ textAlign: 'right' }}>
<Button
type="primary"
className={styles.siteCommit}
onClick={handleCommitBtn}
>
提交
</Button>
</div>
提交
</Button>
</div>
</>
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)}
</Card>
</div>
</div>
......
......@@ -145,6 +145,7 @@
border:1px solid #f5f5f5;
height: 200px;
overflow: auto;
margin-bottom: 50px;
.siteSelectUl{
margin: 0;
padding: 15px;
......@@ -165,4 +166,10 @@
padding: 0 20px 0 10px;
}
}
}
.siteBtn{
width:70.5vw;
text-align: right;
position: fixed;
bottom: 20px;
}
\ No newline at end of file
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