浏览代码

处理问题

zizhong.wang 4 年之前
父节点
当前提交
0dbf43e7eb
共有 5 个文件被更改,包括 72 次插入64 次删除
  1. 1 1
      src/App.vue
  2. 2 2
      src/components/HeaderBanner.vue
  3. 39 34
      src/views/data/InforList.vue
  4. 16 18
      src/views/data/UploadLink.vue
  5. 14 9
      src/views/data/UploadRecord.vue

+ 1 - 1
src/App.vue

@@ -161,7 +161,7 @@ export default {
   created() {
      this.loadingFlag = true;
      this.getData(); // 线上打开
-  //  this.localTest();// 本地调试打开
+    //this.localTest();// 本地调试打开
   },
 };
 </script>

+ 2 - 2
src/components/HeaderBanner.vue

@@ -82,7 +82,7 @@ export default {
         }
         p{
           padding:0;
-          font-size: 14px;
+          font-size: 13px;
         }
       }
       .login_out{
@@ -97,7 +97,7 @@ export default {
         }
         p{
           padding:0;
-          font-size: 14px;
+          font-size: 13px;
         }
       }
     }

+ 39 - 34
src/views/data/InforList.vue

@@ -116,6 +116,7 @@
 import TablePage from "../../components/TablePage";
 import Detail from "./components/InfoListItemDetail";
 import { env_url } from "../../config/env";
+// import func from 'vue-editor-bridge';
 export default {
   props: {
     isManufacturer: {
@@ -212,30 +213,6 @@ export default {
       }
     },
   },
-  watch: {
-    downLoadFlag:function (newValue) {
-      if(newValue) {
-        setTimeout (() => {
-          let data = {
-            informationName: this.searchName,
-            asc: this.timeSortVal == "dec" ? false : true,
-            report: "",
-            download: "",
-            Page: this.currentPage,
-            Rows: this.pageSize,
-            agentId: this.userId,
-          };
-          if (this.reportSortVal) {
-            data.report = this.reportSortVal === "already" ? true : false;
-          }
-          if (this.downloadSortVal) {
-            data.download = this.downloadSortVal === "already" ? true : false;
-          }
-          this.getDataListPage(data);
-        }, 1000)
-      }
-    }
-  },  
   methods: {
     // 获取某一页面的数据,展示在表格
     changePage: function (page) {
@@ -416,21 +393,49 @@ export default {
         day = day + "";
       }
       this.localDate = year + month + day;
+    },
+    pageRefreshList:function(){
+      this.getNowDate();
+      const req = {
+                asc: this.timeSortVal === "dec" ? false : true,
+                agentId: this.userId,
+                Page: this.currentPage,
+                Rows: this.pageSize,
+              };
+       this.getDataListPage(req);
     }
   },
-  mounted() {
-  },
-  activated() {
-    this.userId = localStorage.getItem("userId");
-    this.getNowDate();
-    const req = {
-            asc: false,
-            agentId: this.userId,
+  watch: {
+    // 如果路由发生变化,再次执行该方法
+    "$route": "pageRefreshList",
+     downLoadFlag:function (newValue) {
+      if(newValue) {
+        setTimeout (() => {
+          let data = {
+            informationName: this.searchName,
+            asc: this.timeSortVal == "dec" ? false : true,
+            report: "",
+            download: "",
             Page: this.currentPage,
             Rows: this.pageSize,
+            agentId: this.userId,
           };
-    this.getDataListPage(req);
-  }
+          if (this.reportSortVal) {
+            data.report = this.reportSortVal === "already" ? true : false;
+          }
+          if (this.downloadSortVal) {
+            data.download = this.downloadSortVal === "already" ? true : false;
+          }
+          this.getDataListPage(data);
+        }, 1000)
+      }
+    }
+  },
+  mounted() {
+    this.userId = localStorage.getItem("userId");
+    this.pageRefreshList();
+  },
+
 };
 </script>
 

+ 16 - 18
src/views/data/UploadLink.vue

@@ -728,27 +728,25 @@ export default {
     isFather: function () {
       return this.$route.path.length > 11 ? false : true;
     },
+    pageRefresh:function(){
+          this.getNowDate();
+          let config = {
+          Page: this.currentPage,
+          Rows: this.pageSize,
+          agentId: this.userId,
+        };
+        this.getDataList(config);
+     }
+  },
+  watch: {
+    // 如果路由发生变化,再次执行该方法
+    "$route": "pageRefresh"
   },
   mounted() {
+    this.userId = localStorage.getItem("userId");
+    this.pageRefresh();
   },
-  activated() {
-    this.getNowDate();
-    let localUserId = localStorage.getItem("userId");
-    if (localUserId) {
-      this.userId = localUserId;
-    } else {
-      this.userId = "";
-    }
-    // this.getPlatform();
-    // 分页取数据
-    let config = {
-      Page: this.currentPage,
-      Rows: this.pageSize,
-      agentId: this.userId,
-    };
-    this.getDataList(config);
-    //this.testRequest(config);
-  }
+ 
 };
 </script>
 

+ 14 - 9
src/views/data/UploadRecord.vue

@@ -219,17 +219,22 @@ export default {
           });
       });
     },
+    pageRefresh:function(){
+         let res = {
+          page: 1,
+          rows: this.pageSize,
+          asc: this.asc,
+        };
+        this.getFirmsUploadList(res);
+     }
   },
-  created() {
+  watch: {
+    // 如果路由发生变化,再次执行该方法
+    "$route": "pageRefresh"
+  },
+  mounted() {
+    this.pageRefresh()
   },
-  activated() {
-    let res = {
-      page: 1,
-      rows: this.pageSize,
-      asc: this.asc,
-    };
-    this.getFirmsUploadList(res);
-  }
 };
 </script>