ab点
This commit is contained in:
16
env.js
16
env.js
@@ -15,17 +15,17 @@ const envConfig = {
|
|||||||
//mqtt_url: "ws://1.95.137.212:8083/mqtt",
|
//mqtt_url: "ws://1.95.137.212:8083/mqtt",
|
||||||
//geoserver_url: "http://192.168.2.59:7000/geoserver"
|
//geoserver_url: "http://192.168.2.59:7000/geoserver"
|
||||||
|
|
||||||
//baseURL: 'http://1.95.137.212:8081',//http://192.168.2.56:8081
|
baseURL: 'http://1.95.137.212:8081',//http://192.168.2.56:8081
|
||||||
////baseURL: 'https://serviceri.satabot.com',
|
|
||||||
//WS_URL: 'ws://1.95.137.212:9002/ws/',
|
|
||||||
//mqtt_url: "ws://1.95.137.212:59021/mqtt",
|
|
||||||
//geoserver_url: "http://1.95.137.212:59018/geoserver"
|
|
||||||
|
|
||||||
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:59017/ws/',
|
WS_URL: 'ws://1.95.137.212:9002/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"
|
||||||
|
|
||||||
|
//baseURL: 'http://1.95.137.212:59015',//http://192.168.2.56:8081
|
||||||
|
////baseURL: 'https://serviceri.satabot.com',
|
||||||
|
//WS_URL: 'ws://1.95.137.212:59017/ws/',
|
||||||
|
//mqtt_url: "ws://1.95.137.212:59021/mqtt",
|
||||||
|
//geoserver_url: "http://1.95.137.212:59018/geoserver"
|
||||||
},
|
},
|
||||||
[ENV.PROD]: {
|
[ENV.PROD]: {
|
||||||
//baseURL: 'https://pvcloudservice.satabot.com',
|
//baseURL: 'https://pvcloudservice.satabot.com',
|
||||||
|
|||||||
@@ -274,9 +274,9 @@ export default function AppLayout() {
|
|||||||
|
|
||||||
{/* <img src="电站图片地址" style={{ width: '100%', borderRadius: 4, marginBottom: 8 }} alt="电站" /> */}
|
{/* <img src="电站图片地址" style={{ width: '100%', borderRadius: 4, marginBottom: 8 }} alt="电站" /> */}
|
||||||
<div style={{ fontSize: 11, color: '#666', lineHeight: 1.8 }}>
|
<div style={{ fontSize: 11, color: '#666', lineHeight: 1.8 }}>
|
||||||
<div>装机容量:{currentStation.capacity || '1.00'} MWp</div>
|
{/*<div>装机容量:{currentStation.capacity || '1.00'} MWp</div>
|
||||||
<div>并网时间:{currentStation.gridTime || '2024-01-15'}</div>
|
<div>并网时间:{currentStation.gridTime || '2024-01-15'}</div>*/}
|
||||||
<div>电站地址:{currentStation.address || '浙江省杭州市'}</div>
|
<div>电站地址:{currentStation.address || '河南省林州'}</div>
|
||||||
<div>电站类型:{currentStation.type || '地面电站'}</div>
|
<div>电站类型:{currentStation.type || '地面电站'}</div>
|
||||||
<div style={{ marginTop: 4, display: 'flex', alignItems: 'center', color: '#41ad0a' }}>
|
<div style={{ marginTop: 4, display: 'flex', alignItems: 'center', color: '#41ad0a' }}>
|
||||||
<span>运行状态:</span>
|
<span>运行状态:</span>
|
||||||
|
|||||||
@@ -490,7 +490,7 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
|||||||
const layerIdentifier = `${workspace}:${layerName}`;
|
const layerIdentifier = `${workspace}:${layerName}`;
|
||||||
let baseUrl = wmsUrl;
|
let baseUrl = wmsUrl;
|
||||||
const cesiumLayers = [];
|
const cesiumLayers = [];
|
||||||
if (index == 2) {
|
if (index == 2 && from == "other") {
|
||||||
flyToLayer(layerIdentifier, baseUrl, 100);
|
flyToLayer(layerIdentifier, baseUrl, 100);
|
||||||
}
|
}
|
||||||
//getLayerBoundsAndFit(wmsUrl, layerName);
|
//getLayerBoundsAndFit(wmsUrl, layerName);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import {
|
|||||||
Select,
|
Select,
|
||||||
message,
|
message,
|
||||||
Modal,
|
Modal,
|
||||||
|
Switch,
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -74,6 +75,17 @@ export default function DeviceStatusPage({
|
|||||||
const [planedevices, setPlaneDevices] = useState([]);
|
const [planedevices, setPlaneDevices] = useState([]);
|
||||||
const [devicesAll, setDevicesAll] = useState([]);
|
const [devicesAll, setDevicesAll] = useState([]);
|
||||||
const [arrivedPoint, setArrivedPoint] = useState(null);//完成点
|
const [arrivedPoint, setArrivedPoint] = useState(null);//完成点
|
||||||
|
const [isLoopMode, setIsLoopMode] = useState(true);
|
||||||
|
|
||||||
|
// 开关切换回调
|
||||||
|
const handleChange = (checked: boolean) => {
|
||||||
|
setIsLoopMode(checked);
|
||||||
|
if (checked) {
|
||||||
|
console.log('当前作业方式:回字');
|
||||||
|
} else {
|
||||||
|
console.log('当前作业方式:单点');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// 获取数据
|
// 获取数据
|
||||||
@@ -582,69 +594,89 @@ export default function DeviceStatusPage({
|
|||||||
|
|
||||||
// 完成功能 - 调用路径规划接口
|
// 完成功能 - 调用路径规划接口
|
||||||
const handleComplete = async () => {
|
const handleComplete = async () => {
|
||||||
if (markedPoints.length < 3) {
|
//如果时弓子模式
|
||||||
messageApi.warning('请至少标记 3 个点');
|
if (isLoopMode) {
|
||||||
return;
|
if (markedPoints.length < 3) {
|
||||||
}
|
messageApi.warning('请至少标记 3 个点');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 准备路径规划请求参数
|
// 准备路径规划请求参数
|
||||||
const positionPoints = [...markedPoints];
|
const positionPoints = [...markedPoints];
|
||||||
|
|
||||||
|
|
||||||
const requestParams = {
|
const requestParams = {
|
||||||
reference: {
|
reference: {
|
||||||
lat: positionPoints[0].lat,
|
lat: positionPoints[0].lat,
|
||||||
lon: positionPoints[0].lon,
|
lon: positionPoints[0].lon,
|
||||||
},
|
},
|
||||||
heading: 0,
|
heading: 0,
|
||||||
outer: {
|
outer: {
|
||||||
position: positionPoints.map(point => ({
|
position: positionPoints.map(point => ({
|
||||||
lat: point.lat,
|
lat: point.lat,
|
||||||
lon: point.lon,
|
lon: point.lon,
|
||||||
})),
|
})),
|
||||||
sideWidth: 0.0,
|
sideWidth: 0.0,
|
||||||
},
|
},
|
||||||
holes: [],
|
holes: [],
|
||||||
workType: 0,
|
workType: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
const response = await fetch('https://servicepathplan.satabot.com/api/path', {
|
const response = await fetch('https://servicepathplan.satabot.com/api/path', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
body: JSON.stringify(requestParams),
|
body: JSON.stringify(requestParams),
|
||||||
});
|
});
|
||||||
|
|
||||||
const result = await response.json();
|
const result = await response.json();
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
const path = result?.data?.path?.map(p => {
|
const path = result?.data?.path?.map(p => {
|
||||||
return {
|
|
||||||
lng: p.lon,
|
|
||||||
lat: p.lat
|
|
||||||
}
|
|
||||||
})
|
|
||||||
setPoints(path);
|
|
||||||
setSavePath({
|
|
||||||
path: path, // 存储返回的路径结果
|
|
||||||
outer: requestParams?.outer?.position?.map(p => {
|
|
||||||
return {
|
return {
|
||||||
lng: p.lon,
|
lng: p.lon,
|
||||||
lat: p.lat
|
lat: p.lat
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
),
|
setPoints(path);
|
||||||
planModel: 0,
|
setSavePath({
|
||||||
});
|
path: path, // 存储返回的路径结果
|
||||||
setCompleteFlag(true);
|
outer: requestParams?.outer?.position?.map(p => {
|
||||||
messageApi.success('路径规划完成');
|
return {
|
||||||
|
lng: p.lon,
|
||||||
|
lat: p.lat
|
||||||
|
}
|
||||||
|
}
|
||||||
|
),
|
||||||
|
planModel: 0,
|
||||||
|
});
|
||||||
|
setCompleteFlag(true);
|
||||||
|
messageApi.success('路径规划完成');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('路径规划失败:', error);
|
||||||
|
messageApi.error('路径规划失败,请重试');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} else {
|
||||||
console.error('路径规划失败:', error);
|
const positionPoints = [...markedPoints].map(item => {
|
||||||
messageApi.error('路径规划失败,请重试');
|
return {
|
||||||
|
lng: item.lon,
|
||||||
|
lat: item.lat
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
setPoints(positionPoints);
|
||||||
|
setSavePath({
|
||||||
|
path: positionPoints, // 存储返回的路径结果
|
||||||
|
outer: [],
|
||||||
|
planModel: 2,
|
||||||
|
});
|
||||||
|
setCompleteFlag(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开保存模态框
|
// 打开保存模态框
|
||||||
@@ -761,6 +793,15 @@ export default function DeviceStatusPage({
|
|||||||
<Text type="secondary">已标记 {markedPoints.length} 个点</Text>
|
<Text type="secondary">已标记 {markedPoints.length} 个点</Text>
|
||||||
</div>
|
</div>
|
||||||
<Space size="middle">
|
<Space size="middle">
|
||||||
|
<Space>
|
||||||
|
<span>作业方式</span>
|
||||||
|
<Switch
|
||||||
|
size="small"
|
||||||
|
checked={isLoopMode}
|
||||||
|
onChange={handleChange}
|
||||||
|
/>
|
||||||
|
<span>{isLoopMode ? '弓字' : 'AB点'}</span>
|
||||||
|
</Space>
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
onClick={handleMarkPoint}
|
onClick={handleMarkPoint}
|
||||||
@@ -778,7 +819,7 @@ export default function DeviceStatusPage({
|
|||||||
type="primary"
|
type="primary"
|
||||||
ghost
|
ghost
|
||||||
onClick={handleComplete}
|
onClick={handleComplete}
|
||||||
disabled={markedPoints.length < 3}
|
disabled={markedPoints.length < 2}
|
||||||
>
|
>
|
||||||
完成
|
完成
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -269,25 +269,25 @@ export default function RobotTaskPage() {
|
|||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}, [robotRealtimePosition])
|
}, [robotRealtimePosition])
|
||||||
useEffect(() => {
|
//useEffect(() => {
|
||||||
if (robotRealtimePosition && execute) {
|
// if (robotRealtimePosition && execute) {
|
||||||
let warningMsg = '';
|
// let warningMsg = '';
|
||||||
|
|
||||||
if (robotRealtimePosition?.controlMode == "1") {
|
// if (robotRealtimePosition?.controlMode == "1") {
|
||||||
warningMsg = `请切换到远程模式 `;
|
// warningMsg = `请切换到远程模式 `;
|
||||||
} else if (robotRealtimePosition?.qual != "4") {
|
// } else if (robotRealtimePosition?.qual != "4") {
|
||||||
warningMsg = '定位未固定';
|
// warningMsg = '定位未固定';
|
||||||
} else if (robotRealtimePosition?.headingStatus != "1") {
|
// } else if (robotRealtimePosition?.headingStatus != "1") {
|
||||||
warningMsg = '请先初始化航向角';
|
// warningMsg = '请先初始化航向角';
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (warningMsg) {
|
// if (warningMsg) {
|
||||||
utils.message.destroy();
|
// utils.message.destroy();
|
||||||
|
|
||||||
utils.message.warning(warningMsg);
|
// utils.message.warning(warningMsg);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}, [robotRealtimePosition, execute])
|
//}, [robotRealtimePosition, execute])
|
||||||
|
|
||||||
|
|
||||||
// 获取数据
|
// 获取数据
|
||||||
@@ -356,6 +356,8 @@ export default function RobotTaskPage() {
|
|||||||
const res = await getSingleRouteList({ id: selectedPathWork.id });
|
const res = await getSingleRouteList({ id: selectedPathWork.id });
|
||||||
if (res?.code === 200 && res?.data) {
|
if (res?.code === 200 && res?.data) {
|
||||||
let pathPoints = [];
|
let pathPoints = [];
|
||||||
|
let outerPoints = [];
|
||||||
|
let method = '';//0弓子 2 回子
|
||||||
try {
|
try {
|
||||||
// 尝试解析 JSON
|
// 尝试解析 JSON
|
||||||
if (res.data.jsonData) {
|
if (res.data.jsonData) {
|
||||||
@@ -363,6 +365,9 @@ export default function RobotTaskPage() {
|
|||||||
? JSON.parse(res.data.jsonData)
|
? JSON.parse(res.data.jsonData)
|
||||||
: res.data.jsonData;
|
: res.data.jsonData;
|
||||||
pathPoints = data?.path || [];
|
pathPoints = data?.path || [];
|
||||||
|
outerPoints = data?.outer || [];
|
||||||
|
method = data?.planModel;
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('解析路线数据失败:', err);
|
console.error('解析路线数据失败:', err);
|
||||||
@@ -371,7 +376,15 @@ export default function RobotTaskPage() {
|
|||||||
if (pathPoints.length === 0) {
|
if (pathPoints.length === 0) {
|
||||||
utils.message.warning('该路线暂无路径点数据');
|
utils.message.warning('该路线暂无路径点数据');
|
||||||
}
|
}
|
||||||
|
//if (outerPoints.length === 0 && method == 2) {
|
||||||
|
// utils.message.warning('该路线暂无路径点数据');
|
||||||
|
//}
|
||||||
|
//if (method == 0) {
|
||||||
setPoints(pathPoints);
|
setPoints(pathPoints);
|
||||||
|
//} else {
|
||||||
|
// setPoints(outerPoints);
|
||||||
|
|
||||||
|
//}
|
||||||
} else {
|
} else {
|
||||||
setPoints([]);
|
setPoints([]);
|
||||||
}
|
}
|
||||||
@@ -475,10 +488,10 @@ export default function RobotTaskPage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hasPathPoints) {
|
//if (!hasPathPoints) {
|
||||||
utils.message.warning('该路线没有路径点,无法执行');
|
// utils.message.warning('该路线没有路径点,无法执行');
|
||||||
return;
|
// return;
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ export default function WayLinePage({ onRefresh }) {
|
|||||||
// 航线列表相关状态
|
// 航线列表相关状态
|
||||||
const [selectedWayline, setSelectedWayline] = useState(null);
|
const [selectedWayline, setSelectedWayline] = useState(null);
|
||||||
const [rthModalVisible, setRthModalVisible] = useState(false);
|
const [rthModalVisible, setRthModalVisible] = useState(false);
|
||||||
const [tempRthAltitude, setTempRthAltitude] = useState(20);
|
const [tempRthAltitude, setTempRthAltitude] = useState(100);
|
||||||
const [waylineSearch, setWaylineSearch] = useState('');
|
const [waylineSearch, setWaylineSearch] = useState('');
|
||||||
|
|
||||||
// 任务控制相关状态
|
// 任务控制相关状态
|
||||||
@@ -658,7 +658,7 @@ export default function WayLinePage({ onRefresh }) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setSelectedWayline(wayline);
|
setSelectedWayline(wayline);
|
||||||
setTempRthAltitude(20);
|
setTempRthAltitude(100);
|
||||||
setRthModalVisible(true);
|
setRthModalVisible(true);
|
||||||
};
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ export default function StationDashboard() {
|
|||||||
title="外部系统"
|
title="外部系统"
|
||||||
/>*/}
|
/>*/}
|
||||||
|
|
||||||
<CesiumMap />
|
<CesiumMap from="other" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ const RealTimeMonitorPage = () => {
|
|||||||
/>*/}
|
/>*/}
|
||||||
|
|
||||||
|
|
||||||
<CesiumMap />
|
<CesiumMap from="other" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
Reference in New Issue
Block a user