|
@ -26,14 +26,9 @@ let web |
|
|
const Control = ({ dispatch, actions, user, history, loading, socket, pepProjectId }) => { |
|
|
const Control = ({ dispatch, actions, user, history, loading, socket, pepProjectId }) => { |
|
|
|
|
|
|
|
|
const { control, install } = actions |
|
|
const { control, install } = actions |
|
|
const [timelineList, setTimelineList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//最新动态列表 |
|
|
|
|
|
|
|
|
|
|
|
const [memberList, setMemberList] = useState([])//相关成员列表 |
|
|
const [memberList, setMemberList] = useState([])//相关成员列表 |
|
|
|
|
|
|
|
|
const [equipmentList, setEquipmentList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//平台设备接入列表 |
|
|
const [equipmentList, setEquipmentList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//平台设备接入列表 |
|
|
|
|
|
|
|
|
const [webList, setWebList] = useState([])//关联web应用列表 |
|
|
const [webList, setWebList] = useState([])//关联web应用列表 |
|
|
|
|
|
|
|
|
const [problemsList, setProblemsList] = useState([])//异常&问题列表 |
|
|
const [problemsList, setProblemsList] = useState([])//异常&问题列表 |
|
|
const [setup, setSetup] = useState(false); //设置是否显现 |
|
|
const [setup, setSetup] = useState(false); //设置是否显现 |
|
|
const [tableType, setTableType] = useState(''); //localStorage存储名 |
|
|
const [tableType, setTableType] = useState(''); //localStorage存储名 |
|
@ -57,6 +52,7 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
const [setData, setSetData] = useState(); //设置总数 |
|
|
const [setData, setSetData] = useState(); //设置总数 |
|
|
const [projectData, setProjectData] = useState([]); //项目总信息 |
|
|
const [projectData, setProjectData] = useState([]); //项目总信息 |
|
|
const [socketData, setSocketData] = useState(); //推送数据 |
|
|
const [socketData, setSocketData] = useState(); //推送数据 |
|
|
|
|
|
const [socketDat] = useState(); //推送数据 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const exhibition = useRef({ workbench: [], statistical: [] }) //页面结构 |
|
|
const exhibition = useRef({ workbench: [], statistical: [] }) //页面结构 |
|
@ -84,7 +80,8 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
console.log(socketData) |
|
|
console.log(socketData) |
|
|
console.log(problemsList) |
|
|
console.log(problemsList) |
|
|
let workbench = workData |
|
|
let workbench = workData |
|
|
let problems = problemsList |
|
|
let newest = [] |
|
|
|
|
|
let ProblemAlarm = [] |
|
|
|
|
|
|
|
|
if (socketData?.appear?.length > 0) { |
|
|
if (socketData?.appear?.length > 0) { |
|
|
socketData?.appear?.map(v => { |
|
|
socketData?.appear?.map(v => { |
|
@ -95,7 +92,21 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
} else { |
|
|
} else { |
|
|
workbench.dataNewAdd++ |
|
|
workbench.dataNewAdd++ |
|
|
} |
|
|
} |
|
|
|
|
|
ProblemAlarm.push({ |
|
|
|
|
|
...v, url: v.alarmGroup, groupName: v.type, SourceName: v.source, StartTime: v.time, typeName: v.alarmGroup |
|
|
|
|
|
}) |
|
|
|
|
|
if (exhibition?.current?.dynamic?.find(v => v.key == 'discovery')) { |
|
|
|
|
|
newest.push({ |
|
|
|
|
|
seed: 'discovery', |
|
|
|
|
|
project: v.project, |
|
|
|
|
|
sources: v.source, |
|
|
|
|
|
type: v.type, |
|
|
|
|
|
time: v.time, |
|
|
|
|
|
id: v.id, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
if (socketData?.confirm?.length > 0) { |
|
|
if (socketData?.confirm?.length > 0) { |
|
|
socketData?.confirm?.map(v => { |
|
|
socketData?.confirm?.map(v => { |
|
@ -106,7 +117,53 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
} else { |
|
|
} else { |
|
|
workbench.dataConfirme++ |
|
|
workbench.dataConfirme++ |
|
|
} |
|
|
} |
|
|
|
|
|
if (exhibition?.current?.dynamic?.find(v => v.key == 'confirm')) { |
|
|
|
|
|
newest.push({ |
|
|
|
|
|
seed: 'confirm', |
|
|
|
|
|
project: v.project, |
|
|
|
|
|
sources: v.source, |
|
|
|
|
|
type: v.type, |
|
|
|
|
|
time: v.time, |
|
|
|
|
|
userName: v.user ? '' : v.user, |
|
|
|
|
|
id: v.id, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
dispatch(control.getConsoleAbnormal({ pepProjectId: pepProjectId || projectId })).then(res => { |
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
if (res.payload.data?.length > 4) { |
|
|
|
|
|
setProblemsList([...res.payload.data, ...res.payload.data]) |
|
|
|
|
|
let problemstop = 0 |
|
|
|
|
|
let problemsId = document.getElementById('problems'); |
|
|
|
|
|
if (problems) clearInterval(problems) |
|
|
|
|
|
if (problemsId) { |
|
|
|
|
|
function problemstart () { |
|
|
|
|
|
problems = setInterval(() => { |
|
|
|
|
|
problemstop += 5 |
|
|
|
|
|
problemsId.scrollTop = problemstop |
|
|
|
|
|
if (problemsId.scrollTop >= problemsId.scrollHeight / 2) problemstop = 0, problemsId.scrollTop = problemstop |
|
|
|
|
|
}, 500); |
|
|
|
|
|
problemsId.onmouseover = () => clearInterval(problems) |
|
|
|
|
|
} |
|
|
|
|
|
problemsId.onmouseout = () => problemstart() |
|
|
|
|
|
setTimeout(problemstart(), 1000); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
setProblemsList(res.payload.data) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
if (ProblemAlarm?.length > 0) { |
|
|
|
|
|
ProblemAlarm.sort((a, b) => { |
|
|
|
|
|
if (moment(a.StartTime).isBefore(b.StartTime)) { |
|
|
|
|
|
return 1 |
|
|
|
|
|
} else { |
|
|
|
|
|
return -1 |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
setProblemsList([...ProblemAlarm, ...problemsList]) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
workbench.appSurplus += (workbench.appNewAdd - workbench.appConfirme) |
|
|
workbench.appSurplus += (workbench.appNewAdd - workbench.appConfirme) |
|
|
workbench.toolSurplus += (workbench.toolNewAdd - workbench.toolConfirme) |
|
|
workbench.toolSurplus += (workbench.toolNewAdd - workbench.toolConfirme) |
|
@ -114,12 +171,35 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
|
|
|
|
|
|
setWorkData({ ...workbench }) |
|
|
setWorkData({ ...workbench }) |
|
|
if (socketData?.notice?.length > 0) { |
|
|
if (socketData?.notice?.length > 0) { |
|
|
|
|
|
socketData?.notice?.map(v => { |
|
|
|
|
|
if (exhibition?.current?.dynamic?.find(v => v.key == 'notice') && pomsList?.map(u => u.pepProjectId)?.includes(v.projectCorrelationId)) { |
|
|
|
|
|
newest.push({ |
|
|
|
|
|
seed: 'notice', |
|
|
|
|
|
time: v.time, |
|
|
|
|
|
project: v.project, |
|
|
|
|
|
userName: v.pepUsers?.map(u => u.name), |
|
|
|
|
|
alarmPushConfig: v.pushConfig?.cfgName, |
|
|
|
|
|
tactics: v.pushConfig?.tactics, |
|
|
|
|
|
interval: v.pushConfig?.tacticsParams?.interval, |
|
|
|
|
|
deviceProportion: v.pushConfig?.tacticsParams?.deviceProportion, |
|
|
|
|
|
id: v.projectCorrelationId, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
newest.sort((a, b) => { |
|
|
|
|
|
if (moment(a.time).isBefore(b.time)) { |
|
|
|
|
|
return 1 |
|
|
|
|
|
} else { |
|
|
|
|
|
return -1 |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
querydata.current = [...newest, ...querydata.current] |
|
|
|
|
|
setQueryData1([...querydata.current]) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, [socketData]) |
|
|
}, [socketData]) |
|
|
|
|
|
console.log(querydata.current); |
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
consoleToollink() |
|
|
consoleToollink() |
|
|
|
|
|
|
|
@ -326,7 +406,7 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
sources: v.alarmInfo?.source, |
|
|
sources: v.alarmInfo?.source, |
|
|
type: v.alarmInfo?.type, |
|
|
type: v.alarmInfo?.type, |
|
|
time: v.confirmTime, |
|
|
time: v.confirmTime, |
|
|
userName: v.userName, |
|
|
userName: v.userName == '自动恢复' ? '' : v.userName, |
|
|
id: v.id, |
|
|
id: v.id, |
|
|
})) |
|
|
})) |
|
|
} |
|
|
} |
|
@ -1198,7 +1278,8 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject |
|
|
if (v.seed == 'discovery') { |
|
|
if (v.seed == 'discovery') { |
|
|
title = v.project + '【' + v.sources + '】' + ',诊断为' + v.type |
|
|
title = v.project + '【' + v.sources + '】' + ',诊断为' + v.type |
|
|
} else if (v.seed == 'confirm') { |
|
|
} else if (v.seed == 'confirm') { |
|
|
title = v.userName + '确认并关闭' + v.project + '【' + v.sources + '】' + v.type + '的问题' |
|
|
title = v.userName ? (v.userName + '确认并关闭' + v.project + '【' + v.sources + '】' + v.type + '的问题') : |
|
|
|
|
|
v.project + '【' + v.sources + '】' + v.type + '已恢复' |
|
|
} else { |
|
|
} else { |
|
|
title = '【信鸽-' + v.alarmPushConfig + '】已邮件通知' + |
|
|
title = '【信鸽-' + v.alarmPushConfig + '】已邮件通知' + |
|
|
v.userName?.map((u, i) => (i > 0 ? ',' + u : u)) + '【' + v.project + '】【' + |
|
|
v.userName?.map((u, i) => (i > 0 ? ',' + u : u)) + '【' + v.project + '】【' + |
|
|