deepsea 1 год назад
Родитель
Сommit
04941a8064
2 измененных файлов с 57 добавлено и 14 удалено
  1. 30 8
      src/components/BenchDetail/index.vue
  2. 27 6
      src/components/SearchBar/index.vue

+ 30 - 8
src/components/BenchDetail/index.vue

@@ -161,11 +161,24 @@ export default {
             bExist = true;
             if(objRBL.length == 1)
             {
-              window.location.href = '/originPage?m=8b934420_ZJUb_b6f9&benchid='+benchId;
+              this.$router.push({
+                path: '/',
+                query:{
+                  m: '8b934420_ZJUb_b6f9',
+                  benchid: benchId
+                }
+              })
+              this.$store.dispatch('common/setSquareStatus', false)
             }
             else
             {
-              window.location.href = '/squarePage?m=8b934420_ZJUb_b6f9';
+              this.$router.push({
+                path: '/',
+                query:{
+                  m: '8b934420_ZJUb_b6f9'
+                }
+              })
+              this.$store.dispatch('common/setSquareStatus', true)
             }
             
           }
@@ -174,7 +187,13 @@ export default {
         {
           objRBL.push(benchId);
           window.localStorage.setItem('remoteBenchList',JSON.stringify(objRBL));
-          window.location.href = '/squarePage?m=8b934420_ZJUb_b6f9';
+          this.$router.push({
+            path: '/',
+            query:{
+              m: '8b934420_ZJUb_b6f9'
+            }
+          })
+          this.$store.dispatch('common/setSquareStatus', true)
         }
       }
       else
@@ -182,12 +201,15 @@ export default {
         var rml= [];
         rml.push(benchId);
         window.localStorage.setItem('remoteBenchList',JSON.stringify(rml));
-        window.location.href = '/originPage?m=8b934420_ZJUb_b6f9&benchid='+benchId;
+        this.$router.push({
+          path: '/',
+          query:{
+            m: '8b934420_ZJUb_b6f9',
+            benchid: benchId
+          }
+        })
+        this.$store.dispatch('common/setSquareStatus', false)
       }
-      //window.location.href = '/originPage?m=8b934420_ZJUb_b6f9';
-      //window.parent.postMessage({
-      //  benchId: this.bench.id
-      //}, '*');
     }
   }
 };

+ 27 - 6
src/components/SearchBar/index.vue

@@ -51,16 +51,32 @@ export default {
     },
     goBack() {
       if (window.location.href.indexOf("squarePage") !== -1) {
-        window.location.href = "/?m=8b934420_ZJUb_b6f9";
-      } else if (window.location.href.indexOf("originPage") !== -1) {
-        window.location.href = "/squarePage";
+        this.$router.push({
+          path: '/home',
+          query:{
+            m: '8b934420_ZJUb_b6f9'
+          }
+        })
+      } else if (window.location.href.indexOf("ordinaryPage") !== -1) {
+        this.$store.dispatch('common/setSquareStatus', true)
       }
     },
     modeChange() {
-      if (window.location.href.indexOf("home") !== -1) {
-        window.location.href = "/?m=8b934420_ZJUb_b6f9";
+      if (window.location.href.indexOf("ordinaryPage") !== -1) {
+        this.$router.push({
+          path: '/home',
+          query:{
+            m: '8b934420_ZJUb_b6f9'
+          }
+        })
       } else {
         this.$store.dispatch('common/setSquareStatus', false)
+        this.$router.push({
+          path: '/',
+          query:{
+            m: '8b934420_ZJUb_b6f9'
+          }
+        })
       }
     },
     goMantis() {
@@ -73,7 +89,12 @@ export default {
       window.open("http://139.196.158.57/#/Overview", "_blank");
     },
     goHome() {
-      window.location.href = "/?m=8b934420_ZJUb_b6f9";
+      this.$router.push({
+        path: '/',
+        query:{
+          m: '8b934420_ZJUb_b6f9'
+        }
+      })
     },
   },
 };