优化 全屏功能
This commit is contained in:
4
env.js
4
env.js
@@ -23,9 +23,9 @@ const envConfig = {
|
|||||||
},
|
},
|
||||||
[ENV.PROD]: {
|
[ENV.PROD]: {
|
||||||
//baseURL: 'https://pvcloudservice.satabot.com',
|
//baseURL: 'https://pvcloudservice.satabot.com',
|
||||||
baseURL: 'http://1.95.137.212:8081',//http://192.168.2.56:8081
|
baseURL: 'http://1.95.137.212:59015',//http://192.168.2.56:8081
|
||||||
//baseURL: 'https://serviceri.satabot.com',
|
//baseURL: 'https://serviceri.satabot.com',
|
||||||
WS_URL: 'ws://1.95.137.212:9001/ws/',
|
WS_URL: 'ws://1.95.137.212:59017/ws/',
|
||||||
mqtt_url: "ws://1.95.137.212:59021/mqtt",
|
mqtt_url: "ws://1.95.137.212:59021/mqtt",
|
||||||
geoserver_url: "http://1.95.137.212:59018/geoserver"
|
geoserver_url: "http://1.95.137.212:59018/geoserver"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ import zhCN from 'antd/locale/zh_CN';
|
|||||||
import {
|
import {
|
||||||
DashboardOutlined, ExperimentOutlined, VideoCameraOutlined,
|
DashboardOutlined, ExperimentOutlined, VideoCameraOutlined,
|
||||||
BellOutlined, UserOutlined, LogoutOutlined,
|
BellOutlined, UserOutlined, LogoutOutlined,
|
||||||
AppstoreOutlined, SettingOutlined, MenuUnfoldOutlined, MenuFoldOutlined
|
AppstoreOutlined, SettingOutlined, MenuUnfoldOutlined, MenuFoldOutlined,
|
||||||
|
CompressOutlined,
|
||||||
|
ExpandOutlined
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import logo from '../assets/logo.png';
|
import logo from '../assets/logo.png';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
@@ -25,6 +27,8 @@ export default function AppLayout() {
|
|||||||
const [time, setTime] = useState(new Date().toLocaleString());
|
const [time, setTime] = useState(new Date().toLocaleString());
|
||||||
const [menuList, setMenuList] = useState([]);
|
const [menuList, setMenuList] = useState([]);
|
||||||
const [stationList, setStationList] = useState([]);
|
const [stationList, setStationList] = useState([]);
|
||||||
|
const [isFullScreen, setIsFullScreen] = useState(false); // 新增全屏标识
|
||||||
|
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
@@ -49,6 +53,17 @@ export default function AppLayout() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const toggleFullScreen = () => {
|
||||||
|
if (!document.fullscreenElement) {
|
||||||
|
document.documentElement.requestFullscreen();
|
||||||
|
setIsFullScreen(true);
|
||||||
|
} else {
|
||||||
|
if (document.exitFullscreen) {
|
||||||
|
document.exitFullscreen();
|
||||||
|
setIsFullScreen(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const handleStationChange = (id: number) => {
|
const handleStationChange = (id: number) => {
|
||||||
const station = stationList.find(s => s.id === id);
|
const station = stationList.find(s => s.id === id);
|
||||||
@@ -98,6 +113,14 @@ export default function AppLayout() {
|
|||||||
return () => clearInterval(timer);
|
return () => clearInterval(timer);
|
||||||
}, [userInfo]);
|
}, [userInfo]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const fullscreenChange = () => {
|
||||||
|
setIsFullScreen(!!document.fullscreenElement);
|
||||||
|
};
|
||||||
|
document.addEventListener('fullscreenchange', fullscreenChange);
|
||||||
|
return () => document.removeEventListener('fullscreenchange', fullscreenChange);
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ConfigProvider
|
<ConfigProvider
|
||||||
locale={zhCN}
|
locale={zhCN}
|
||||||
@@ -182,6 +205,14 @@ export default function AppLayout() {
|
|||||||
</Space>
|
</Space>
|
||||||
|
|
||||||
<Space size="middle" style={{ flexWrap: 'wrap' }}>
|
<Space size="middle" style={{ flexWrap: 'wrap' }}>
|
||||||
|
<Button
|
||||||
|
type="text"
|
||||||
|
icon={isFullScreen ? <CompressOutlined /> : <ExpandOutlined />}
|
||||||
|
onClick={toggleFullScreen}
|
||||||
|
style={{ color: '#fff', fontSize: 'clamp(12px, 1vw, 14px)' }}
|
||||||
|
>
|
||||||
|
{isFullScreen ? '退出全屏' : '全屏'}
|
||||||
|
</Button>
|
||||||
<span style={{ fontSize: 'clamp(12px, 1vw, 13px)' }}>{time}</span>
|
<span style={{ fontSize: 'clamp(12px, 1vw, 13px)' }}>{time}</span>
|
||||||
<Space
|
<Space
|
||||||
style={{ cursor: 'pointer', padding: '0 4px' }}
|
style={{ cursor: 'pointer', padding: '0 4px' }}
|
||||||
|
|||||||
@@ -839,19 +839,16 @@ export default function CesiumMap({ ifClear, ifClearPlanLine, ifClearNavLine, fi
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(22222222222)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const point = { lng: finishPoint.lng, lat: finishPoint.lat };
|
const point = { lng: finishPoint.lng, lat: finishPoint.lat };
|
||||||
console.log(isNavigationModeRef.current, drawRealTime, 8888888888)
|
|
||||||
|
|
||||||
// 如果是定位模式且还没有导航模式,则切换到导航模式
|
// 如果是定位模式且还没有导航模式,则切换到导航模式
|
||||||
if (!isNavigationModeRef.current && drawRealTime) {
|
if (!isNavigationModeRef.current && drawRealTime) {
|
||||||
tracePointRef.current.setMode(TPMode.NAVIGATION);
|
tracePointRef.current.setMode(TPMode.NAVIGATION);
|
||||||
isNavigationModeRef.current = true;
|
isNavigationModeRef.current = true;
|
||||||
}
|
}
|
||||||
console.log(444444444)
|
|
||||||
|
|
||||||
|
|
||||||
tracePointRef.current.upsert(point, TPAction.ADD);
|
tracePointRef.current.upsert(point, TPAction.ADD);
|
||||||
|
|||||||
@@ -639,7 +639,6 @@ export default function DeviceStatusPage({
|
|||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
height: 450,
|
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|||||||
@@ -115,9 +115,10 @@ export default function RobotTaskPage() {
|
|||||||
const handleFinish = (data) => {
|
const handleFinish = (data) => {
|
||||||
setExecute(false);
|
setExecute(false);
|
||||||
utils.message.success('任务已完成');
|
utils.message.success('任务已完成');
|
||||||
if (controllerRef.current) {
|
//if (controllerRef.current) {
|
||||||
controllerRef.current.destroy?.();
|
// controllerRef.current.destroy?.();
|
||||||
}
|
//}
|
||||||
|
setClearNavLine(clearNavLine + 1);
|
||||||
setSelectedRobotForExecute(null);
|
setSelectedRobotForExecute(null);
|
||||||
setSelectedRouteForExecute(null);
|
setSelectedRouteForExecute(null);
|
||||||
fetchTaskList();
|
fetchTaskList();
|
||||||
@@ -445,9 +446,9 @@ export default function RobotTaskPage() {
|
|||||||
fetchTaskPoolList();
|
fetchTaskPoolList();
|
||||||
fetchTaskHistoryList();
|
fetchTaskHistoryList();
|
||||||
setExecute(false);
|
setExecute(false);
|
||||||
if (controllerRef.current) {
|
//if (controllerRef.current) {
|
||||||
controllerRef.current.destroy?.();
|
// controllerRef.current.destroy?.();
|
||||||
}
|
//}
|
||||||
setSelectedRobotForExecute(null);
|
setSelectedRobotForExecute(null);
|
||||||
setSelectedRouteForExecute(null);
|
setSelectedRouteForExecute(null);
|
||||||
} else {
|
} else {
|
||||||
@@ -1147,7 +1148,7 @@ export default function RobotTaskPage() {
|
|||||||
{activeTab === 'history' && (
|
{activeTab === 'history' && (
|
||||||
<>
|
<>
|
||||||
<div style={{ marginBottom: 8, display: 'flex', gap: 8, alignItems: 'center' }}>
|
<div style={{ marginBottom: 8, display: 'flex', gap: 8, alignItems: 'center' }}>
|
||||||
{/*<RangePicker
|
<RangePicker
|
||||||
size="small"
|
size="small"
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
placeholder={['开始时间', '结束时间']}
|
placeholder={['开始时间', '结束时间']}
|
||||||
@@ -1156,7 +1157,7 @@ export default function RobotTaskPage() {
|
|||||||
setHistoryFilterForm(prev => ({ ...prev, dateRange: dates }));
|
setHistoryFilterForm(prev => ({ ...prev, dateRange: dates }));
|
||||||
}}
|
}}
|
||||||
showTime
|
showTime
|
||||||
/>*/}
|
/>
|
||||||
<Select
|
<Select
|
||||||
style={{ width: 120 }}
|
style={{ width: 120 }}
|
||||||
size="small"
|
size="small"
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export default class DeviceController {
|
|||||||
// 切后台:关闭 WS
|
// 切后台:关闭 WS
|
||||||
if (document.visibilityState === 'hidden') {
|
if (document.visibilityState === 'hidden') {
|
||||||
console.log('🔌 页面切后台,关闭 WebSocket');
|
console.log('🔌 页面切后台,关闭 WebSocket');
|
||||||
this.release();
|
//this.release();
|
||||||
wsManager.close();
|
wsManager.close();
|
||||||
this.connectedDeviceSn = null;
|
this.connectedDeviceSn = null;
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ export default class DeviceController {
|
|||||||
|
|
||||||
this.unSubMessage?.();
|
this.unSubMessage?.();
|
||||||
this.unSubStatus?.();
|
this.unSubStatus?.();
|
||||||
this.release();
|
//this.release();
|
||||||
|
|
||||||
//wsManager.close();
|
//wsManager.close();
|
||||||
this.connectedDeviceSn = null;
|
this.connectedDeviceSn = null;
|
||||||
@@ -158,7 +158,7 @@ export default class DeviceController {
|
|||||||
this.isControlled = false;
|
this.isControlled = false;
|
||||||
this.onControlStatusChange?.(false);
|
this.onControlStatusChange?.(false);
|
||||||
|
|
||||||
//wsManager.close();
|
wsManager.close();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await getControlRight({
|
const res = await getControlRight({
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export function useWebRTCPlayer(deviceId: string, url: string) {
|
|||||||
v.style.height = '100%';
|
v.style.height = '100%';
|
||||||
v.style.objectFit = 'contain';
|
v.style.objectFit = 'contain';
|
||||||
videoRef.current = v;
|
videoRef.current = v;
|
||||||
const token = "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjE4ZDEwNGYzLTk0NjMtNDgwYS05YTYwLTI2YzI1YzQyZGU2ZiJ9.mYX8k1GOBPZQK_k-gitZRODr_XNtn3GyT-gJVbZjQi5VT1SURgUEdDyb2GriaMqyEgoER5BX9O6-LxTOw5aMOw"
|
const token = "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6Ijg4N2JiMWU4LTdmNjMtNDlhNy05NjVmLTRjMWFlOGMyZTIzYiJ9.PVeQayWLEPtHHWBQFtHb1Qkc5T-KVINPdXxChJ5vRasBpXOvyiGRfPPjWvB63aKdTZWLE2xV6r_8BCV0aphYmg"
|
||||||
//const token = localStorage.getItem('videotoken') || JSON.parse(localStorage.getItem('userInfo') || '{}')?.token;
|
//const token = localStorage.getItem('videotoken') || JSON.parse(localStorage.getItem('userInfo') || '{}')?.token;
|
||||||
const videoUrl = `${url}?token=${token}`;
|
const videoUrl = `${url}?token=${token}`;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user