|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <component :loading="loading" :manager="animationManager" :is="modelComponent" />
|
|
|
+ <component ref="modelRef" :loading="loading" :is="modelComponent" />
|
|
|
<div class="scene-box">
|
|
|
<div class="top-box">
|
|
|
<div class="top-center row">
|
|
@@ -340,7 +340,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
- import { onBeforeUnmount, onUnmounted, onMounted, ref, reactive, nextTick, inject, unref, defineAsyncComponent } from 'vue';
|
|
|
+ import { onBeforeUnmount, onUnmounted, onMounted, ref, reactive, nextTick, inject, unref, defineAsyncComponent, provide } from 'vue';
|
|
|
import MonitorTable from '../comment/MonitorTable.vue';
|
|
|
import HistoryTable from '../comment/HistoryTable.vue';
|
|
|
import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
|
|
@@ -374,10 +374,10 @@
|
|
|
const { sysOrgCode } = useGlobSetting();
|
|
|
const globalConfig = inject<any>('globalConfig');
|
|
|
|
|
|
+ const modelRef = ref();
|
|
|
/** 模型对应的组件,根据实际情况分为二维三维 */
|
|
|
const modelComponent = getModelComponent(globalConfig.is2DModel, sysOrgCode);
|
|
|
|
|
|
- const { animationManager, triggerAnimation } = useSvgAnimation();
|
|
|
const { currentRoute } = useRouter();
|
|
|
const MonitorDataTable = ref();
|
|
|
let contrlValue = '';
|
|
@@ -978,77 +978,71 @@
|
|
|
if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0' && !isFrontOpenRunning) {
|
|
|
isFrontOpenRunning = true;
|
|
|
if (frontDeviceState != 1) {
|
|
|
- // 反转播放前门动画即为播放关门动画
|
|
|
- triggerAnimation('___L_0_Layer0_0_FILL', true);
|
|
|
- // 播放后门动画即为播放开门动画
|
|
|
- triggerAnimation('___R_0_Layer0_0_FILL', false);
|
|
|
// import.meta.env.VITE_GLOB_IS_SIMULATE ? play(1, timeScale) : play(1);
|
|
|
play(1, timeScale);
|
|
|
frontDeviceState = 1;
|
|
|
frontDoorIsOpen.value = false;
|
|
|
backDoorIsOpen.value = true;
|
|
|
+ modelRef.value?.animate?.(frontDoorIsOpen.value, midDoorIsOpen.value, backDoorIsOpen.value);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '0' && !isFrontOpenRunning) {
|
|
|
isFrontOpenRunning = true;
|
|
|
if (frontDeviceState != 1) {
|
|
|
- triggerAnimation('___L_0_Layer0_0_FILL', true);
|
|
|
- triggerAnimation('___R_0_Layer0_0_FILL', false);
|
|
|
// import.meta.env.VITE_GLOB_IS_SIMULATE ? play(1, timeScale) : play(1);
|
|
|
play(1, timeScale);
|
|
|
frontDeviceState = 1;
|
|
|
frontDoorIsOpen.value = false;
|
|
|
backDoorIsOpen.value = true;
|
|
|
+ modelRef.value?.animate?.(frontDoorIsOpen.value, midDoorIsOpen.value, backDoorIsOpen.value);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (selectData.frontGateClose == '1' && selectData.frontGateOpen == '0' && isFrontOpenRunning) {
|
|
|
isFrontOpenRunning = false;
|
|
|
if (frontDeviceState != 0) {
|
|
|
- triggerAnimation('___L_0_Layer0_0_FILL', true);
|
|
|
// import.meta.env.VITE_GLOB_IS_SIMULATE ? play(2, timeScale) : play(2);
|
|
|
play(2, timeScale);
|
|
|
frontDeviceState = 0;
|
|
|
frontDoorIsOpen.value = false;
|
|
|
// backDoorIsOpen.value = false
|
|
|
+ modelRef.value?.animate?.(frontDoorIsOpen.value, midDoorIsOpen.value, backDoorIsOpen.value);
|
|
|
}
|
|
|
}
|
|
|
if (selectData.rearGateOpen == '1' && selectData.rearGateClose == '0' && !isRearOpenRunning) {
|
|
|
isRearOpenRunning = true;
|
|
|
|
|
|
if (rearDeviceState != 1) {
|
|
|
- triggerAnimation('___L_0_Layer0_0_FILL', false);
|
|
|
- triggerAnimation('___R_0_Layer0_0_FILL', true);
|
|
|
// import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
|
|
|
play(3, timeScale);
|
|
|
rearDeviceState = 1;
|
|
|
backDoorIsOpen.value = false;
|
|
|
frontDoorIsOpen.value = true;
|
|
|
+ modelRef.value?.animate?.(frontDoorIsOpen.value, midDoorIsOpen.value, backDoorIsOpen.value);
|
|
|
}
|
|
|
}
|
|
|
if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '0' && !isRearOpenRunning) {
|
|
|
isRearOpenRunning = true;
|
|
|
|
|
|
if (rearDeviceState != 1) {
|
|
|
- triggerAnimation('___L_0_Layer0_0_FILL', false);
|
|
|
- triggerAnimation('___R_0_Layer0_0_FILL', true);
|
|
|
// import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
|
|
|
play(3, timeScale);
|
|
|
rearDeviceState = 1;
|
|
|
backDoorIsOpen.value = false;
|
|
|
frontDoorIsOpen.value = true;
|
|
|
+ modelRef.value?.animate?.(frontDoorIsOpen.value, midDoorIsOpen.value, backDoorIsOpen.value);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (selectData.rearGateClose == '1' && selectData.rearGateOpen == '0' && isRearOpenRunning) {
|
|
|
isRearOpenRunning = false;
|
|
|
if (rearDeviceState != 0) {
|
|
|
- triggerAnimation('___R_0_Layer0_0_FILL', true);
|
|
|
// import.meta.env.VITE_GLOB_IS_SIMULATE ? play(4, timeScale) : play(4);
|
|
|
play(4, timeScale);
|
|
|
rearDeviceState = 0;
|
|
|
backDoorIsOpen.value = false;
|
|
|
+ modelRef.value?.animate?.(frontDoorIsOpen.value, midDoorIsOpen.value, backDoorIsOpen.value);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1056,13 +1050,12 @@
|
|
|
isMidOpenRunning = true;
|
|
|
|
|
|
if (midDeviceState != 1) {
|
|
|
- triggerAnimation('___L_0_Layer0_0_FILL', false);
|
|
|
- triggerAnimation('___R_0_Layer0_0_FILL', true);
|
|
|
// import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
|
|
|
play(8, timeScale);
|
|
|
midDeviceState = 1;
|
|
|
backDoorIsOpen.value = false;
|
|
|
frontDoorIsOpen.value = true;
|
|
|
+ modelRef.value?.animate?.(frontDoorIsOpen.value, midDoorIsOpen.value, backDoorIsOpen.value);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1070,24 +1063,23 @@
|
|
|
isMidOpenRunning = true;
|
|
|
|
|
|
if (midDeviceState != 1) {
|
|
|
- triggerAnimation('___L_0_Layer0_0_FILL', false);
|
|
|
- triggerAnimation('___R_0_Layer0_0_FILL', true);
|
|
|
// import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
|
|
|
play(8, timeScale);
|
|
|
midDeviceState = 1;
|
|
|
backDoorIsOpen.value = false;
|
|
|
frontDoorIsOpen.value = true;
|
|
|
+ modelRef.value?.animate?.(frontDoorIsOpen.value, midDoorIsOpen.value, backDoorIsOpen.value);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (selectData.midGateClose == '1' && selectData.midGateOpen == '0' && isMidOpenRunning) {
|
|
|
isMidOpenRunning = false;
|
|
|
if (midDeviceState != 0) {
|
|
|
- triggerAnimation('___R_0_Layer0_0_FILL', true);
|
|
|
// import.meta.env.VITE_GLOB_IS_SIMULATE ? play(4, timeScale) : play(4);
|
|
|
play(9, timeScale);
|
|
|
midDeviceState = 0;
|
|
|
backDoorIsOpen.value = false;
|
|
|
+ modelRef.value?.animate?.(frontDoorIsOpen.value, midDoorIsOpen.value, backDoorIsOpen.value);
|
|
|
}
|
|
|
}
|
|
|
}
|