|
|
@ -18,7 +18,7 @@ let alarmScrollbar; |
|
|
|
|
|
|
|
|
|
|
|
const Control = (props) => { |
|
|
|
const { dispatch, actions, user, loading, socket } = props |
|
|
|
const { dispatch, actions, user, loading, socket ,pepProjectId} = props |
|
|
|
const { control } = actions |
|
|
|
const stationList = [ |
|
|
|
'url(/assets/images/console/lan_1.png)', |
|
|
@ -63,11 +63,10 @@ const Control = (props) => { |
|
|
|
}, []) |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
dispatch(control.geteteConsoleCount({})).then(res => { |
|
|
|
console.log(res); |
|
|
|
dispatch(control.geteteConsoleCount({pepProjectId:pepProjectId})).then(res => { |
|
|
|
if (res.success) setWorkData(res.payload.data) |
|
|
|
}) |
|
|
|
}, []) |
|
|
|
}, [pepProjectId]) |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
newScrollbar = new PerfectScrollbar("#news", { |
|
|
@ -145,13 +144,17 @@ const Control = (props) => { |
|
|
|
} |
|
|
|
|
|
|
|
let listAll = [ |
|
|
|
{ name: '关注的项目', sort: 1, key: 'project', data: 1, img: 'url(/assets/images/console/lan_1.png)' }, |
|
|
|
{ name: '数据告警', sort: 2, key: 'data', data: workData?.dataAlarm?.alarm || 0, img: 'url(/assets/images/console/lv_1.png)' }, |
|
|
|
{ name: '应用告警', sort: 2, key: 'app', data: workData?.appAlarm?.alarm || 0, img: 'url(/assets/images/console/hong_1.png)' }, |
|
|
|
{ name: '设备告警', sort: 2, key: 'device', data: workData?.dataAlarm?.alarm || 0, img: 'url(/assets/images/console/hong_1.png)' }, |
|
|
|
{ name: '关注的项目', sort: 1, key: 'project', data: workData?.projects, img: 'url(/assets/images/console/lan_1.png)' }, |
|
|
|
{ name: '数据告警', sort: 2, key: 'data', data: workData?.dataSurplus, img: 'url(/assets/images/console/lv_1.png)' }, |
|
|
|
{ name: '应用告警', sort: 2, key: 'app', data: workData?.appSurplus, img: 'url(/assets/images/console/hong_1.png)' }, |
|
|
|
{ name: '设备告警', sort: 2, key: 'device', data: workData?.toolSurplus, img: 'url(/assets/images/console/hong_1.png)' }, |
|
|
|
] |
|
|
|
console.log(workData); |
|
|
|
console.log(listAll); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
attribute('workbench') |
|
|
|
}, [workData]) |
|
|
|
|
|
|
|
const attribute = (title) => { |
|
|
|
let take = localStorage.getItem(title) |
|
|
@ -214,7 +217,7 @@ const Control = (props) => { |
|
|
|
剩余问题: |
|
|
|
</div> |
|
|
|
<div style={{ fontSize: 16, color: '#4A4A4A', width: 91 }}> |
|
|
|
{(workData?.appAlarm?.appSurplus + workData?.dataAlarm?.alarmSurplus + workData?.videoAlarm?.videoSurplus) || 0} |
|
|
|
{(workData?.appSurplus + workData?.dataSurplus + workData?.toolSurplus) || 0} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style={{ display: 'flex', alignItems: 'center', marginTop: 26 }}> |
|
|
@ -223,7 +226,7 @@ const Control = (props) => { |
|
|
|
</div> |
|
|
|
<div style={{ fontSize: 16, color: '#4A4A4A', width: 91, display: 'flex' }}> |
|
|
|
<div> |
|
|
|
{(workData?.appAlarm?.appNewAdd + workData?.dataAlarm?.alarmNewAdd + workData?.videoAlarm?.videoNewAdd) || 0} |
|
|
|
{(workData?.appNewAdd + workData?.dataNewAdd + workData?.toolNewAdd) || 0} |
|
|
|
</div> |
|
|
|
<div style={{ display: 'flex', alignItems: 'center', marginLeft: 4 }}> |
|
|
|
<img title='设置' src="/assets/images/console/icon_up.png" style={{ width: 18, height: 18 }} /> |
|
|
@ -235,13 +238,13 @@ const Control = (props) => { |
|
|
|
今日处理: |
|
|
|
</div> |
|
|
|
<div style={{ fontSize: 16, color: '#4A4A4A', width: 91 }}> |
|
|
|
{(workData?.appAlarm?.appConfirme + workData?.dataAlarm?.alarmConfirme + workData?.videoAlarm?.videoConfirme) || 0} |
|
|
|
{(workData?.appConfirme + workData?.dataConfirme + workData?.toolConfirme) || 0} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{/* 循环类型 */} |
|
|
|
<div id='alarm' style={{ width: 'calc(100% - 200px)', position: 'relative', whiteSpace: 'nowrap', }}> |
|
|
|
{exhibition['workbench'].map((item, index) => { |
|
|
|
{exhibition['workbench']?.map((item, index) => { |
|
|
|
return ( |
|
|
|
<div key={item.name} style={{ background: item.img, backgroundSize: "100% 100%", display: "inline-block", width: 270, height: 135, marginRight: 26 }}> |
|
|
|
<div style={{ margin: '35px 0px 0px 134px' }}> |
|
|
@ -639,6 +642,7 @@ function mapStateToProps (state) { |
|
|
|
// loading: members.isRequesting, |
|
|
|
user: auth.user, |
|
|
|
actions: global.actions, |
|
|
|
pepProjectId: global.pepProjectId, |
|
|
|
// members: members.data, |
|
|
|
// socket: webSocket.socket |
|
|
|
}; |
|
|
|