liling vor 2 Monaten
Ursprung
Commit
c5b9b60bd7

+ 11 - 5
src/pages/components/Fac.vue

@@ -183,13 +183,19 @@ export default {
                 console.log('全厂模型加载完成')
                 try{
                     backMasterViewByFac();
-                    if(MarkerMapFac["FAC"]!=null && player!=null && player.Native!=null){
-                        for(let key in MarkerMapFac["FAC"]){
-                            player.Native.GisMarker.destroy(key)
-                        }
+                    if(player!=null && player.Native!=null){
+                        (async()=>{
+                            let marklst = await player.Native.GisMarker.getMarkerList();
+                            if(marklst!=null){
+                                for(var i=0;i<marklst.length;i++){
+                                    if(player!=null && player.Native!=null)player.Native.GisMarker.destroy(marklst[i].id)
+                                }
+                            }
+                            loadmarkers();
+                        })();
                     }
                     MarkerMapFac["FAC"] = {};
-                    loadmarkers();
+                    
 
                 }catch(e){
                     window.location.reload();

+ 8 - 0
src/pages/components/In02.vue

@@ -653,6 +653,14 @@ export default {
         }
         async function init(){
             backMasterViewBy02();
+            (async()=>{
+                            let marklst = await player.Native.GisMarker.getMarkerList();
+                            if(marklst!=null){
+                                for(var i=0;i<marklst.length;i++){
+                                    if(player!=null && player.Native!=null)player.Native.GisMarker.destroy(marklst[i].id)
+                                }
+                            }
+            })();
             for (var i in ANIMATION_DATA) {
                 // 添加关键帧
                 player.Native.CameraAnimation.addKeyFrames([ANIMATION_DATA[i]]);

+ 23 - 6
src/pages/components/In03.vue

@@ -207,6 +207,8 @@ export default {
         let echartsEleIns_1=null;
         let echartsEleIns_0=null;
         const isFullScreen = ref(false); //是否全屏模式
+        let lineArrow001=null;
+        let lineArrow002=null;
         let getDataTimer = null;
         const cxList=ref([
             {"name":1,active:false,index:1},
@@ -231,8 +233,8 @@ export default {
                 clearTimeout(getDataTimer);
                 setTimeout(() => {
                     DataFull.GetData();
-                    init();
-                }, 10);
+                }, 10);                
+                init();
             }
         },{deep:true,immediate:true})
         watch(() => props.userTimeout, newVal=> {
@@ -270,6 +272,14 @@ export default {
 
         async function init(){
             backMasterViewByFac();
+            (async()=>{
+                            let marklst = await player.Native.GisMarker.getMarkerList();
+                            if(marklst!=null){
+                                for(var i=0;i<marklst.length;i++){
+                                    if(player!=null && player.Native!=null)player.Native.GisMarker.destroy(marklst[i].id)
+                                }
+                            }
+            })();
             if(window.LINELIST==null){
                 var rootItem = await player.Native.ModelTree.getRootItems();
                 var rootObj=null;
@@ -290,6 +300,8 @@ export default {
                 items =  await player.Native.ModelTree.getSubItems(rootObj.item);
                 items.forEach(ele=>{
                     if(ele.name.indexOf('#线')>-1) lines[ele.name] = ele.item;
+                    //if(ele.name=='Line001') lineArrow001=ele;
+                    //if(ele.name=='Line002') lineArrow002=ele;
                 })
                 window.LINELIST = lines;
             }
@@ -651,10 +663,15 @@ export default {
         onUnmounted(()=>{
             clearTimeout(getDataTimer);
             clearTimeout(updateLineStateTimer);
-            if(player!=null && player.Native!=null && window.IN03Markers!=null){
-                window.IN03Markers.forEach(async ele=>{
-                    await player.Native.GisMarker.destroy(ele);
-                })
+            if(player!=null && player.Native!=null){
+                (async()=>{
+                            let marklst = await player.Native.GisMarker.getMarkerList();
+                            if(marklst!=null){
+                                for(var i=0;i<marklst.length;i++){
+                                    if(player!=null && player.Native!=null)player.Native.GisMarker.destroy(marklst[i].id)
+                                }
+                            }
+                })();
             }
             window.IN03Markers=null;
         })

+ 19 - 5
src/pages/main/index.vue

@@ -6,7 +6,7 @@
         <div v-if="!isLoaded" ref="loading" id="loading">正在进入系统中...</div>
         <div v-if="reconnect" class="reconnect">网络连接中断,正在进行重连...</div>
         <div v-if="loadProgressValue>0 && loadProgressValue<100" class="reconnect">
-            <div class="loadText">模型加载中...</div>
+            <div class="loadText">{{modelName}}模型加载中...</div>
             <div class="loadProgress" :style="{width:loadProgressValue+'%'}"></div>
         </div>
         <video ref="EngineContent" autoplay muted style="width: 1920px;height:1080px;">浏览器不支持</video>
@@ -21,7 +21,8 @@
     </div>
     <div id="iframeWin" v-if="isShowIframeWin" :class="iframeWinData.class">
         <div class="title"><span class="text" v-html="iframeWinData.title"></span><img src="../../assets/image/Close.png" style="margin: 7px 17px;float: right;cursor: pointer;" @click="CloseIframeWin"></div>
-        <div class="content"><iframe id="ifrm" :src="iframeWinData.src" class=""></iframe></div>
+        <div v-if="!isLoadedIframe" class="iframeLoading">正在进入页面中...</div>
+        <div class="content"><iframe id="ifrm" :src="iframeWinData.src" class="" @load="onIframeLoad"></iframe></div>
     </div>
 </template>
 <script>
@@ -51,13 +52,14 @@ export default {
         const EngineContent=ref(null);
         const reconnect=ref(false);
         const isShowIframeWin = ref(false);
+        const isLoadedIframe = ref(false);
         const iframeWinData = ref({});
         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);
+        const modelName = ref('');
         let isLoaded = ref(false);
         let isClearEle = ref(false);
         window.player = null;
@@ -91,8 +93,13 @@ export default {
                 src:info.src,
                 title:info.title
             };
+            isLoadedIframe.value = false;
             isShowIframeWin.value=true;
         }
+        function onIframeLoad(){
+            //
+            isLoadedIframe.value = true;
+        }
         function ShowLoading(){
             lottie.loadAnimation({
                 // 选取一个容器,用于渲染动画
@@ -213,6 +220,7 @@ export default {
                 for(let k in window.modelLoadState){
                     if(window.modelLoadState[k]==false) window.modelLoadState[k]=null;//重置模型加载状态
                 }
+                EngineContent.value.load();
                 EngineContent.value.play();
                 playerNative.value =Native;                
                 //模型加载完成监听处理
@@ -247,7 +255,7 @@ export default {
                 });
                 //模型加载中监听处理
                 Native.Model.EventProgress.connect(function(v,hander,name){  
-                    console.log(new Date().getTime()," ",name,":",v) 
+                    //console.log(new Date().getTime()," ",name,":",v) 
                     //当进度大于0.99时,交由EventProgressEnd监听处理            
                     if(window.CurrentTargetType!=name || v>0.99 ||v<1) return;
                     loadProgressValue.value = (v*100).toFixed(0);
@@ -350,10 +358,11 @@ export default {
         async function loadFacModel(Native){
             if(currentTargetType.value=="FAC") return;
             currentTargetType.value="FAC";
+            modelName.value = '全厂';
             await player.Native.Settings.set('ambientIndenty', 'float', 0.39);//初始化环境光补偿
             await player.Native.Settings.set('diffuseIntensity', 'float', 1.2);//初始化光线强度
             await player.Native.Settings.set('specularIntensity', 'float', 0.64);//初始化高光强度
-            if(modelLoadState[currentTargetType.value]==null){   
+            if(modelLoadState[currentTargetType.value]==null){
                 loadProgressValue.value = 1;   
                 modelLoadState['FAC']=false;          
                 var cf = "data://models/T_ALL.pr";
@@ -391,6 +400,7 @@ export default {
         }
         //印花
         async function loadIn03Model(Native){
+            modelName.value = '染整';
             player.Native.Settings.set('ambientIndenty', 'float', 1);//初始化环境光补偿
             player.Native.Settings.set('diffuseIntensity', 'float', 2.5);//初始化光线强度
             player.Native.Settings.set('specularIntensity', 'float', 0.6);//初始化高光强度
@@ -415,6 +425,7 @@ export default {
         }
         //经编
         async function loadIn02Model(Native){
+            modelName.value = '经编';
             player.Native.Settings.set('ambientIndenty', 'float', 0.39);//初始化环境光补偿
             player.Native.Settings.set('diffuseIntensity', 'float', 0.8);//初始化光线强度
             player.Native.Settings.set('specularIntensity', 'float', 0.64);//初始化高光强度
@@ -451,7 +462,9 @@ export default {
         })
         return {
             player,
+            modelName,
             isShowIframeWin,
+            isLoadedIframe,
             iframeWinData,
             facMarkerLClick,
             CloseIframeWin,
@@ -478,6 +491,7 @@ export default {
             getBottomBtnImg,
             markerLClickObj,
             loadNavModel,
+            onIframeLoad,
         }
     },
 }

+ 14 - 0
src/styles/main.css

@@ -161,6 +161,20 @@
         width: 100%;
         border: 0;       
     }
+    .iframeLoading{
+        position: absolute;
+        z-index: 10;
+        width: 200px;
+        text-align: center;
+        font-size: 16px;
+        height: 32px;
+        line-height: 32px;
+        margin-left: -100px;
+        left: 50%;
+        margin-top: -16px;
+        top: 50%;
+        color: #f4f4f4;
+    }
     .impWin .content,.impWin iframe{
         height: 160px !important;
         width: 100%;