feat(movement-supervision): 添加新标签页打开功能,移除调试日志并更新开发环境配置

This commit is contained in:
xudan 2025-11-28 10:47:37 +08:00
parent cc9d83efc9
commit d0b7b7180d
3 changed files with 9 additions and 5 deletions

View File

@ -4,5 +4,5 @@ ENV_WEBSOCKET_BASE=/ws
ENV_STORAGE_WEBSOCKET_BASE=/vwedWs ENV_STORAGE_WEBSOCKET_BASE=/vwedWs
# 开发环境token配置 - 可以手动设置或从另一个项目获取后填入 # 开发环境token配置 - 可以手动设置或从另一个项目获取后填入
ENV_DEV_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3NjM1MDEyNDgsInVzZXJuYW1lIjoiYWRtaW4ifQ.tIG-JbTF4DFFuX8aJwdbouE2hQXgYIiJSl0FnWUKazI ENV_DEV_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3NjQxNjM2MzIsInVzZXJuYW1lIjoiYWRtaW4ifQ.IC24_YwD10DPM6PYyB-aBHoN4BMmDnQYe_8ZGI-Cyzg
ENV_DEV_TENANT_ID=1000 ENV_DEV_TENANT_ID=1000

View File

@ -40,6 +40,10 @@ const props = defineProps<Props>();
// //
const route = useRoute(); const route = useRoute();
const openInNewTab = () => {
window.open(window.location.href, '_blank');
};
// scene-editor.vue // scene-editor.vue
const normalizeSceneJson = (raw: unknown): unknown => { const normalizeSceneJson = (raw: unknown): unknown => {
if (raw == null) return raw; if (raw == null) return raw;
@ -265,7 +269,6 @@ const readScene = async () => {
* 采用 requestAnimationFrame 优化高频数据渲染确保动画流畅且不阻塞UI线程 * 采用 requestAnimationFrame 优化高频数据渲染确保动画流畅且不阻塞UI线程
*/ */
const monitorScene = async () => { const monitorScene = async () => {
console.log('[实时模式] 开始监控场景, current:', current.value?.id);
client.value?.close(); client.value?.close();
// 使 // 使
const sidWithFloor = `${props.sid}/${currentFloorIndex.value + 1}`; const sidWithFloor = `${props.sid}/${currentFloorIndex.value + 1}`;
@ -329,7 +332,6 @@ const monitorScene = async () => {
*/ */
ws.onmessage = (e) => { ws.onmessage = (e) => {
const data = JSON.parse(e.data || '{}'); const data = JSON.parse(e.data || '{}');
console.log('[实时模式] 收到WebSocket数据:', data);
// type=99 // type=99
if (data.type === 99) { if (data.type === 99) {
@ -338,7 +340,6 @@ const monitorScene = async () => {
} else { } else {
// //
const robotData = data as RobotRealtimeInfo; const robotData = data as RobotRealtimeInfo;
console.log('[实时模式] 收到机器人数据:', robotData.id, { x: robotData.x, y: robotData.y, active: robotData.active });
latestRobotData.set(robotData.id, robotData); latestRobotData.set(robotData.id, robotData);
} }
}; };
@ -762,6 +763,7 @@ const handleGlobalKeydown = (event: KeyboardEvent) => {
} }
}; };
//#endregion //#endregion
</script> </script>
<template> <template>
@ -771,6 +773,7 @@ const handleGlobalKeydown = (event: KeyboardEvent) => {
<a-typography-text class="title">{{ title }}--{{ modeTitle }}</a-typography-text> <a-typography-text class="title">{{ title }}--{{ modeTitle }}</a-typography-text>
<a-space align="center"> <a-space align="center">
<a-button @click="backToCards"> 返回 </a-button> <a-button @click="backToCards"> 返回 </a-button>
<a-button @click="openInNewTab"> 在新标签页打开 </a-button>
<a-button type="primary" :loading="isSaving" @click="handleSaveViewState"> 保存比例 </a-button> <a-button type="primary" :loading="isSaving" @click="handleSaveViewState"> 保存比例 </a-button>
<a-divider type="vertical" /> <a-divider type="vertical" />
@ -887,6 +890,7 @@ const handleGlobalKeydown = (event: KeyboardEvent) => {
@date-change="handleDateChange" @date-change="handleDateChange"
/> />
</template> </template>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -5,7 +5,7 @@ import Components from 'unplugin-vue-components/vite';
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
// 服务器IP地址 // 服务器IP地址
const SERVER_IP = '192.168.189.118'; const SERVER_IP = '192.168.189.206';
export default ({ mode }: Record<string, unknown>) => export default ({ mode }: Record<string, unknown>) =>
defineConfig({ defineConfig({