Sfoglia il codice sorgente

会员管理重新搜索后自动回正第一页问题

Changpeng Duan 4 anni fa
parent
commit
e0cc78a8f7
1 ha cambiato i file con 13 aggiunte e 4 eliminazioni
  1. 13 4
      pc/src/views/Member.vue

+ 13 - 4
pc/src/views/Member.vue

@@ -228,12 +228,15 @@
                 </el-table-column>
             </el-table>
             <br>
+            <div  v-if="pageshow">
             <el-pagination
                     background
                     :total="pageination.total"
                     :page-size="pageination.pageItem"
                     @current-change="pageChange"
+                    :current-page.sync="cur_page"
             ></el-pagination>
+            </div>
         </div>
 
         <el-dialog :title="dialogTitle" :visible.sync="dialogMemberVisible"
@@ -446,6 +449,8 @@
                 TakeHid: 0,
                 start: 0,
                 draw: 1,
+                cur_page: 1,
+                pageshow: true,
                 sexOptions: [
                     {value: 1, label: '男'},//性别 1:男, 2:女
                     {value: 2, label: '女'},
@@ -1232,13 +1237,18 @@
             // 查询按钮
             query() {
                 let that = this;
-                that.start = 0
+                that.start = 0;
+                that.cur_page = 1;
                 that.serachBtnStatus = true;
                 that.getTableQuery();
+                this.pageshow = false;//让分页隐藏
+                this.$nextTick(() => {//重新渲染分页
+                    this.pageshow = true;
+                });
                 that.$message.success('查询完毕');
-                let totalTime = 2
+                let totalTime = 2;
                 let clock = window.setInterval(() => {
-                    totalTime--
+                    totalTime--;
                     if (totalTime < 0) {
                         totalTime = 2;
                         that.serachBtnStatus = false;
@@ -1300,7 +1310,6 @@
                 // 分页属性
                 let that = this;
                 that.pageination.total = that.recordsTotal;
-
                 // 默认分页
                 that.tableData = that.allTableData.filter((item, index) => {
                     return index < that.pageination.pageItem;