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
|
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
|
||||||
|
|||||||
@ -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">
|
||||||
|
|||||||
@ -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({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user