Browse Source

feat:进入大屏默认领导仓

master
zhaobing 1 year ago
parent
commit
5a96c577e3
  1. 12
      web-screen/client/src/layout/components/header/index.js
  2. 2
      web-screen/client/src/layout/reducers/tab.js
  3. 14
      web-screen/client/src/sections/bigScreen/components/run/right.js
  4. 2
      web-screen/client/src/utils/webapi.js

12
web-screen/client/src/layout/components/header/index.js

@ -28,7 +28,7 @@ const Header = props => {
const [patrolManageVisible, setPatrolManageVisible] = useState(false) const [patrolManageVisible, setPatrolManageVisible] = useState(false)
const [deviceManageTabsVisible, setDeviceManageTabsVisible] = useState(false) const [deviceManageTabsVisible, setDeviceManageTabsVisible] = useState(false)
const [currentSubMenuTab, setCurrentSubMenuTab] = useState('') const [currentSubMenuTab, setCurrentSubMenuTab] = useState('')
const [tab, setTab] = useState('run') const [tab, setTab] = useState('leader')
const [weather, setWeather] = useState([]) const [weather, setWeather] = useState([])
let headerTitleStyle = { let headerTitleStyle = {
position: 'absolute', position: 'absolute',
@ -61,11 +61,11 @@ const Header = props => {
}, []) }, [])
const queryWeather = () => { const queryWeather = () => {
// RouteRequest.get(`/query/weather/3d?location=101240101`).then(res => { RouteRequest.get(`/query/weather/3d?location=101240101`).then(res => {
// if (res?.daily?.length === 3) { if (res?.daily?.length === 3) {
// setWeather(res.daily) setWeather(res.daily)
// } }
// }) })
} }
const iconSrc = useMemo(() => { const iconSrc = useMemo(() => {

2
web-screen/client/src/layout/reducers/tab.js

@ -3,7 +3,7 @@
import Immutable from 'immutable'; import Immutable from 'immutable';
const initState = { const initState = {
tab: 'run', tab: 'leader',
showCG: true showCG: true
}; };

14
web-screen/client/src/sections/bigScreen/components/run/right.js

@ -131,7 +131,7 @@ const Right = (props) => {
}, [deployPoints]) }, [deployPoints])
useEffect(() => { useEffect(() => {
const structArr = JSON.parse(sessionStorage.getItem('user')).monitorObject const structArr = JSON.parse(sessionStorage.getItem('user')).monitorObject
dispatch(bigScreen.getProjectGraph({ projectId: structArr.toString(), subType })).then(_ => { dispatch(bigScreen.getProjectGraph({ projectId: [...structArr].toString(), subType })).then(_ => {
if (_.success) { if (_.success) {
let graph = _.payload.data let graph = _.payload.data
setGraph(graph) setGraph(graph)
@ -315,14 +315,17 @@ const Right = (props) => {
{graph?.length ? graph.map(item => (item?.projectGraphs.length ? {graph?.length ? graph.map(item => (item?.projectGraphs.length ?
<div style={{ <div style={{
width: '88.6594rem', height: '33.5rem', objectFit: 'cover', position: 'relative', width: '88.6594rem', height: '33.5rem', objectFit: 'cover', position: 'relative',
background: `url('/_file-server/${item?.projectGraphs[0]?.graph}') no-repeat`, background: `url('https://inspection.anxinyun.cn/_file-server/${item?.projectGraphs[0]?.graph}') no-repeat`,
backgroundSize: '100% 100%' backgroundSize: '100% 100%'
}} > }} >
{ {
deployPoints.length ? deployPoints.map(item => ( deployPoints.length ? deployPoints.map(item => (
<div style={{ position: 'absolute', top: JSON.parse(item.position).relativeY * 33.5 + 'rem',
// 33.5*JSON.parse(item.position).relativeY+'rem',
left: JSON.parse(item.position).relativeX * 88.6594 + 'rem',}}>
<Popover content={ <Popover content={
( (
<div> <div >
<div>{moment(points.find(i => i.point_id === item.pointId)?.inspectTime).format('YYYY-MM-DD HH:mm:ss') + '巡检发现异常'}</div> <div>{moment(points.find(i => i.point_id === item.pointId)?.inspectTime).format('YYYY-MM-DD HH:mm:ss') + '巡检发现异常'}</div>
<div>进度:{renderOptionText(points.find(i => i.point_id === item.pointId)?.state)}</div> <div>进度:{renderOptionText(points.find(i => i.point_id === item.pointId)?.state)}</div>
{/* <div>{}</div> */} {/* <div>{}</div> */}
@ -335,12 +338,11 @@ const Right = (props) => {
}> <div style={{ }> <div style={{
width: '.875rem', height: '.875rem', borderRadius: '100%', width: '.875rem', height: '.875rem', borderRadius: '100%',
boxShadow: 'rgb(16, 142, 233) 0px 0px 10px', boxShadow: 'rgb(16, 142, 233) 0px 0px 10px',
position: 'absolute', top: (clientHeight / 1.3) * JSON.parse(item.position).relativeY / JSON.parse(item.position).screenHeight + 'rem',
// 33.5*JSON.parse(item.position).relativeY+'rem',
left: (clientWidth / 1.3) * JSON.parse(item.position).relativeX / JSON.parse(item.position).screenWidth + 'rem',
zIndex: 999999, zIndex: 999999,
backgroundColor: points.find(i => i.point_id === item.pointId)?.alarm ? 'rgb(233 16 16)' : 'rgb(16, 142, 233)', backgroundColor: points.find(i => i.point_id === item.pointId)?.alarm ? 'rgb(233 16 16)' : 'rgb(16, 142, 233)',
}}></div></Popover> }}></div></Popover>
</div>
)) : "" )) : ""
} }
{deployPoints.length ? {deployPoints.length ?

2
web-screen/client/src/utils/webapi.js

@ -172,7 +172,7 @@ export const ApiTable = {
//领导仓 //领导仓
findPatrolRecords:'bigScreen/patrolRecord', findPatrolRecords:'bigScreen/patrolRecord',
findPatrolRate:'bigScreen/getDeployPoints', findPatrolRate:'bigScreen/patrolRate',
countByProject:'bigScreen/patrolCount', countByProject:'bigScreen/patrolCount',
getDevices:'bigScreen/devices/guarantee', getDevices:'bigScreen/devices/guarantee',
getHistoricalFaults:'bigScreen/historicalFaults', getHistoricalFaults:'bigScreen/historicalFaults',

Loading…
Cancel
Save