deepsea 1 ano atrás
pai
commit
2e5c360026

BIN
public/.DS_Store


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

@@ -153,8 +153,6 @@ export default {
     },
     postMessage() {
       let benchId = this.bench.id;
-      var strRemoteBenchList = window.localStorage.getItem('remoteBenchList');
-      var objRBL = JSON.parse(strRemoteBenchList);
       this.$emit('changeCurrentBench', benchId)
     },
     routerToBmt(){

+ 2 - 1
src/views/ordinaryPage/index.less

@@ -35,7 +35,8 @@
         width: 100%;
         height: 100%;
         border-radius: 40px;
-
+        position: absolute;
+        z-index: 999;
         // margin-left: -35vw;
         // margin-top: -31vh;
         img {

+ 44 - 157
src/views/ordinaryPage/index.vue

@@ -89,108 +89,8 @@
             </div>
           </div>
 
-          <div class="ordinary-map-hidden" v-if="false">
+          <div class="ordinary-map-hidden">
             <div class="ordinary-map-blocker" id="ordinary-map-blocker">
-              <Transition name="slide">
-                <div class="bmMap" v-if="!benchDisplayVisible">
-                  <dropdown :is-open="isOpen" ref="dropdown">
-                    <template v-slot:table>
-                      <table-component
-                        :data="filterBenchList"
-                        :filters="filters"
-                        :row-class-name="rowClassName"
-                      ></table-component>
-                    </template>
-                  </dropdown>
-                  <div class="bmMapImage">
-                    <div
-                      v-for="(item, key) in benchList"
-                      :key="key"
-                      class="bmMapItem el-icon-location"
-                      :style="{
-                        left: item.left + 'px',
-                        top: item.top + 'px',
-                        scale: item.scale,
-                      }"
-                      :class="item.status"
-                      @click="bmMapItemSelect(key)"
-                      @mouseover="bmMapItemSelect(key)"
-                      @mouseleave="bmMapItemUnSelect(item.id)"
-                    >
-                      <Transition v-if="false">
-                        <template>
-                          <div
-                            class="bmMapItemInfo"
-                            :class="{
-                              bmMapItemInfoSelected: item.selected,
-                            }"
-                          >
-                            <span>
-                              {{ item.name }}
-                            </span>
-                            <span style="display: flex; align-items: center">
-                              {{ item.Project }}
-                            </span>
-                            <div style="width: 100%">
-                              <span
-                                class="bmInfoMsSlideNameStatus"
-                                :class="{
-                                  ['bmInfoMsSlideNameStatus ' +
-                                  item.status]: true,
-                                }"
-                              ></span>
-                            </div>
-                            <!-- <div class="bmMapItemInfoAfter"></div> -->
-                          </div>
-                        </template>
-                      </Transition>
-                    </div>
-
-                    <div
-                      v-for="(item, key) in benchList"
-                      :key="key + item.id"
-                      class="bmMapItem"
-                      :style="{
-                        left: item.left - 73 + 'px',
-                        top: item.top - 390 + 'px',
-                        scale: item.scale,
-                      }"
-                      :class="item.status"
-                      @click="bmMapItemSelect(key)"
-                      @mouseover="bmMapItemSelect(key)"
-                      @mouseout="bmMapItemUnSelect(item.id)"
-                    >
-                      <Transition v-if="item.selected">
-                        <template>
-                          <div
-                            class="bmMapItemInfo"
-                            :class="{
-                              bmMapItemInfoSelected: item.selected,
-                            }"
-                          >
-                            <span>
-                              {{ item.name }}
-                            </span>
-                            <span style="display: flex; align-items: center">
-                              {{ item.Project }}
-                            </span>
-                            <div style="width: 100%">
-                              <span
-                                class="bmInfoMsSlideNameStatus"
-                                :class="{
-                                  ['bmInfoMsSlideNameStatus ' +
-                                  item.status]: true,
-                                }"
-                              ></span>
-                            </div>
-                            <!-- <div class="bmMapItemInfoAfter"></div> -->
-                          </div>
-                        </template>
-                      </Transition>
-                    </div>
-                  </div>
-                </div>
-              </Transition>
             </div>
           </div>
         </div>
@@ -791,7 +691,8 @@ export default {
       gridItems: [1, 2, 3, 4, 5, 6, 7, 8, 9],
       timerIdMap: { num: 0 },
       timerId: 0,
-      autoPlanResultInterval: 0
+      autoPlanResultInterval: 0,
+      remoteBenchList: []
     };
   },
   computed: {
@@ -923,31 +824,9 @@ export default {
     }, 1000)
 
     setTimeout(() => {
-      var readyCount = 0;
-      var occupiedCount = 0;
-      var offlineCount = 0;
-      console.log("this.benchList", this.benchList.length);
-      this.benchList.forEach((element) => {
-        //console.log('element',element);
-        if (element.status == "ready") {
-          readyCount++;
-        } else if (element.status == "error") {
-          offlineCount++;
-        } else if (element.status == "offline") {
-          offlineCount++;
-        } else {
-          occupiedCount++;
-        }
-      });
-
-      this.readyCount = readyCount;
-      this.offlineCount = offlineCount;
-      this.occupiedCount = occupiedCount;
-
       let self = this;
 
-      var strRemoteBenchList = window.localStorage.getItem("remoteBenchList");
-      var objRBL = JSON.parse(strRemoteBenchList);
+      var objRBL = this.remoteBenchList;
       if (objRBL) {
         console.log("objRBL", objRBL);
         wsArrayLength = objRBL.length;
@@ -1110,7 +989,6 @@ export default {
       }
     },
     submitAutoCase() {
-      debugger
       if (this.autoTaskStatus == 'waiting' || this.autoTaskStatus == 'running') {
         let plan = JSON.stringify(localStorage.getItem('autoCurrentTaskData'))
         let planId = plan.id || 0;
@@ -1178,7 +1056,6 @@ export default {
       //this.caseContent =,
     },
     turnNextCase() {
-      debugger;
       this.currentCaseIndex++;
       if (this.currentCaseIndex == this.caseList.length) {
         this.isShowCaseList = true;
@@ -1383,9 +1260,7 @@ export default {
           let href = window.location.href;
           if (href.indexOf("benchid=") != -1) {
             let benchid = href.substring(href.indexOf("benchid=") + 8);
-            let remoteBenchList = JSON.parse(
-              window.localStorage.getItem("remoteBenchList")
-            );
+            let remoteBenchList = this.remoteBenchList;
             console.log("benchid", benchid);
             console.log(
               "item == benchId",
@@ -1535,8 +1410,7 @@ export default {
           });
       }, 200);
       // 非全屏选择bench
-      var strRemoteBenchList = window.localStorage.getItem("remoteBenchList");
-      var objRBL = JSON.parse(strRemoteBenchList);
+      var objRBL = this.remoteBenchList;
       if (objRBL && objRBL.length > 0) {
         var bExist = false;
         for (var i = 0; i < objRBL.length; i++) {
@@ -1547,15 +1421,12 @@ export default {
         }
         if (bExist == false) {
           objRBL.push(benchId);
-          window.localStorage.setItem(
-            "remoteBenchList",
-            JSON.stringify(objRBL)
-          );
+          this.remoteBenchList.push(benchId)
         }
       } else {
         var rml = [];
         rml.push(benchId);
-        window.localStorage.setItem("remoteBenchList", JSON.stringify(rml));
+        this.remoteBenchList.push(benchId)
       }
 
       console.log("benchList", this.benchList);
@@ -1960,6 +1831,7 @@ export default {
 
     selectAllBench() {
       let self = this;
+      console.log('this.benchList===', this.benchList.length)
       if (this.selectedBenchList.length == this.benchList.length) {
         this.selectedBenchList = [];
         this.previousSelectedBenchList = [];
@@ -2328,16 +2200,14 @@ export default {
     disconnectBench() {
       ws.disconnectBench({ bench_id: String(this.connetedBenchId) }).then(
         (res) => {
-          var remoteBenchList = JSON.parse(
-            window.localStorage.getItem("remoteBenchList")
-          );
+          var remoteBenchList = this.remoteBenchList;
           let newRemoteBenchList = remoteBenchList.filter((item) => {
             return item != this.connetedBenchId;
           });
-          window.localStorage.setItem(
-            "remoteBenchList",
-            JSON.stringify(newRemoteBenchList)
-          );
+          while(this.remoteBenchList.length) {
+            this.remoteBenchList.pop();
+          }
+          newRemoteBenchList.forEach(e => this.remoteBenchList.push(e))
           this.$store.dispatch("benchList/removeBenchImgList", {
             benchId: this.connetedBenchId,
           });
@@ -2359,8 +2229,7 @@ export default {
       }
     },
     saveSelectedBenchToLs(benchId) {
-      var strRemoteBenchList = window.localStorage.getItem("remoteBenchList");
-      var objRBL = JSON.parse(strRemoteBenchList);
+      var objRBL = this.remoteBenchList;
       if (objRBL && objRBL.length > 0) {
         var bExist = false;
         for (var i = 0; i < objRBL.length; i++) {
@@ -2371,15 +2240,12 @@ export default {
         }
         if (bExist == false) {
           objRBL.push(benchId);
-          window.localStorage.setItem(
-            "remoteBenchList",
-            JSON.stringify(objRBL)
-          );
+          this.remoteBenchList.push(benchId)
         }
       } else {
         var rml = [];
         rml.push(benchId);
-        window.localStorage.setItem("remoteBenchList", JSON.stringify(rml));
+        this.remoteBenchList.push(benchId);
       }
     },
     handleListClick(benchId, itemtype) {
@@ -2590,10 +2456,11 @@ export default {
             //delete objRBL[i];
             objRBL.splice(i, 1);
             console.log("objRBL", objRBL);
-            window.localStorage.setItem(
-              "remoteBenchList",
-              JSON.stringify(objRBL)
-            );
+            while(this.remoteBenchList.length) {
+              this.remoteBenchList.pop()
+            }
+
+            objRBL.forEach(e => this.remoteBenchList.push(e))
 
             return;
           }
@@ -2616,8 +2483,7 @@ export default {
     },
     benchList(newValue, oldValue) {
       console.log("newValue", newValue);
-      var strRemoteBenchList = window.localStorage.getItem("remoteBenchList");
-      var objRBL = JSON.parse(strRemoteBenchList);
+      var objRBL = this.remoteBenchList;
       console.log("zmg1", objRBL);
       var objRBLReverse = [];
       for (; objRBL.length > 0; ) {
@@ -2642,6 +2508,27 @@ export default {
       //   uwbMain('player', window.innerWidth, window.innerHeight, "panorama");
       // }
     },
+    benchList(newValue, oldValue) {
+      var readyCount = 0;
+      var occupiedCount = 0;
+      var offlineCount = 0;
+      console.log("this.benchList", this.benchList.length);
+      this.benchList.forEach((element) => {
+        //console.log('element',element);
+        if (element.status == "ready") {
+          readyCount++;
+        } else if (element.status == "error") {
+          offlineCount++;
+        } else if (element.status == "offline") {
+          offlineCount++;
+        } else {
+          occupiedCount++;
+        }
+      });
+      this.readyCount = readyCount;
+      this.offlineCount = offlineCount;
+      this.occupiedCount = occupiedCount;
+    }
   },
 };
 </script>