diff --git a/jsowell-ui/src/main.js b/jsowell-ui/src/main.js index 48104b6f6..a6a9067c4 100644 --- a/jsowell-ui/src/main.js +++ b/jsowell-ui/src/main.js @@ -84,3 +84,15 @@ new Vue({ store, render: h => h(App) }) + +Vue.directive('selectLoadMore', { + bind (el, binding) { + // 获取element-ui定义好的scroll盒子 + const selectDom = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap') + selectDom .addEventListener('scroll', function () { + if (this.scrollHeight - this.scrollTop < this.clientHeight + 1) { + binding.value() + } + }) + } +}) diff --git a/jsowell-ui/src/views/pile/station/pileList.vue b/jsowell-ui/src/views/pile/station/pileList.vue index d390132e8..8db30fe5a 100644 --- a/jsowell-ui/src/views/pile/station/pileList.vue +++ b/jsowell-ui/src/views/pile/station/pileList.vue @@ -135,7 +135,10 @@ - + { + this.loading = false + this.getModelList() + }, 500) + }, + + // 分页查询 getModelList() { - listModel().then((response) => { - // console.log(this.modelList); + listModel(this.searchModelParam).then((response) => { + console.log("分页查询response", response); + this.modelTotal = response.total; this.modelList = response.rows; + this.loadMoreFlag = this.searchModelParam.pageSize <= this.modelTotal; }); }, /** 搜索按钮操作 */