xx
This commit is contained in:
@@ -189,7 +189,6 @@ export default function CesiumMap({ realtimePosition, realtimeType, pathPoints =
|
||||
}
|
||||
return;
|
||||
}
|
||||
console.log(points, "4324345")
|
||||
const validPoints = points.filter(p => {
|
||||
|
||||
const lon = Number(p.lng);
|
||||
@@ -229,7 +228,6 @@ export default function CesiumMap({ realtimePosition, realtimeType, pathPoints =
|
||||
// ======================
|
||||
// 🚀 非实时模式 -> 自动飞到轨迹
|
||||
// ======================
|
||||
console.log('=== drawTrackLine ===', { points, validPoints, isRealtimeMode });
|
||||
if (!isRealtimeMode) {
|
||||
|
||||
let minLon = 180, maxLon = -180;
|
||||
@@ -245,7 +243,6 @@ export default function CesiumMap({ realtimePosition, realtimeType, pathPoints =
|
||||
|
||||
// 单个点
|
||||
if (validPoints.length === 1) {
|
||||
console.log('=== drawTrackLine1111 ===', { points, validPoints, isRealtimeMode });
|
||||
|
||||
|
||||
const p = validPoints[0];
|
||||
@@ -261,7 +258,6 @@ export default function CesiumMap({ realtimePosition, realtimeType, pathPoints =
|
||||
viewer.scene.requestRender();
|
||||
|
||||
} else {
|
||||
console.log('=== drawTrackLine2222 ===', { points, validPoints, isRealtimeMode });
|
||||
|
||||
|
||||
const rectangle = Cesium.Rectangle.fromDegrees(
|
||||
|
||||
@@ -333,7 +333,6 @@ export default function DeviceAccessPage() {
|
||||
if (modalType === 'product') {
|
||||
form.setFieldValue('modelId', selectedModelId);
|
||||
const { modelId, limitConfig, actionConfig, ...params } = values;
|
||||
console.log('提交的产品数据:', { ...params, modelId, limitConfig, actionConfig }); // 👈 这里可以看到提交的数据结构
|
||||
|
||||
const finalLimitConfig = {};
|
||||
if (limitConfig) {
|
||||
|
||||
@@ -51,7 +51,6 @@ export default function MenuList() {
|
||||
};
|
||||
|
||||
getMenuList(params).then(res => {
|
||||
console.log(res, "res")
|
||||
if (res.code === 200) {
|
||||
const data = res.rows || [];
|
||||
setRawMenuList(data);
|
||||
|
||||
@@ -194,7 +194,6 @@ const SerialNumGenerate = () => {
|
||||
const generateQRCode = async () => {
|
||||
try {
|
||||
const values = await form.validateFields();
|
||||
console.log(values, "jnjn")
|
||||
const { model, config, type, country, province } = values;
|
||||
const ts = Date.now();
|
||||
const suffix = generateSerialSuffix();
|
||||
@@ -244,7 +243,6 @@ const SerialNumGenerate = () => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const values = form.getFieldsValue();
|
||||
console.log(values, "oiii", types)
|
||||
const model = models.find(m => m.displayName === values.model);
|
||||
const config = configs.find(c => c.displayName === values.config);
|
||||
const type = types.find(t => t.storeValue === values.type);
|
||||
@@ -355,7 +353,6 @@ const SerialNumGenerate = () => {
|
||||
key: 'type',
|
||||
render: (_, r) => {
|
||||
const qrInfo = parseQrJson(r.qrJson);
|
||||
console.log(types, qrInfo.type)
|
||||
const typeItem = types.find(t => t.storeValue === qrInfo.type);
|
||||
return typeItem?.displayName || qrInfo.type || '-';
|
||||
}
|
||||
|
||||
@@ -298,7 +298,6 @@ const RobotControlCenter = ({ setView }) => {
|
||||
if (res.data.code == 200) {
|
||||
setUrlInfo(res.data.data);
|
||||
}
|
||||
console.log(res, "获取")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,6 @@ export default function DeviceOverviewPage({ onViewStatus, selectedSn, onDeviceS
|
||||
if (!stationId) return;
|
||||
|
||||
try {
|
||||
console.log('开始请求设备数据,stationId:', userInfo);
|
||||
// 1. 同时发请求
|
||||
const [deviceRes, planeRes] = await Promise.all([
|
||||
getSiteDevice({ siteId: stationId, pageSize: 9999, pageNum: 1, orgId: userInfo.orgId }),
|
||||
|
||||
@@ -255,7 +255,6 @@ export default function DeviceStatusPage({
|
||||
if (device.gateway_sn && device.gateway_sn !== device.device_sn) {
|
||||
topics.push(`thing/product/${device.gateway_sn}/osd`);
|
||||
}
|
||||
console.log('DeviceStatusPage 订阅的MQTT主题:', topics);
|
||||
return topics;
|
||||
}, [isUAV, device]);
|
||||
|
||||
@@ -371,8 +370,9 @@ export default function DeviceStatusPage({
|
||||
controllerRef.current?.destroy();
|
||||
|
||||
controllerRef.current = null;
|
||||
|
||||
};
|
||||
}, [userInfo, messageApi]);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!device || !controllerRef.current || !device?.serialNumber || isUAV) return;
|
||||
|
||||
@@ -234,7 +234,6 @@ export default function RobotTaskPage() {
|
||||
});
|
||||
};
|
||||
const handleTaskexcuted = (route) => {
|
||||
console.log('执行任务,路线数据:', route);
|
||||
|
||||
// 检查路径点
|
||||
let hasPathPoints = false;
|
||||
@@ -272,7 +271,6 @@ export default function RobotTaskPage() {
|
||||
...(userInfo?.orgId ? { orgId: userInfo.orgId } : {}),
|
||||
};
|
||||
|
||||
console.log('执行任务参数:', params);
|
||||
const res = await excuetRoute(params);
|
||||
|
||||
if (res.code === 200) {
|
||||
|
||||
@@ -92,7 +92,6 @@ export default function WayLinePage({ onRefresh }) {
|
||||
|
||||
try {
|
||||
const parsedMessage = JSON.parse(message);
|
||||
//console.log('WayLinePage 解析后的消息:', parsedMessage);
|
||||
|
||||
if (parsedMessage.data && parsedMessage.data.host) {
|
||||
const { host } = parsedMessage.data;
|
||||
@@ -513,7 +512,6 @@ export default function WayLinePage({ onRefresh }) {
|
||||
const getBoardTask = async () => {
|
||||
if (!planedevices?.length) return;
|
||||
try {
|
||||
console.log('获取看板任务数据,当前筛选条件:')
|
||||
|
||||
const defaultStart = dayjs().startOf('day').unix();
|
||||
const defaultEnd = dayjs().endOf('day').unix();
|
||||
@@ -524,7 +522,6 @@ export default function WayLinePage({ onRefresh }) {
|
||||
|
||||
const sns = boardDrone ? [boardDrone.gateway_sn] : planedevices.map(item => item.gateway_sn);
|
||||
const res = await getsinglePlan({ sns, beginAt, endAt });
|
||||
console.log('看板任务数据接口返回:', res);
|
||||
if (res?.code === 200) {
|
||||
let combinedList = [];
|
||||
if (res.data) {
|
||||
|
||||
@@ -64,7 +64,10 @@ export default class DeviceController {
|
||||
// 切后台:关闭 WS
|
||||
if (document.visibilityState === 'hidden') {
|
||||
console.log('🔌 页面切后台,关闭 WebSocket');
|
||||
this.release();
|
||||
wsManager.close();
|
||||
this.connectedDeviceSn = null;
|
||||
|
||||
|
||||
this.isControlled = false;
|
||||
this.onControlStatusChange?.(false);
|
||||
@@ -91,6 +94,22 @@ export default class DeviceController {
|
||||
}
|
||||
}, 8000);
|
||||
}
|
||||
release() {
|
||||
if (this.isControlled && this.connectedDeviceSn) {
|
||||
const data = {
|
||||
platform: "web",
|
||||
type: 1
|
||||
};
|
||||
const url = `${envConfig.baseURL}/forward/device/releaseControl`;
|
||||
|
||||
try {
|
||||
const blob = new Blob([JSON.stringify(data)], { type: 'application/json' });
|
||||
navigator.sendBeacon(url, blob);
|
||||
} catch (e) {
|
||||
console.error('Failed to send releaseControl beacon:', e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this.clearControlTimeout();
|
||||
@@ -106,8 +125,11 @@ export default class DeviceController {
|
||||
|
||||
this.unSubMessage?.();
|
||||
this.unSubStatus?.();
|
||||
this.release();
|
||||
|
||||
wsManager.close();
|
||||
this.connectedDeviceSn = null;
|
||||
|
||||
}
|
||||
|
||||
handleWsStatus(status) {
|
||||
@@ -154,6 +176,7 @@ export default class DeviceController {
|
||||
wsManager.connect(sn, this.wsUrl);
|
||||
this.connectedDeviceSn = sn;
|
||||
|
||||
|
||||
await this.getControl(sn);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
@@ -223,6 +246,7 @@ export default class DeviceController {
|
||||
}
|
||||
|
||||
handleWsMessage(msg) {
|
||||
console.log('📨 收到消息:', msg);
|
||||
switch (msg.type) {
|
||||
case 'deviceInfo': {
|
||||
const data = {};
|
||||
|
||||
Reference in New Issue
Block a user