Browse Source

匹配度分页效果

littleblue55 1 month ago
parent
commit
4bd7cbd782
1 changed files with 38 additions and 28 deletions
  1. 38 28
      src/views/match/index.vue

+ 38 - 28
src/views/match/index.vue

@@ -150,14 +150,20 @@
         sortable
       ></el-table-column>
     </el-table>
-    <el-pagination
+    <!-- <el-pagination
       v-show="total > 0"
       :total="total"
       :page.sync="matchForm.pageNum"
       :limit.sync="matchForm.pageSize"
-      @pagination="submit"
-    >
-    </el-pagination>
+      @pagination="getList"
+    /> -->
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="matchForm.pageNum"
+      :limit.sync="matchForm.pageSize"
+      @pagination="getList"
+    />
   </div>
 </template>
 <script>
@@ -336,32 +342,36 @@ export default {
         // this.$message.success("提交成功");
         // console.log(this.matchForm);
         this.tableData = [];
-        const loading = this.$loading({
-          lock: true,
-          text: "Loading",
-          spinner: "el-icon-loading",
-          background: "rgba(0, 0, 0, 0.7)",
-        });
-        analysisMatch(this.matchForm)
-          .then((res) => {
-            loading.close();
-            // console.log(res,"test")
-            if (res && res?.rows) {
-              this.total = res.total;
-              this.tableData = res.rows.map((item) => {
-                return {
-                  ...item,
-                  trueThreshold: parseFloat(item.trueThreshold).toFixed(4), // 转换并保留4位小数
-                };
-              });
-            }
-          })
-          .catch((err) => {
-            loading.close();
-            this.$message.error(err);
-          });
+        this.matchForm.pageNum = 1;
+        this.getList();
       }
     },
+    getList() {
+      const loading = this.$loading({
+        lock: true,
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      analysisMatch(this.matchForm)
+        .then((res) => {
+          loading.close();
+          // console.log(res,"test")
+          if (res && res?.rows) {
+            this.total = res.total;
+            this.tableData = res.rows.map((item) => {
+              return {
+                ...item,
+                trueThreshold: parseFloat(item.trueThreshold).toFixed(4), // 转换并保留4位小数
+              };
+            });
+          }
+        })
+        .catch((err) => {
+          loading.close();
+          this.$message.error(err);
+        });
+    },
     clearUnrelatedFields() {
       const { dataKey } = this.matchForm;
       if (dataKey === "powerConsume") {