feat(movement-supervision): 添加新标签页打开功能,移除调试日志并更新开发环境配置
This commit is contained in:
parent
cc9d83efc9
commit
d0b7b7180d
@ -4,5 +4,5 @@ ENV_WEBSOCKET_BASE=/ws
|
||||
ENV_STORAGE_WEBSOCKET_BASE=/vwedWs
|
||||
|
||||
# 开发环境token配置 - 可以手动设置或从另一个项目获取后填入
|
||||
ENV_DEV_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3NjM1MDEyNDgsInVzZXJuYW1lIjoiYWRtaW4ifQ.tIG-JbTF4DFFuX8aJwdbouE2hQXgYIiJSl0FnWUKazI
|
||||
ENV_DEV_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3NjQxNjM2MzIsInVzZXJuYW1lIjoiYWRtaW4ifQ.IC24_YwD10DPM6PYyB-aBHoN4BMmDnQYe_8ZGI-Cyzg
|
||||
ENV_DEV_TENANT_ID=1000
|
||||
|
||||
@ -40,6 +40,10 @@ const props = defineProps<Props>();
|
||||
// 获取路由信息以判断当前模式
|
||||
const route = useRoute();
|
||||
|
||||
const openInNewTab = () => {
|
||||
window.open(window.location.href, '_blank');
|
||||
};
|
||||
|
||||
// 适配多种后端数据格式的解析(参考 scene-editor.vue)
|
||||
const normalizeSceneJson = (raw: unknown): unknown => {
|
||||
if (raw == null) return raw;
|
||||
@ -265,7 +269,6 @@ const readScene = async () => {
|
||||
* 采用 requestAnimationFrame 优化高频数据渲染,确保动画流畅且不阻塞UI线程。
|
||||
*/
|
||||
const monitorScene = async () => {
|
||||
console.log('[实时模式] 开始监控场景, current:', current.value?.id);
|
||||
client.value?.close();
|
||||
// 根据路由路径是否是真实场景监控决定使用哪个监控接口
|
||||
const sidWithFloor = `${props.sid}/${currentFloorIndex.value + 1}`;
|
||||
@ -329,7 +332,6 @@ const monitorScene = async () => {
|
||||
*/
|
||||
ws.onmessage = (e) => {
|
||||
const data = JSON.parse(e.data || '{}');
|
||||
console.log('[实时模式] 收到WebSocket数据:', data);
|
||||
|
||||
// 判断数据类型:type=99为自动门点,其他为机器人
|
||||
if (data.type === 99) {
|
||||
@ -338,7 +340,6 @@ const monitorScene = async () => {
|
||||
} else {
|
||||
// 机器人数据处理
|
||||
const robotData = data as RobotRealtimeInfo;
|
||||
console.log('[实时模式] 收到机器人数据:', robotData.id, { x: robotData.x, y: robotData.y, active: robotData.active });
|
||||
latestRobotData.set(robotData.id, robotData);
|
||||
}
|
||||
};
|
||||
@ -762,6 +763,7 @@ const handleGlobalKeydown = (event: KeyboardEvent) => {
|
||||
}
|
||||
};
|
||||
//#endregion
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -771,6 +773,7 @@ const handleGlobalKeydown = (event: KeyboardEvent) => {
|
||||
<a-typography-text class="title">{{ title }}--{{ modeTitle }}</a-typography-text>
|
||||
<a-space align="center">
|
||||
<a-button @click="backToCards"> 返回 </a-button>
|
||||
<a-button @click="openInNewTab"> 在新标签页打开 </a-button>
|
||||
<a-button type="primary" :loading="isSaving" @click="handleSaveViewState"> 保存比例 </a-button>
|
||||
<a-divider type="vertical" />
|
||||
|
||||
@ -887,6 +890,7 @@ const handleGlobalKeydown = (event: KeyboardEvent) => {
|
||||
@date-change="handleDateChange"
|
||||
/>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@ -5,7 +5,7 @@ import Components from 'unplugin-vue-components/vite';
|
||||
import { defineConfig } from 'vite';
|
||||
|
||||
// 服务器IP地址
|
||||
const SERVER_IP = '192.168.189.118';
|
||||
const SERVER_IP = '192.168.189.206';
|
||||
|
||||
export default ({ mode }: Record<string, unknown>) =>
|
||||
defineConfig({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user