巴林闲侠 2 years ago
parent
commit
560d6eb00c
  1. 4
      api/.vscode/launch.json
  2. 126
      web/client/src/sections/control/containers/control.jsx
  3. 8
      web/client/src/sections/control/containers/control.less

4
api/.vscode/launch.json

@ -16,9 +16,9 @@
"-p 4600", "-p 4600",
"-f http://localhost:4600", "-f http://localhost:4600",
// //
// "-g postgres://postgres:123@10.8.30.32:5432/orational_service", "-g postgres://postgres:123@10.8.30.32:5432/orational_service",
// //
"-g postgres://FashionAdmin:123456@10.8.30.156:5432/POMS", // "-g postgres://FashionAdmin:123456@10.8.30.156:5432/POMS",
"-k 10.8.30.72:29092,10.8.30.73:29092,10.8.30.74:29092", "-k 10.8.30.72:29092,10.8.30.73:29092,10.8.30.74:29092",
"--iotaProxy http://10.8.30.157:17007", "--iotaProxy http://10.8.30.157:17007",
"--redisHost 10.8.30.112", "--redisHost 10.8.30.112",

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

@ -2,7 +2,7 @@ import React, { useEffect, useState, useRef } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Timeline, Card, Button, Modal, Form, Tooltip } from '@douyinfe/semi-ui'; import { Timeline, Card, Button, Modal, Form, Tooltip } from '@douyinfe/semi-ui';
import { push } from 'react-router-redux'; import { push } from 'react-router-redux';
import '../style.less' import './control.less'
import PerfectScrollbar from "perfect-scrollbar"; import PerfectScrollbar from "perfect-scrollbar";
import repairFQA from '../../means/containers/repairFQA'; import repairFQA from '../../means/containers/repairFQA';
import { Setup, OutHidden } from "$components"; import { Setup, OutHidden } from "$components";
@ -16,11 +16,12 @@ let equipmentScrollbar;
let webScrollbar; let webScrollbar;
let problemsScrollbar; let problemsScrollbar;
let alarmScrollbar; let alarmScrollbar;
let pomsListScrollbar
const Control = (props) => { const Control = (props) => {
const { dispatch, actions, user, loading, socket, pepProjectId } = props const { dispatch, actions, user, loading, socket, pepProjectId } = props
const { control } = actions const { control, install } = actions
const [timelineList, setTimelineList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])// const [timelineList, setTimelineList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//
const [memberList, setMemberList] = 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 [query, setQuery] = useState({ limit: 10, page: 0, projectCorrelationId: '', types: '1,2,3,4' }); //
const [querydata, setQueryData] = useState([]); // const [querydata, setQueryData] = useState([]); //
const [long, setLong] = useState(''); // const [long, setLong] = useState(''); //
const [pomsList, setPomsList] = useState([]); //
const [projectId, setProjectId] = useState(''); //id
const exhibition = useRef({ workbench: [], statistical: [] }) // const exhibition = useRef({ workbench: [], statistical: [] }) //
@ -66,7 +69,7 @@ const Control = (props) => {
let a = msg; let a = msg;
}); });
return () => { return () => {
socket.off("alarmSendSocket"); socket.off("alarmSendSocket")
} }
} }
}, [socket]) }, [socket])
@ -83,15 +86,46 @@ const Control = (props) => {
attribute(v) attribute(v)
}) })
}, []) }, [])
useEffect(() => { 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 => { dispatch(control.getConsoleCount({ pepProjectId: pepProjectId })).then(res => {
if (res.success) setWorkData(res.payload.data) 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.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])
@ -102,7 +136,7 @@ const Control = (props) => {
} }
}) })
// --web // --web
dispatch(control.getConsoleUser({ pepId: pepProjectId })).then(res => { dispatch(control.getConsoleUser({ pepId: pepProjectId || projectId })).then(res => {
if (res.success) { if (res.success) {
if (res.payload.data?.personnel?.length > 5) { if (res.payload.data?.personnel?.length > 5) {
setMemberList([...res.payload.data?.personnel, ...res.payload.data?.personnel]) setMemberList([...res.payload.data?.personnel, ...res.payload.data?.personnel])
@ -118,26 +152,11 @@ const Control = (props) => {
} }
} }
}) })
// BI- }, [pepProjectId, projectId])
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])
useEffect(() => { useEffect(() => {
// //
console.log(31116541541);
if (exhibition?.current?.dynamic?.length > 0) { if (exhibition?.current?.dynamic?.length > 0) {
dispatch(control.getLatestDynamic({ ...query, projectCorrelationId: pepProjectId })).then(res => { dispatch(control.getLatestDynamic({ ...query, projectCorrelationId: pepProjectId })).then(res => {
console.log(res.payload.data); 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"); const domProject1 = document.getElementById("overview");
if (domProject1) { if (domProject1) {
overviewScrollbar = new PerfectScrollbar("#overview", { overviewScrollbar = new PerfectScrollbar("#overview", {
@ -305,7 +334,7 @@ const Control = (props) => {
workbench: ['project', 'data', 'app', 'device'], workbench: ['project', 'data', 'app', 'device'],
statistical: ['milestone', 'personnel', 'web', 'problem'], statistical: ['milestone', 'personnel', 'web', 'problem'],
analyse: ['dataInterrupt', 'dataAbnormal', 'policyHit', 'videoException', 'appAbnormal', 'deviceAbnormal', 'problemAnalysis'], analyse: ['dataInterrupt', 'dataAbnormal', 'policyHit', 'videoException', 'appAbnormal', 'deviceAbnormal', 'problemAnalysis'],
dynamic: ['discovery', 'notice', 'handle', 'confirm'], dynamic: ['discovery', 'notice', 'confirm'],
} }
let listAll = [ let listAll = [
@ -359,7 +388,7 @@ const Control = (props) => {
exhibition.current = { ...exhibition.current, [title]: TableDisplay } exhibition.current = { ...exhibition.current, [title]: TableDisplay }
setTableSetup([{ list: data }]) setTableSetup([{ list: data }])
} }
console.log(exhibition.current); console.log(memberList)
return ( return (
<> <>
@ -477,6 +506,18 @@ const Control = (props) => {
{/* 统计概览 */} {/* 统计概览 */}
<div id='overview' style={{ position: 'relative' }}> <div id='overview' style={{ position: 'relative' }}>
<div style={{ display: 'inline-flex', marginTop: 16 }}> <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') ? {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 }}> <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 style={{ fontSize: 14, color: '#969799', marginRight: 4 }}>
立项时间 立项时间
</div> </div>
<div style={{ fontSize: 14, color: '#4A4A4A', width: 104 }}> <div style={{ fontSize: 14, color: '#4A4A4A', width: 104 }} title='项企项目数据为空或未开发'>
2022-5-12 暂无
</div> </div>
</div> </div>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}> <div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}>
施工时间 施工时间
</div> </div>
<div style={{ fontSize: 14, color: '#4A4A4A' }}> <div style={{ fontSize: 14, color: '#4A4A4A' }} title='项企项目数据为空或未开发'>
2022-5-12至2022-12-12 暂无
</div> </div>
</div> </div>
</div> </div>
@ -506,16 +547,16 @@ const Control = (props) => {
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}> <div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}>
内验时间 内验时间
</div> </div>
<div style={{ fontSize: 14, color: '#4A4A4A', width: 104 }}> <div style={{ fontSize: 14, color: '#4A4A4A', width: 104 }} title='项企项目数据为空或未开发'>
2023-1-18 暂无
</div> </div>
</div> </div>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}> <div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}>
外验时间 外验时间
</div> </div>
<div style={{ fontSize: 14, color: '#4A4A4A' }}> <div style={{ fontSize: 14, color: '#4A4A4A' }} title='项企项目数据为空或未开发'>
2023-3-18 暂无
</div> </div>
</div> </div>
</div> </div>
@ -523,8 +564,8 @@ const Control = (props) => {
<div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}> <div style={{ fontSize: 14, color: '#969799', marginRight: 4 }}>
工程维保时间 工程维保时间
</div> </div>
<div style={{ fontSize: 14, color: '#4A4A4A' }}> <div style={{ fontSize: 14, color: '#4A4A4A' }} title='项企项目数据为空或未开发'>
2022-11-11 暂无
</div> </div>
</div> </div>
<div style={{ display: 'flex', background: 'linear-gradient(252deg, #F9FBFF 0%, #DBE7FF 100%)', height: 38, justifyContent: 'space-between' }}> <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 style={{ fontSize: 14, color: '#646566', marginRight: 4 }}>
售后维修时间 售后维修时间
</div> </div>
<div style={{ fontSize: 14, color: '#4A4A4A' }}> <div style={{ fontSize: 14, color: '#4A4A4A' }} title='项企项目数据为空或未开发'>
2022-11-11至2023-12-14 暂无
</div> </div>
</div> </div>
<img src="/assets/images/console/onGoing.png" alt="进行中" /> {/* <img src="/assets/images/console/onGoing.png" alt="进行中" /> */}
</div> </div>
</div> </div>
: ""} : ""}
@ -562,7 +603,11 @@ const Control = (props) => {
</div> </div>
</div> </div>
<div style={{ color: '#969799', fontSize: 14, marginRight: 22 }}> <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>
</div> </div>
) )
@ -884,17 +929,14 @@ const Control = (props) => {
return ( 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'} > <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}> <Tooltip content={title}>
<div style={{ <div className='Tooltip' style={{
width: 170, width: 170,
height: '', height: '',
display: '-webkit-box', display: '-webkit-box',
overflow: 'hidden', overflow: 'hidden',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
webkitLineClamp: 2,
webkitBoxOrient: 'vertical',
color: '', color: '',
background: '', background: '',
}}> }}>
{title} {title}
</div> </div>

8
web/client/src/sections/control/containers/control.less

@ -0,0 +1,8 @@
#news {
.Tooltip {
/*! autoprefixer:off */
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
/*! autoprefixer:on */
}
}
Loading…
Cancel
Save