Commit 6c464d43 authored by 陈前坚's avatar 陈前坚
parents fe894532 07452cc4
Pipeline #22165 skipped with stages
......@@ -61,7 +61,6 @@ class AvatarDropdown extends React.Component {
</Menu.Item>
</Menu>
);
let role = JSON.parse(localStorage.getItem('panda-oms-authority'))[1];
return currentUser ? (
<HeaderDropdown overlay={menuHeaderDropdown}>
<span className={`${styles.action} ${styles.account}`}>
......@@ -72,8 +71,9 @@ class AvatarDropdown extends React.Component {
alt="avatar"
/>
<span className={`${styles.name} anticon`}>
{roleName[role]}
{/* {currentUser.name || loginName || '管理员'} */}
{currentUser.name || loginName === 'omsa'
? '超级管理员'
: '管理员' || '管理员'}
</span>
</span>
</HeaderDropdown>
......
......@@ -12,6 +12,7 @@ import {
Space,
Checkbox,
Pagination,
Empty,
} from 'antd';
import lodash, { clone } from 'lodash';
import {
......@@ -80,15 +81,19 @@ const SiteManage = props => {
arr.push(res.find(item => item.id === 'Web4StationRoot'));
}
if (arr[0]) {
const stations = arr[0].children;
const stations = arr[0].children || [];
setTreeData(stations);
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([]);
}
}
})
......@@ -109,7 +114,7 @@ const SiteManage = props => {
}, [page.pageNum]);
const getList = name => {
let params = {
stationId: +currentStation.stationID,
stationId: +currentStation.stationID || '',
PageIndex: +page.pageNum,
PageSize: +page.pageSize,
};
......@@ -328,12 +333,12 @@ const SiteManage = props => {
if (res.success) {
setSelectList([]);
getList();
notification.success({
message: '提示',
duration: 3,
description: '设置成功',
});
getList();
} else {
notification.error({
message: '提示',
......@@ -508,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