wenlele 2 years ago
parent
commit
57b1dd5e23
  1. 231
      web/client/src/sections/control/containers/control.jsx

231
web/client/src/sections/control/containers/control.jsx

@ -85,135 +85,142 @@ const Control = (props) => {
: "" : ""
attribute(v) attribute(v)
}) })
// dispatch(install.getProjectPoms({ global: 1 })).then((res) => { // async function concentration2 () {
// if (res.success) { await dispatch(install.getProjectPoms({ global: 1 })).then((res) => { //
// let data = res.payload.data?.rows?.filter(v => v.pepProjectIsDelete !== 1)?.map(v => ({ pepProjectId: v.id, pepProjectName: v.pepProjectName || v.name })) if (res.success) {
// setPomsList(data) let data = res.payload.data?.rows?.filter(v => v.pepProjectIsDelete !== 1)?.map(v => ({ pepProjectId: v.id, pepProjectName: v.pepProjectName || v.name }))
// setProjectId(data[0]?.pepProjectId) setPomsList(data)
// } setProjectId(data[0]?.pepProjectId)
// }) }
})
}
concentration2()
return () => { return () => {
} }
}, []) }, [])
useEffect(() => { useEffect(() => {
async function csz () { async function concentration1 () {
if (pepProjectId) setProjectId(pepProjectId) if (pepProjectId) setProjectId(pepProjectId)
if (!projectId) { if (!projectId) {
// //
// await dispatch(control.getConsoleCount({ pepProjectId: pepProjectId })).then(res => { await dispatch(control.getConsoleCount({ pepProjectId: pepProjectId })).then(res => {
// if (res.success) setWorkData(res.payload.data) if (res.success) setWorkData(res.payload.data)
// }) })
// BI- // BI-
// dispatch(control.getDataAlarmsAggDay({ pepProjectId: pepProjectId })).then(res => { await dispatch(control.getDataAlarmsAggDay({ pepProjectId: pepProjectId })).then(res => {
// if (res.success) setDataBI(res.payload.data) if (res.success) setDataBI(res.payload.data)
// }) })
// BI- // BI-
// dispatch(control.getVideoAlarmsAggDay({ pepProjectId: pepProjectId })).then(res => { await dispatch(control.getVideoAlarmsAggDay({ pepProjectId: pepProjectId })).then(res => {
// if (res.success) setVideoBI(res.payload.data) if (res.success) setVideoBI(res.payload.data)
// }) })
// BI- // BI-
// dispatch(control.getAppAlarmsAggDay({ pepProjectId: pepProjectId })).then(res => { await dispatch(control.getAppAlarmsAggDay({ pepProjectId: pepProjectId })).then(res => {
// if (res.success) setAppBI(res.payload.data) if (res.success) setAppBI(res.payload.data)
// }) })
// dispatch(control.getAlarmsHandleStatistics({ pepProjectId: pepProjectId })).then(res => { await dispatch(control.getAlarmsHandleStatistics({ pepProjectId: pepProjectId })).then(res => {
// if (res.success) setEfficiencyBI(res.payload.data[0]) if (res.success) setEfficiencyBI(res.payload.data[0])
// }) })
} }
// --& // --&
// await dispatch(control.getConsoleAbnormal({ pepProjectId: pepProjectId || projectId })).then(res => { await dispatch(control.getConsoleAbnormal({ pepProjectId: pepProjectId || projectId })).then(res => {
// if (res.success) { if (res.success) {
// if (res.payload.data?.length > 4) { if (res.payload.data?.length > 4) {
// setProblemsList([...res.payload.data, ...res.payload.data]) setProblemsList([...res.payload.data, ...res.payload.data])
// startmarquee('problems') startmarquee('problems')
// } else { } else {
// setProblemsList(res.payload.data) setProblemsList(res.payload.data)
// } }
// } }
// }) })
// --web
await dispatch(control.getConsoleUser({ pepId: pepProjectId || projectId })).then(res => {
if (res.success) {
if (res.payload.data?.personnel?.length > 5) {
setMemberList([...res.payload.data?.personnel, ...res.payload.data?.personnel])
startmarquee('member')
} else {
setMemberList(res.payload.data?.personnel)
}
if (res.payload.data?.webApp?.length > 3) {
setWebList([...res.payload.data?.webApp, ...res.payload.data?.webApp])
startmarquee('web')
} else {
setWebList(res.payload.data?.webApp)
}
}
})
} }
csz() concentration1()
// --web
// dispatch(control.getConsoleUser({ pepId: pepProjectId || projectId })).then(res => {
// if (res.success) {
// if (res.payload.data?.personnel?.length > 5) {
// setMemberList([...res.payload.data?.personnel, ...res.payload.data?.personnel])
// startmarquee('member')
// } else {
// setMemberList(res.payload.data?.personnel)
// }
// if (res.payload.data?.webApp?.length > 3) {
// setWebList([...res.payload.data?.webApp, ...res.payload.data?.webApp])
// startmarquee('web')
// } else {
// setWebList(res.payload.data?.webApp)
// }
// }
// })
}, [pepProjectId, projectId]) }, [pepProjectId, projectId])
// console.log(exhibition?.current?.dynamic); // console.log(exhibition?.current?.dynamic);
useEffect(() => { useEffect(() => {
// //
// if (exhibition?.current?.dynamic?.length > 0) { async function concentration3 () {
// console.log(query?.page); if (exhibition?.current?.dynamic?.length > 0) {
// dispatch(control.getLatestDynamic({ ...query, projectCorrelationId: pepProjectId })).then(res => { console.log(query?.page);
// // console.log(res.payload.data); await dispatch(control.getLatestDynamic({ ...query, projectCorrelationId: pepProjectId })).then(res => {
// if (res.payload.data?.appear?.length || 0 + res.payload.data?.confirm?.length + res.payload.data?.notice?.length < 10) setASk(false) // console.log(res.payload.data);
// let data = [] if (res.payload.data?.appear?.length || 0 + res.payload.data?.confirm?.length + res.payload.data?.notice?.length < 10) setASk(false)
// if (res.success) { let data = []
// if (exhibition?.current?.dynamic?.find(v => v.key == 'discovery')) { if (res.success) {
// res.payload.data?.appear?.map(v => data.push({ if (exhibition?.current?.dynamic?.find(v => v.key == 'discovery')) {
// seed: 'discovery', res.payload.data?.appear?.map(v => data.push({
// project: v.projectName, seed: 'discovery',
// sources: v.alarmInfo?.sourceName, project: v.projectName,
// type: v.type, sources: v.alarmInfo?.sourceName,
// time: v.time, type: v.type,
// id: v.id, time: v.time,
// })) id: v.id,
// } }))
// if (exhibition?.current?.dynamic?.find(v => v.key == 'confirm')) { }
// res.payload.data?.confirm?.map(v => data.push({ if (exhibition?.current?.dynamic?.find(v => v.key == 'confirm')) {
// seed: 'confirm', res.payload.data?.confirm?.map(v => data.push({
// project: v.projectName, seed: 'confirm',
// sources: v.alarmInfo?.source, project: v.projectName,
// type: v.alarmInfo?.type, sources: v.alarmInfo?.source,
// time: v.confirmTime, type: v.alarmInfo?.type,
// userName: v.userName, time: v.confirmTime,
// id: v.id, userName: v.userName,
// })) id: v.id,
// } }))
// if (exhibition?.current?.dynamic?.find(v => v.key == 'notice')) { }
// res.payload.data?.notice?.map(v => data.push({ if (exhibition?.current?.dynamic?.find(v => v.key == 'notice')) {
// seed: 'notice', res.payload.data?.notice?.map(v => data.push({
// time: v.time, seed: 'notice',
// project: v.projectName, time: v.time,
// userName: v.userName?.map(u => u.name), project: v.projectName,
// alarmPushConfig: v.alarmPushConfig?.name, userName: v.userName?.map(u => u.name),
// tactics: v.tactics, alarmPushConfig: v.alarmPushConfig?.name,
// interval: v.tacticsParams?.interval, tactics: v.tactics,
// deviceProportion: v.tacticsParams?.deviceProportion, interval: v.tacticsParams?.interval,
// id: v.id, deviceProportion: v.tacticsParams?.deviceProportion,
// })) id: v.id,
// } }))
// data.sort((a, b) => { }
// if (moment(a.time).isBefore(b.time)) { data.sort((a, b) => {
// return 1 if (moment(a.time).isBefore(b.time)) {
// } else { return 1
// return -1 } else {
// } return -1
// }) }
// console.log(data) })
// querydata.current = data console.log(data)
// setQueryData1(data) querydata.current = data
// } setQueryData1(data)
// }) }
// } })
}
}
concentration3()
}, [pepProjectId, exhibition.current]) }, [pepProjectId, exhibition.current])
useEffect(() => { useEffect(() => {
@ -370,9 +377,9 @@ const Control = (props) => {
}) })
const consoleToollink = () => { const consoleToollink = () => {
// dispatch(control.getConsoleToollink()).then(res => { dispatch(control.getConsoleToollink()).then(res => {
// if (res.success) setToolShow(res.payload.data) if (res.success) setToolShow(res.payload.data)
// }) })
} }
// //

Loading…
Cancel
Save