linan 4 年之前
父節點
當前提交
fd23a3d3bf
共有 2 個文件被更改,包括 17 次插入15 次删除
  1. 15 13
      src/views/Home/Home.vue
  2. 2 2
      src/views/Login/Login.vue

+ 15 - 13
src/views/Home/Home.vue

@@ -109,25 +109,25 @@ export default {
     },
     created() {
         // 获取屠宰批次 给后面下拉选择器使用
-        this.$store.dispatch('getSlaughterBatchIdList')
+        this.$store.dispatch("getSlaughterBatchIdList");
 
         this.defaultUnfoldedMenu = [
             localStorage.getItem("defaultUnfoldedMenu")
         ];
         this.menuCollapse = JSON.parse(localStorage.getItem("menuCollapse"));
         /* 筛选菜单 */
-        var target = this.$route.query.target
-        if(target) {
-            localStorage.setItem("target", target)
+        var target = this.$route.query.target;
+        if (target) {
+            localStorage.setItem("target", target);
         } else {
-            target = localStorage.getItem('target')
+            target = localStorage.getItem("target");
         }
         this.filterMenu(target);
     },
     watch: {
         "$route.query.target"(v) {
-            if(v){
-                localStorage.setItem("target", v)
+            if (v) {
+                localStorage.setItem("target", v);
                 this.filterMenu(v);
             }
         }
@@ -139,12 +139,14 @@ export default {
         http://hzsheep.ifarmcloud.com/butcher/#/home?target=鲜肉储运智能管控
         http://hzsheep.ifarmcloud.com/yield
         */
-        /* 筛选菜单 http://localhost:8080/#/home?target=定点屠宰智能管控 */
-        /*  http://localhost:8080/#/home?target=定点屠宰智能管控   */
-        /*  http://localhost:8080/#/home?target=产品制作智能监控    */
-        /*  http://localhost:8080/#/home?target=鲜肉储运智能管控   */
+        /* 筛选菜单 */
+        /*  
+            http://localhost:8080/#/home?target=定点屠宰智能管控
+            http://localhost:8080/#/home?target=产品制作智能监控
+            http://localhost:8080/#/home?target=鲜肉储运智能管控
+        */
         filterMenu(target) {
-            console.log(target)
+            console.log(target);
             let path;
             switch (target) {
                 case "定点屠宰智能管控":
@@ -162,7 +164,7 @@ export default {
             }
             this.menuData = menuData.filter(func);
             if (path && path != this.$route.name) {
-                this.$router.push({name: path});
+                this.$router.push({ name: path });
             }
         },
         // 收取菜单按钮

+ 2 - 2
src/views/Login/Login.vue

@@ -108,8 +108,8 @@ export default {
                     this.$router.push({
                         path: "/home",
                         query: {
-                            // target: "定点屠宰智能管控"
-                            target: "产品制作智能监控"
+                            target: "定点屠宰智能管控"
+                            // target: "产品制作智能监控"
                             // target: "鲜肉储运智能管控"
                         }
                     });