deepsea há 1 ano atrás
pai
commit
339f96ed27

+ 33 - 0
public/libs/tools.js

@@ -0,0 +1,33 @@
+function sleep(delay) {
+  var start = new Date().getTime();
+    while (new Date().getTime() - start < delay) {
+      continue;
+    }
+  }
+  
+Date.prototype.Format = function (fmt) {
+  //author: meizz
+  var o = {
+      "M+": this.getMonth() + 1, //月份
+      "d+": this.getDate(), //日
+      "h+": this.getHours(), //小时
+      "m+": this.getMinutes(), //分
+      "s+": this.getSeconds(), //秒
+      "q+": Math.floor((this.getMonth() + 3) / 3), //季度
+      S: this.getMilliseconds(), //毫秒
+  };
+  if (/(y+)/.test(fmt))
+      fmt = fmt.replace(
+      RegExp.$1,
+      (this.getFullYear() + "").substr(4 - RegExp.$1.length)
+      );
+  for (var k in o)
+      if (new RegExp("(" + k + ")").test(fmt))
+      fmt = fmt.replace(
+          RegExp.$1,
+          RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)
+      );
+  return fmt;
+};
+  
+  

+ 9 - 1
src/api/plan.js

@@ -46,7 +46,7 @@ export const getPlanResult = (data) => {
     console.log('httpRequest-' + 'getPlanResult');
     return api('/execution/overView/testResultList',{
         method: 'POST',
-        param
+        data
     });
 }
 
@@ -55,3 +55,11 @@ export const getAutoPlanDetail = (planId) => {
     method: 'GET'
   })
 }
+
+export const updateDmapCase = (data) => {
+  console.log('httpRequest-' + 'updateDmapCase');
+  return api('/mantis-test/v1.0.0/mantis/update/digital/map/case', {
+    method: 'POST',
+    data
+  });
+}

+ 2 - 0
src/components/SearchBar/index.vue

@@ -77,6 +77,8 @@ export default {
       //     m: '8b934420_ZJUb_b6f9'
       //   }
       // })
+      this.$store.dispatch("common/set3dStatus", false);
+      this.$store.dispatch("common/setSquareStatus", false);
     },
     goSquare(){
       this.$store.dispatch("common/set3dStatus", false);

+ 6 - 0
src/store/modules/common/mutations.js

@@ -86,5 +86,11 @@ export default {
   },
   toggle3dStatus(state) {
     state.isOpen3d = !state.isOpen3d;
+    if (state.isOpen3d) {
+      sessionStorage.setItem('3dMode', 1)
+    } else {
+      sessionStorage.setItem('3dMode', 0)
+    }
+    
   }
 };

Diff do ficheiro suprimidas por serem muito extensas
+ 371 - 706
src/uwb-sample.js


+ 0 - 27
src/views/dealCenter/list.vue

@@ -60,7 +60,6 @@ export default {
     })
   },
   created() {
-    // this.loadBench()
     console.log("Alex13 created")
     window.handleListClick = this.handleListClick;
     uwbMain(window.innerWidth, window.innerHeight, "panorama");
@@ -94,32 +93,6 @@ export default {
       this.currentBench = this.benchList.find(b => b.id == benchId);
       this.isRemoteBtnVisible = showRemoteButton;
       this.isDetailVisible = true;
-    },
-    loadBench() {
-      const bench = new FBXLoader();
-      bench.load("../models/flower.gltf", function (fbx) {
-        console.log("控制台查看加载gltf文件返回的对象结构", fbx);
-        //fbx.translateY(0);
-        //fbx.translateY(2);
-        //fbx.translateY(0);
-        fbx.setScale(100, 100, 100)
-        fbx.geometry = new THREE.ConeGeometry(radius, height, segments);
-        fbx.material = new THREE.MeshBasicMaterial({color: color,opacity:0.2,transparent: true,});;
-        cone.add(fbx)
-        //cone.add(fbx)
-        
-        meshes[0].push(fbx);
-        sdkInstance.sceneRenderer.scene.add(fbx.scene)
-        console.log("meshes", fbx);
-
-        fbx.scene.traverse((child) => {
-          //if (child instanceof THREE.Mesh)
-          {
-            console.log("Mesh", child);
-            meshes[0].push(child);
-          }
-        });
-      });
     }
   },
 };

+ 24 - 35
src/views/ordinaryPage/index.vue

@@ -1,12 +1,12 @@
 <template>
   <div>
-    <div class="container" v-show="isOpen3d">
+    <div class="container" v-if="isOpen3d">
       <SearchBarMain/>
       <div class="vr-bg" id="vr-bg-container"></div>
       <div id="player" style="width: 100%; height: 100%"></div>
       <bench-detail :is-detail-visible="isDetailVisible" :is-remote-btn-visible="isRemoteBtnVisible" :closeDetail="closeDetail" :bench="currentBench" />
     </div>
-    <div class="ordinary-container" v-show="!isOpen3d" @click="onBlur">
+    <div class="ordinary-container" v-else @click="onBlur">
       <div class="ordinary-left">
         <SearchBar
           class="search-container"
@@ -57,7 +57,7 @@
           <div class="ordinary-map" id="ordinary-map">
             <!-- <img src="../../images/map.png" /> -->
             <div class="vr-bg" id="vr-bg-container"></div>
-            <div id="player"></div>
+            <div id="playersmall"></div>
             <dropdown :is-open="isOpen" ref="dropdown">
               <template v-slot:table>
                 <table-component
@@ -758,9 +758,11 @@ export default {
         orderkey: "id",
       },
       benchImgUpper: "",
+      benchImgUpperMap: {},
       currentScreen: "upper",
       benchDisplayLowerVisible: false,
       benchImgLower: "",
+      benchImgLowerMap: {},
       isPlaying: false,
       isRecording: false,
       loopSendAudioTime: null,
@@ -838,7 +840,7 @@ export default {
     }),
   },
   created() {
-    uwbMain(window.innerWidth, window.innerHeight, "panorama");
+    uwbMain('player', window.innerWidth, window.innerHeight, "panorama");
     ws.open().then((res) => {
       // console.log("res", res);
     });
@@ -887,11 +889,6 @@ export default {
   },
   async mounted() {
     that = this;
-    let mapDom = document.getElementsByClassName("ordinary-map")[0];
-    let style = getComputedStyle(mapDom);
-    let width = parseFloat(style.width);
-    let height = parseFloat(style.height);
-    // uwbMain(width, height, "floorplan");
     //this.getBenchList();
     console.log(this.benchList, "benchList");
     this.tabs[0].list = this.benchList;
@@ -1051,32 +1048,6 @@ export default {
     clearMyInterval(intervalId) {
         delete this.timerIdMap[intervalId]
     },
-    loadBench() {
-      const bench = new FBXLoader();
-      bench.load("../models/flower.gltf", function (fbx) {
-        console.log("控制台查看加载gltf文件返回的对象结构", fbx);
-        //fbx.translateY(0);
-        //fbx.translateY(2);
-        //fbx.translateY(0);
-        fbx.setScale(100, 100, 100)
-        fbx.geometry = new THREE.ConeGeometry(radius, height, segments);
-        fbx.material = new THREE.MeshBasicMaterial({color: color,opacity:0.2,transparent: true,});;
-        cone.add(fbx)
-        //cone.add(fbx)
-        
-        meshes[0].push(fbx);
-        sdkInstance.sceneRenderer.scene.add(fbx.scene)
-        console.log("meshes", fbx);
-
-        fbx.scene.traverse((child) => {
-          //if (child instanceof THREE.Mesh)
-          {
-            console.log("Mesh", child);
-            meshes[0].push(child);
-          }
-        });
-      });
-    },
     turnToNextManualCase() {},
     clickBackToTaskList() {
       this.isShowPlanList = false;
@@ -2466,9 +2437,11 @@ export default {
           func();
           if (screenType == 1) {
             self.benchImgUpper = "data:image/png;base64," + res.data.data;
+            self.benchImgUpperMap[benchId] = "data:image/png;base64," + res.data.data;
             bus.emit("benchImgChange", { benchImgUpper: self.benchImgUpper });
           } else {
             self.benchImgLower = "data:image/png;base64," + res.data.data;
+            self.benchImgLowerMap[benchId] = "data:image/png;base64," + res.data.data;
             bus.emit("benchImgChange", { benchImgLower: self.benchImgLower });
           }
           // let screen = res.data.screen_type;
@@ -2484,6 +2457,8 @@ export default {
       }, 500);
     },
     handleDblClickImg(benchId) {
+      this.benchImgUpper = this.benchImgUpperMap[benchId];
+      this.benchImgLower = this.benchImgLowerMap[benchId];
       this.$store.dispatch('common/setSquareStatus', false)
     },
     handleClickImg(benchId, indexParam) {
@@ -2597,6 +2572,20 @@ export default {
         }, 300);
       }
     },
+    isOpen3d(newValue, oldValue) {
+      if (!newValue) {
+        this.$nextTick(() => {
+          let mapDom = document.getElementsByClassName("ordinary-map")[0];
+          let style = getComputedStyle(mapDom);
+          let width = parseFloat(style.width);
+          let height = parseFloat(style.height);
+          uwbMain('playersmall', width, height, "floorplan");
+        })
+        
+      } else {
+        uwbMain('player', window.innerWidth, window.innerHeight, "panorama");
+      }
+    }
   },
 };
 </script>