Browse Source

事件列表:录入搜索条件,查询出结果集后翻页

JX.LI 2 years ago
parent
commit
46a559ae75
1 changed files with 11 additions and 5 deletions
  1. 11 5
      src/views/forest.vue

+ 11 - 5
src/views/forest.vue

@@ -365,11 +365,11 @@
               </div>
               <!--分页-->
               <div class="paging">
-                <el-button type="button" @click="getEventList(calendarDay, 10, pageNum - 1)">上一页
-                </el-button>
+                <el-button type="button" :disabled="nextbutton"
+                  @click="getEventList(calendarDay,10,pageNum-1,eventSearch)">上一页 </el-button>
                 <span>第{{pageNum}}页</span>
-                <el-button type="button" @click="getEventList(calendarDay, 10, pageNum + 1)">下一页
-                </el-button>
+                <el-button type="button" :disabled="nextbutton"
+                  @click="getEventList(calendarDay,10,pageNum+1,eventSearch)">下一页 </el-button>
               </div>
             </dv-border-box-13>
           </div>
@@ -544,6 +544,7 @@
     },
     data() {
       return {
+        nextbutton: false,
         title: "",
         // 搜索框
         // 搜索名称
@@ -1283,6 +1284,11 @@
           eventName: eventSearch
         }, loading).then(res => {
           this.eventList = res.data
+          if (res.data !== null && res.data.length !== 0) {
+            this.nextbutton = false
+          } else {
+            this.nextbutton = true
+          }
           if (this.eventList != null && this.eventList.length > 0) {
             if (this.eventList[0].eventStatusValue == 'forest_event_status_1') {
               that.$refs.bottomMenu.updateAlert();
@@ -1739,4 +1745,4 @@
       background-color: #0f3655;
     }
   }
-</style>
+</style>