Forráskód Böngészése

资料列表条件搜索修改,分页修改

liuYb 4 éve%!(EXTRA string=óta)
szülő
commit
0e83ba7694
1 módosított fájl, 66 hozzáadás és 44 törlés
  1. 66 44
      src/views/data/InforList.vue

+ 66 - 44
src/views/data/InforList.vue

@@ -5,9 +5,15 @@
       <div class="search HeadLeft">
         <div class="input">
           <img src="../../img/search.png" />
-          <input type="text" name="" id="" placeholder="请输入要搜索的资料名" />
+          <input
+            type="text"
+            name=""
+            id=""
+            placeholder="请输入要搜索的资料名"
+            v-model="searchName"
+          />
         </div>
-        <button>搜索</button>
+        <button @click="searchByName">搜索</button>
       </div>
       <!--    <div class="searchBox">
         <div class="search_inside">
@@ -19,39 +25,24 @@
       <div class="sortBox">
         <div class="sort_inside">
           <span>是否下载</span>
-          <select
-            name=""
-            id="isDownload"
-            @change="sortByDownload"
-            v-model="downloadSortVal"
-          >
+          <select name="" id="isDownload" v-model="downloadSortVal">
             <option value="">不限</option>
             <option value="already">已下载</option>
             <option value="notyet">未下载</option>
           </select>
           <span>是否反馈</span>
-          <select
-            name=""
-            id="isReturn"
-            @change="sortByReport"
-            v-model="reportSortVal"
-          >
+          <select name="" id="isReturn" v-model="reportSortVal">
             <option value="">不限</option>
             <option value="already">已反馈</option>
-            <option value="">未反馈</option>
+            <option value="notyet">未反馈</option>
           </select>
           <span>排序</span>
-          <select
-            name=""
-            id="timeSort"
-            @change="sortByTime"
-            v-model="timeSortVal"
-          >
-            <option value="asc">时间降序</option>
-            <option value="">时间升序</option>
+          <select name="" id="timeSort" v-model="timeSortVal">
+            <option value="">时间降序</option>
+            <option value="asc">时间升序</option>
           </select>
         </div>
-        <button>确定</button>
+        <button @click="searchByCondition">确定</button>
       </div>
       <div class="tableD">
         <div class="table_template">
@@ -104,7 +95,7 @@
           @change_page="changePage"
           @jump_page="jumpPage"
         />
-        <p>共{{ 1 }}页,共{{ 3 }}条数据</p>
+        <p>共{{ totalPage }}页,共{{ sum }}条数据</p>
       </div>
     </div>
     <div v-else>
@@ -133,6 +124,7 @@ export default {
   },
   data() {
     return {
+      searchName: "",
       timeSortVal: "",
       reportSortVal: "",
       downloadSortVal: "",
@@ -242,17 +234,6 @@ export default {
       }
       console.log(this.currentPage);
     },
-    submit: function () {
-      console.log(this.totalPage);
-      this.sum = this.sum + 1;
-      console.log(
-        this.inforName,
-        this.inforDes,
-        this.materialTime,
-        this.range,
-        this.addByCustomize
-      );
-    },
     //下载文件
     downloadPost: function (config) {
       console.log("下载文件:", config);
@@ -290,6 +271,26 @@ export default {
           console.log(res);
           if (res.data.code === 200) {
             this.tableData = res.data.data;
+            this.sum = res.data.count;
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+    //获取新的资料列表
+    newGetDataList: function (config) {
+      console.log("new Getdata1", config);
+      this.$http({
+        url: "/firmsUploadListByAgent",
+        method: "post",
+        data: config,
+      })
+        .then((res) => {
+          console.log("new Getdata2", res);
+          if (res.data.code === 200) {
+            this.tableData = res.data.data;
+            this.sum = res.data.count;
           }
         })
         .catch((err) => {
@@ -297,21 +298,22 @@ export default {
         });
     },
     //以时间排序
-    sortByTime: function () {
-      let asc = this.timeSortVal === "asc" ? true : false;
+    /*     sortByTime: function () {
+      let asc = this.timeSortVal === "asc" ? false : true;
       let data = {
         asc: asc,
       };
-      this.getDataList(data);
-    },
-    //反馈标识
-    sortByReport: function () {
+      this.newGetDataList(data);
+    }, */
+    //反馈筛选
+    /* sortByReport: function () {
       let reportId = this.reportSortVal === "already" ? true : false;
       let data = {
         reportId: reportId,
       };
-      this.getDataList(data);
-    },
+      this.newGetDataList(data);
+    }, */
+    //下载筛选
     sortByDownload: function () {
       if (this.downloadSortVal === "notyet") {
         console.log("notyet");
@@ -319,6 +321,26 @@ export default {
         console.log("already");
       }
     },
+    //搜索资料名
+    searchByName: function () {
+      console.log("insearchByName", this.searchName);
+      let searchName = this.searchName;
+      let data = {
+        informationName: searchName,
+      };
+      this.newGetDataList(data);
+    },
+
+    searchByCondition: function () {
+      console.log("insearchByCondition", this.searchName);
+      let asc = this.timeSortVal === "asc" ? false : true;
+      let reportId = this.reportSortVal === "already" ? true : false;
+      let data = {
+        asc: asc,
+        reportId: reportId,
+      };
+      this.newGetDataList(data);
+    },
   },
   mounted() {
     this.getDataList();