|
@@ -3,12 +3,13 @@
|
|
|
<div>
|
|
|
<div v-if="!isLoaded" ref="loading_a1" id="loading_a1"></div>
|
|
|
<div v-if="!isLoaded" ref="loading" id="loading">正在加载模型中...</div>
|
|
|
+ <div v-if="reconnect" class="reconnect">网络连接中断,正在进行重连...</div>
|
|
|
<video ref="EngineContent" autoplay muted style="width: 1920px;height:1080px;">浏览器不支持</video>
|
|
|
<Fac v-if="currentTargetType=='FAC'" :fac-model-load-state="facModelLoadState" @markerLClick="facMarkerLClick"></Fac>
|
|
|
<In02 ref="In02Ele" v-if="currentTargetType=='IN02'" :click-event="In02ClickEvent" :in02-model-load-state="in02modelloadstate" :user-timeout="AutoPlayer"></In02>
|
|
|
- <In03 ref="In03Ele" v-if="currentTargetType=='IN03'"></In03>
|
|
|
- <In04 v-if="currentTargetType=='IN04'"></In04>
|
|
|
- <In05 v-if="currentTargetType=='IN05'"></In05>
|
|
|
+ <In03 ref="In03Ele" v-if="currentTargetType=='IN03'" :click-event="In03ClickEvent" :in03-model-load-state="in03modelloadstate" :user-timeout="AutoPlayer"></In03>
|
|
|
+ <In04 v-if="currentTargetType=='IN04'" :click-event="In04ClickEvent" :in04-model-load-state="in04modelloadstate" :user-timeout="AutoPlayer"></In04>
|
|
|
+ <In05 v-if="currentTargetType=='IN05'" :click-event="In05ClickEvent" :in05-model-load-state="in05modelloadstate" :user-timeout="AutoPlayer"></In05>
|
|
|
<Bottom @loadNavModel="loadNavModel" :fac-model-load-state="facModelLoadState"/>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -36,8 +37,12 @@ export default {
|
|
|
setup() {
|
|
|
const loading_a1=ref(null);
|
|
|
const EngineContent=ref(null);
|
|
|
+ const reconnect=ref(false);
|
|
|
const autoplayer_btn =ref(null);
|
|
|
let In02ClickEvent = ref(null);
|
|
|
+ let In04ClickEvent = ref(null);
|
|
|
+ let In03ClickEvent = ref(null);
|
|
|
+ let In05ClickEvent = ref(null);
|
|
|
const In03Ele = ref(null);
|
|
|
let isLoaded = ref(false);
|
|
|
let isClearEle = ref(false);
|
|
@@ -47,6 +52,9 @@ export default {
|
|
|
window.modelLoadState = {};
|
|
|
const facModelLoadState=ref(false);
|
|
|
const in02modelloadstate=ref(false);
|
|
|
+ const in03modelloadstate=ref(false);
|
|
|
+ const in04modelloadstate=ref(false);
|
|
|
+ const in05modelloadstate=ref(false);
|
|
|
let currentTargetType = ref('');
|
|
|
let reconntimer=null;
|
|
|
let MarkerMapFac={};
|
|
@@ -125,22 +133,31 @@ export default {
|
|
|
player.on("Connected", () => {
|
|
|
console.log("Has connected to engine")
|
|
|
playerConnState = true
|
|
|
+ reconnect.value = false;
|
|
|
if (reconntimer != null) clearTimeout(reconntimer);
|
|
|
});
|
|
|
|
|
|
//3.[可选]监听连接失败消息
|
|
|
player.on("Disconnected", (e) => {
|
|
|
console.log("Disconnected from engine", e);
|
|
|
+ reconnect.value = true;
|
|
|
isClearEle.value=true;
|
|
|
playerConnState = false
|
|
|
facModelLoadState.value=false;
|
|
|
+ in02modelloadstate.value=false;
|
|
|
+ in03modelloadstate.value=false;
|
|
|
+ in04modelloadstate.value = false;
|
|
|
+ in05modelloadstate.value = false;
|
|
|
+ window.IN03Markers=null;
|
|
|
+ window.IN04Markers=null;
|
|
|
+ window.IN05Markers=null;
|
|
|
modelLoadState={};
|
|
|
//currentTargetType.value='';
|
|
|
//4.[推荐]尝试重新连接
|
|
|
reconntimer = setTimeout(function () {
|
|
|
console.log('尝试自动重连:', playerConnState)
|
|
|
if (playerConnState) return
|
|
|
- if(player==null){
|
|
|
+ if(player==null || player.Native==null){
|
|
|
window.location.reload();
|
|
|
return;
|
|
|
}
|
|
@@ -246,7 +263,18 @@ export default {
|
|
|
In02ClickEvent.value = event;
|
|
|
//In02Ele.updateInfo("LClick", event);
|
|
|
}
|
|
|
- if(currentTargetType.value=="IN03") move03Anything("LClick", event);
|
|
|
+ if(currentTargetType.value=="IN03") {
|
|
|
+ //move03Anything("LClick", event);
|
|
|
+ In03ClickEvent.value = event;
|
|
|
+ }
|
|
|
+ if(currentTargetType.value=="IN04") {
|
|
|
+ //move03Anything("LClick", event);
|
|
|
+ In04ClickEvent.value = event;
|
|
|
+ }
|
|
|
+ if(currentTargetType.value=="IN05") {
|
|
|
+ //move03Anything("LClick", event);
|
|
|
+ In05ClickEvent.value = event;
|
|
|
+ }
|
|
|
});
|
|
|
Native.ModelTree.EventBrowseRClick.connect((event) => {
|
|
|
if(markerLClickObj!=null) return;
|
|
@@ -295,8 +323,9 @@ export default {
|
|
|
var errStr = await PlayerUtils.call(Native.Model.loadModel, 'IN03', cf);
|
|
|
modelLoadState[currentTargetType.value] = true;
|
|
|
}
|
|
|
- showMarker(currentTargetType.value);
|
|
|
+ //showMarker(currentTargetType.value);
|
|
|
await player.Native.Model.setModelVisible("IN03",true);
|
|
|
+ in05modelloadstate.value = true;
|
|
|
}
|
|
|
//前整
|
|
|
async function loadIn04Model(Native){
|
|
@@ -314,9 +343,10 @@ export default {
|
|
|
var errStr = await PlayerUtils.call(Native.Model.loadModel, 'IN03', cf);
|
|
|
modelLoadState[currentTargetType.value] = true;
|
|
|
}
|
|
|
- showMarker(currentTargetType.value);
|
|
|
+ //showMarker(currentTargetType.value);
|
|
|
|
|
|
await player.Native.Model.setModelVisible("IN03",true);
|
|
|
+ in04modelloadstate.value = true;
|
|
|
}
|
|
|
//印花
|
|
|
async function loadIn03Model(Native){
|
|
@@ -334,9 +364,10 @@ export default {
|
|
|
var errStr = await PlayerUtils.call(Native.Model.loadModel, 'IN03', cf);
|
|
|
modelLoadState[currentTargetType.value] = true;
|
|
|
}
|
|
|
- showMarker(currentTargetType.value);
|
|
|
+ //showMarker(currentTargetType.value);
|
|
|
await player.Native.Model.setModelVisible(currentTargetType.value,true);
|
|
|
player.Native.CameraAnimation.clearKeyFrame();
|
|
|
+ in03modelloadstate.value=true;
|
|
|
}
|
|
|
//经编
|
|
|
async function loadIn02Model(Native){
|
|
@@ -483,11 +514,18 @@ export default {
|
|
|
isLoaded,
|
|
|
currentTargetType,
|
|
|
loading_a1,
|
|
|
+ reconnect,
|
|
|
EngineContent,
|
|
|
AutoPlayer,
|
|
|
In02ClickEvent,
|
|
|
+ In03ClickEvent,
|
|
|
+ In04ClickEvent,
|
|
|
+ In05ClickEvent,
|
|
|
facModelLoadState,
|
|
|
in02modelloadstate,
|
|
|
+ in03modelloadstate,
|
|
|
+ in04modelloadstate,
|
|
|
+ in05modelloadstate,
|
|
|
ShowLoading,
|
|
|
handleBodyClick,
|
|
|
senceInit,
|