deepsea 1 year ago
parent
commit
06e3f1573c
3 changed files with 10 additions and 1 deletions
  1. 4 0
      src/store/modules/bench/mutations.js
  2. 3 0
      src/uwb-sample.js
  3. 3 1
      src/views/ordinaryPage/index.vue

+ 4 - 0
src/store/modules/bench/mutations.js

@@ -1,5 +1,6 @@
 export default {
   setBenchList(state, benchList) {
+    
     benchList.forEach((bench, i) => {
       bench.groups = JSON.parse(bench.groups)
       let basicInfo = bench.groups["Basic Information"]
@@ -39,6 +40,7 @@ export default {
   setBenchDetail(state, bench) {
     let benchTemp = state.benchMap[bench.id];
     let benchObject = state.benchList.find(b => b.id == bench.id)
+    let benchFilterObject = state.filterBenchList.find(b => b.id == bench.id)
     benchTemp.status = bench.equipment[0].status;
     benchTemp.name = bench.name;
     benchTemp.type = bench.bench_type;
@@ -47,6 +49,8 @@ export default {
     benchTemp.equipment = bench.equipment[0];
     benchTemp.slave = bench.equipment[0].slave;
 
+    benchFilterObject.status = bench.equipment[0].status;
+
     if (!state.statusOptions.some(s => s.value == bench.equipment[0].status)) {
       state.statusOptions.push({
         value: bench.equipment[0].status,

+ 3 - 0
src/uwb-sample.js

@@ -146,6 +146,9 @@ function getsqlData(sdkInstance, uwbInstance) {
             texture = textureOffline;
           }
           
+          if (window.waterMap[bench_id]) {
+            sdkInstance.sceneRenderer.scene.remove(window.waterMap[bench_id]);
+          }
 
           // 创建精灵对象
           let spriteMaterial = new THREE.SpriteMaterial({

+ 3 - 1
src/views/ordinaryPage/index.vue

@@ -784,6 +784,9 @@ export default {
     that.timerId = that.myInterval((count) => {
       // console.log(count)
       this.$store.dispatch("benchList/fetchBenchList");
+      if (count % 5 == 0) {
+        window.getsqlData(window.sdkInstance, window.uwbInstance)
+      }
       if (count > 30000) {
         console.log("end");
         that.clearMyInterval(that.timerId);
@@ -2501,7 +2504,6 @@ export default {
       var offlineCount = 0;
       let newStr = newValue.map(s => s.status).join();
       let oldStr = oldValue.map(s => s.status).join();
-      debugger
       if (newStr != oldStr) {
         window.getsqlData(window.sdkInstance, window.uwbInstance)
       }