mcfxkh-Web/src/views/Home/index.js

102 lines
3.3 KiB
JavaScript
Raw Normal View History

2025-06-05 18:01:20 +08:00
import React, { useEffect } from 'react';
import { useSelector, useDispatch } from 'react-redux';
2025-05-19 14:26:18 +08:00
import { TransitionGroup, CSSTransition } from 'react-transition-group';
import './index.less';
import ActionDock from './components/ActionDock';
import Title from './components/Title';
import { getLayout, hidePanels } from '../../models/map/selectors';
import PanelIndex from './PanelIndex';
import MapCtrl from './MapCtrl';
import InfoDlg from './InfoDlg';
import clsx from 'clsx';
import Calculating from './components/Calculating';
2025-06-05 18:01:20 +08:00
import VideoPlayer from './components/VideoCom/index';
2025-05-19 14:26:18 +08:00
//import SocketCtrl from './components/SocketCtrl';
export default function Demo1() {
2025-06-03 17:44:30 +08:00
const dispatch = useDispatch();
2025-05-19 14:26:18 +08:00
const layout = useSelector(getLayout);
const hp = useSelector(hidePanels);
2025-06-03 17:44:30 +08:00
console.log("hp", hp);
2025-05-27 16:35:13 +08:00
const yyRes = useSelector(s => s.runtime.yyObj);
const isSc = useSelector(s => s.runtime.scya);
2025-06-03 17:44:30 +08:00
const wg = useSelector(s => s.runtime.shkshObj)
2025-06-05 18:01:20 +08:00
console.log('wg', wg);
2025-06-03 17:44:30 +08:00
2025-05-19 14:26:18 +08:00
return (
<div className="demo1">
2025-06-03 17:44:30 +08:00
<div style={{ position: 'absolute', left: 0, bottom: 0, right: 0, top: 0, zIndex: 0 }}>
2025-05-19 14:26:18 +08:00
<MapCtrl />
2025-06-03 17:44:30 +08:00
</div>
{
2025-05-26 21:26:20 +08:00
yyRes.yy &&
2025-06-05 18:01:20 +08:00
<VideoPlayer
videoUrl={`${process.env.PUBLIC_URL}/assets/gaoguan.mp4`}
date=""
odd={true}
/>
// <>
// <img src={`${process.env.PUBLIC_URL}/assets/yytc.png`} alt="" style={{ zIndex: 0.1, position: 'absolute' }} />
// <img src={`${process.env.PUBLIC_URL}/assets/yy.png`} alt="" style={{ zIndex: 0.2, position: 'absolute', bottom: 150, left: '32%', width: 700 }} />
// </>
2025-05-27 16:35:13 +08:00
}
2025-06-03 17:44:30 +08:00
2025-05-27 16:35:13 +08:00
{
2025-06-03 17:44:30 +08:00
isSc && <img src={`${process.env.PUBLIC_URL}/assets/scdd.jpg`} alt="" style={{ zIndex: 0.1, position: 'absolute', width: '100%' }} />
2025-05-27 16:35:13 +08:00
}
2025-06-03 17:44:30 +08:00
2025-05-19 14:26:18 +08:00
<div className="bottom">
<ActionDock />
</div>
{
!hp && (
<TransitionGroup className={clsx('left', 'dp-panel-container', layout.leftFullHeight && 'fullheight')}>
{
layout.left.map(({ key, ...params }) => (
<CSSTransition key={key} unmountOnExit exit={false} timeout={500} classNames="dp-panelgroup">
<PanelIndex name={key} {...params} />
</CSSTransition>
))
}
</TransitionGroup>
)
}
<div className="center">
<Title />
</div>
{
!hp && (
<TransitionGroup className={clsx('right', 'dp-panel-container', layout.rightFullHeight && 'fullheight')}>
{
2025-06-03 17:44:30 +08:00
layout.right.map(({ key, ...params }) => {
if (key != '网格') {
return (
<CSSTransition key={key} unmountOnExit exit={false} timeout={500} classNames="dp-panelgroup">
<PanelIndex name={key} {...params} />
</CSSTransition>
)
2025-06-05 18:01:20 +08:00
} else if (wg) {
return (
2025-06-03 17:44:30 +08:00
<CSSTransition key={key} unmountOnExit exit={false} timeout={500} classNames="dp-panelgroup">
<PanelIndex name={key} {...params} />
</CSSTransition>
)
}
}
)
2025-05-19 14:26:18 +08:00
}
</TransitionGroup>
)
}
<InfoDlg />
<Calculating />
</div>
)
}