|
|
@ -2,7 +2,7 @@ import React, { useEffect, useState, useRef } from 'react'; |
|
|
|
import { connect } from 'react-redux'; |
|
|
|
import { Timeline, Card, Button, Modal, Form, Tooltip } from '@douyinfe/semi-ui'; |
|
|
|
import { push } from 'react-router-redux'; |
|
|
|
import '../style.less' |
|
|
|
import './control.less' |
|
|
|
import PerfectScrollbar from "perfect-scrollbar"; |
|
|
|
import repairFQA from '../../means/containers/repairFQA'; |
|
|
|
import { Setup, OutHidden } from "$components"; |
|
|
@ -16,11 +16,12 @@ let equipmentScrollbar; |
|
|
|
let webScrollbar; |
|
|
|
let problemsScrollbar; |
|
|
|
let alarmScrollbar; |
|
|
|
let pomsListScrollbar |
|
|
|
|
|
|
|
|
|
|
|
const Control = (props) => { |
|
|
|
const { dispatch, actions, user, loading, socket, pepProjectId } = props |
|
|
|
const { control } = actions |
|
|
|
const { control, install } = actions |
|
|
|
const [timelineList, setTimelineList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//最新动态列表 |
|
|
|
|
|
|
|
const [memberList, setMemberList] = useState([])//相关成员列表 |
|
|
@ -45,6 +46,8 @@ const Control = (props) => { |
|
|
|
const [query, setQuery] = useState({ limit: 10, page: 0, projectCorrelationId: '', types: '1,2,3,4' }); //最新动态 |
|
|
|
const [querydata, setQueryData] = useState([]); //最新动态数据 |
|
|
|
const [long, setLong] = useState(''); //最新动态设置 |
|
|
|
const [pomsList, setPomsList] = useState([]); //项目 |
|
|
|
const [projectId, setProjectId] = useState(''); //项目id |
|
|
|
|
|
|
|
|
|
|
|
const exhibition = useRef({ workbench: [], statistical: [] }) //页面结构 |
|
|
@ -66,7 +69,7 @@ const Control = (props) => { |
|
|
|
let a = msg; |
|
|
|
}); |
|
|
|
return () => { |
|
|
|
socket.off("alarmSendSocket"); |
|
|
|
socket.off("alarmSendSocket") |
|
|
|
} |
|
|
|
} |
|
|
|
}, [socket]) |
|
|
@ -83,15 +86,46 @@ const Control = (props) => { |
|
|
|
attribute(v) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, []) |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
if (pepProjectId) setProjectId('') |
|
|
|
if (!pepProjectId) { |
|
|
|
dispatch(install.getProjectPoms({ global: 1 })).then((res) => { //获取已绑定项目 |
|
|
|
if (res.success) { |
|
|
|
let data = res.payload.data?.rows?.filter(v => v.pepProjectIsDelete !== 1)?.map(v => ({ pepProjectId: v.id, pepProjectName: v.pepProjectName || v.name })) |
|
|
|
setPomsList(data) |
|
|
|
setProjectId(data[0]?.pepProjectId) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
if (!projectId) { |
|
|
|
// 工作台数据请求 |
|
|
|
dispatch(control.getConsoleCount({ pepProjectId: pepProjectId })).then(res => { |
|
|
|
if (res.success) setWorkData(res.payload.data) |
|
|
|
}) |
|
|
|
|
|
|
|
// 查询BI分析数据-数据 |
|
|
|
dispatch(control.getDataAlarmsAggDay({ pepProjectId: pepProjectId })).then(res => { |
|
|
|
if (res.success) setDataBI(res.payload.data) |
|
|
|
}) |
|
|
|
//查询BI分析数据-视频异常 |
|
|
|
dispatch(control.getVideoAlarmsAggDay({ pepProjectId: pepProjectId })).then(res => { |
|
|
|
if (res.success) setVideoBI(res.payload.data) |
|
|
|
}) |
|
|
|
//查询BI分析数据-应用 |
|
|
|
dispatch(control.getAppAlarmsAggDay({ pepProjectId: pepProjectId })).then(res => { |
|
|
|
if (res.success) setAppBI(res.payload.data) |
|
|
|
}) |
|
|
|
dispatch(control.getAlarmsHandleStatistics({ pepProjectId: pepProjectId })).then(res => { |
|
|
|
if (res.success) setEfficiencyBI(res.payload.data[0]) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 统计概览--异常&问题 |
|
|
|
dispatch(control.getConsoleAbnormal({ pepProjectId: pepProjectId })).then(res => { |
|
|
|
dispatch(control.getConsoleAbnormal({ pepProjectId: pepProjectId || projectId })).then(res => { |
|
|
|
if (res.success) { |
|
|
|
if (res.payload.data?.length > 4) { |
|
|
|
setProblemsList([...res.payload.data, ...res.payload.data]) |
|
|
@ -102,7 +136,7 @@ const Control = (props) => { |
|
|
|
} |
|
|
|
}) |
|
|
|
// 统计概览--相关成员与web应用 |
|
|
|
dispatch(control.getConsoleUser({ pepId: pepProjectId })).then(res => { |
|
|
|
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]) |
|
|
@ -118,26 +152,11 @@ const Control = (props) => { |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
// 查询BI分析数据-数据 |
|
|
|
dispatch(control.getDataAlarmsAggDay({ pepProjectId: pepProjectId })).then(res => { |
|
|
|
if (res.success) setDataBI(res.payload.data) |
|
|
|
}) |
|
|
|
//查询BI分析数据-视频异常 |
|
|
|
dispatch(control.getVideoAlarmsAggDay({ pepProjectId: pepProjectId })).then(res => { |
|
|
|
if (res.success) setVideoBI(res.payload.data) |
|
|
|
}) |
|
|
|
//查询BI分析数据-应用 |
|
|
|
dispatch(control.getAppAlarmsAggDay({ pepProjectId: pepProjectId })).then(res => { |
|
|
|
if (res.success) setAppBI(res.payload.data) |
|
|
|
}) |
|
|
|
dispatch(control.getAlarmsHandleStatistics({ pepProjectId: pepProjectId })).then(res => { |
|
|
|
if (res.success) setEfficiencyBI(res.payload.data[0]) |
|
|
|
}) |
|
|
|
}, [pepProjectId]) |
|
|
|
}, [pepProjectId, projectId]) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
//查询最新动态 |
|
|
|
console.log(31116541541); |
|
|
|
if (exhibition?.current?.dynamic?.length > 0) { |
|
|
|
dispatch(control.getLatestDynamic({ ...query, projectCorrelationId: pepProjectId })).then(res => { |
|
|
|
console.log(res.payload.data); |
|
|
@ -192,6 +211,16 @@ const Control = (props) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const pomsList = document.getElementById("pomsList"); |
|
|
|
if (pomsList) { |
|
|
|
pomsListScrollbar = new PerfectScrollbar("#pomsList", { |
|
|
|
suppressScrollX: true, |
|
|
|
}); |
|
|
|
if (pomsList && pomsListScrollbar) { |
|
|
|
pomsListScrollbar.update(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const domProject1 = document.getElementById("overview"); |
|
|
|
if (domProject1) { |
|
|
|
overviewScrollbar = new PerfectScrollbar("#overview", { |
|
|
@ -305,7 +334,7 @@ const Control = (props) => { |
|
|
|
workbench: ['project', 'data', 'app', 'device'], |
|
|
|
statistical: ['milestone', 'personnel', 'web', 'problem'], |
|
|
|
analyse: ['dataInterrupt', 'dataAbnormal', 'policyHit', 'videoException', 'appAbnormal', 'deviceAbnormal', 'problemAnalysis'], |
|
|
|
dynamic: ['discovery', 'notice', 'handle', 'confirm'], |
|
|
|
dynamic: ['discovery', 'notice', 'confirm'], |
|
|
|
} |
|
|
|
|
|
|
|
let listAll = [ |
|
|
@ -359,7 +388,7 @@ const Control = (props) => { |
|
|
|
exhibition.current = { ...exhibition.current, [title]: TableDisplay } |
|
|
|
setTableSetup([{ list: data }]) |
|
|
|
} |
|
|
|
console.log(exhibition.current); |
|
|
|
console.log(memberList) |
|
|
|
|
|
|
|
return ( |
|
|
|
<> |
|
|
@ -477,6 +506,18 @@ const Control = (props) => { |
|
|
|
{/* 统计概览 */} |
|
|
|
<div id='overview' style={{ position: 'relative' }}> |
|
|
|
<div style={{ display: 'inline-flex', marginTop: 16 }}> |
|
|
|
{/* 项目 */} |
|
|
|
{pepProjectId ? '' : <div id='pomsList' style={{ marginRight: 20, paddingRight: 24, position: 'relative', marginBottom: 30, width: 410, height: 221, border: '1px solid rgba(220,222,224,0.2)', boxShadow: '0px 2px 12px 1px #F2F3F5', borderRadius: 2 }}> |
|
|
|
{pomsList?.map((v, index) => { |
|
|
|
return <div key={'pomsList' + index} title={v.pepProjectName} |
|
|
|
style={{ |
|
|
|
width: 400, lineHeight: '30px', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', fontSize: 14, color: '#969799', |
|
|
|
background: projectId == v.pepProjectId ? 'linear-gradient(252deg, #F9FBFF 0%, rgb(185 202 236) 100%)' : "", |
|
|
|
}} |
|
|
|
onClick={() => setProjectId(v.pepProjectId)}>{v.pepProjectName}</div> |
|
|
|
})} |
|
|
|
</div>} |
|
|
|
|
|
|
|
{/* 项目里程碑 */} |
|
|
|
{exhibition.current?.statistical?.find(v => v.key == 'milestone') ? |
|
|
|
<div style={{ marginBottom: 30, width: 466, height: 221, border: '1px solid rgba(220,222,224,0.2)', boxShadow: '0px 2px 12px 1px #F2F3F5', borderRadius: 2 }}> |
|
|
@ -488,16 +529,16 @@ const Control = (props) => { |
|
|
|
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}> |
|
|
|
立项时间: |
|
|
|
</div> |
|
|
|
<div style={{ fontSize: 14, color: '#4A4A4A', width: 104 }}> |
|
|
|
2022-5-12 |
|
|
|
<div style={{ fontSize: 14, color: '#4A4A4A', width: 104 }} title='项企项目数据为空或未开发'> |
|
|
|
暂无 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style={{ display: 'flex' }}> |
|
|
|
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}> |
|
|
|
施工时间: |
|
|
|
</div> |
|
|
|
<div style={{ fontSize: 14, color: '#4A4A4A' }}> |
|
|
|
2022-5-12至2022-12-12 |
|
|
|
<div style={{ fontSize: 14, color: '#4A4A4A' }} title='项企项目数据为空或未开发'> |
|
|
|
暂无 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -506,16 +547,16 @@ const Control = (props) => { |
|
|
|
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}> |
|
|
|
内验时间: |
|
|
|
</div> |
|
|
|
<div style={{ fontSize: 14, color: '#4A4A4A', width: 104 }}> |
|
|
|
2023-1-18 |
|
|
|
<div style={{ fontSize: 14, color: '#4A4A4A', width: 104 }} title='项企项目数据为空或未开发'> |
|
|
|
暂无 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style={{ display: 'flex' }}> |
|
|
|
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}> |
|
|
|
外验时间: |
|
|
|
</div> |
|
|
|
<div style={{ fontSize: 14, color: '#4A4A4A' }}> |
|
|
|
2023-3-18 |
|
|
|
<div style={{ fontSize: 14, color: '#4A4A4A' }} title='项企项目数据为空或未开发'> |
|
|
|
暂无 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -523,8 +564,8 @@ const Control = (props) => { |
|
|
|
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}> |
|
|
|
工程维保时间: |
|
|
|
</div> |
|
|
|
<div style={{ fontSize: 14, color: '#4A4A4A' }}> |
|
|
|
2022-11-11 |
|
|
|
<div style={{ fontSize: 14, color: '#4A4A4A' }} title='项企项目数据为空或未开发'> |
|
|
|
暂无 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style={{ display: 'flex', background: 'linear-gradient(252deg, #F9FBFF 0%, #DBE7FF 100%)', height: 38, justifyContent: 'space-between' }}> |
|
|
@ -532,11 +573,11 @@ const Control = (props) => { |
|
|
|
<div style={{ fontSize: 14, color: '#646566', marginRight: 4 }}> |
|
|
|
售后维修时间: |
|
|
|
</div> |
|
|
|
<div style={{ fontSize: 14, color: '#4A4A4A' }}> |
|
|
|
2022-11-11至2023-12-14 |
|
|
|
<div style={{ fontSize: 14, color: '#4A4A4A' }} title='项企项目数据为空或未开发'> |
|
|
|
暂无 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<img src="/assets/images/console/onGoing.png" alt="进行中" /> |
|
|
|
{/* <img src="/assets/images/console/onGoing.png" alt="进行中" /> */} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
: ""} |
|
|
@ -562,7 +603,11 @@ const Control = (props) => { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style={{ color: '#969799', fontSize: 14, marginRight: 22 }}> |
|
|
|
行业服务部 |
|
|
|
<Tooltip content={item.department?.map((v, index) => index > 0 ? ',' + v : v)}> |
|
|
|
<div className='Tooltip' style={{}}> |
|
|
|
{item.department[0]} |
|
|
|
</div> |
|
|
|
</Tooltip> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) |
|
|
@ -884,17 +929,14 @@ const Control = (props) => { |
|
|
|
return ( |
|
|
|
<Timeline.Item key={index + 'time'} position='left' time={moment(v.time).format("YYYY-MM-DD HH:mm:ss")} className={index % 2 == 0 ? 'even' : 'odd'} > |
|
|
|
<Tooltip content={title}> |
|
|
|
<div style={{ |
|
|
|
<div className='Tooltip' style={{ |
|
|
|
width: 170, |
|
|
|
height: '', |
|
|
|
display: '-webkit-box', |
|
|
|
overflow: 'hidden', |
|
|
|
textOverflow: 'ellipsis', |
|
|
|
webkitLineClamp: 2, |
|
|
|
webkitBoxOrient: 'vertical', |
|
|
|
color: '', |
|
|
|
background: '', |
|
|
|
|
|
|
|
}}> |
|
|
|
{title} |
|
|
|
</div> |
|
|
|