| | |
| | | <scroll-pagination @load="refresh" :finishLoding="finishLoding"> |
| | | <div class="notice-content-item" v-for="(m,i) in list" :key="i"> |
| | | <div class="btns" v-if="m"> |
| | | <el-dropdown style="margin-right: 20px;" trigger="click" @command="e=>handleDropdown(e,m)" v-if="m.messageType==2||m.messageType==3"> |
| | | <!-- v-if="m.messageType==2||m.messageType==3" --> |
| | | <el-dropdown style="margin-right: 20px;" trigger="click" @command="e=>handleDropdown(e,m)" v-if="false"> |
| | | <span class="el-dropdown-link"> |
| | | <span class="more" style="line-height: 26px;display: inline-block;">···</span> |
| | | </span> |
| | |
| | | this.list = []; |
| | | this.currentPage = 1; |
| | | this.refresh(); |
| | | this.$emit('goNoticeDetail') |
| | | }) |
| | | }, |
| | | handleDropdown(e,row){ |
| | |
| | | }) |
| | | }).catch(() => {}) |
| | | }, |
| | | // 滚动触底加载 |
| | | scrollFn() { |
| | | let clientHeight = document.documentElement.clientHeight - 18; //可视区域 |
| | | let scrollHeight = document.body.scrollHeight; // 滚动文档高度 |
| | | let scrollTop = parseInt(document.documentElement.scrollTop); // 已滚动的高度 |
| | | let height = 300; |
| | | if ( |
| | | scrollTop + clientHeight >= scrollHeight - height && |
| | | scrollHeight != 0 |
| | | ) { |
| | | if (!this.finishLoding&&this.currentPage*this.pageSize<this.total) { |
| | | this.currentPage = this.currentPage + 1; |
| | | this.refresh(); |
| | | } |
| | | } else { |
| | | return false; |
| | | } |
| | | }, |
| | | throttle(fn, wait) { |
| | | // 封装函数进行节流 |
| | | var timer = null; |
| | | return function () { |
| | | var context = this; |
| | | var args = arguments; |
| | | if (!timer) { |
| | | timer = setTimeout(function () { |
| | | fn.apply(context, args); |
| | | timer = null; |
| | | }, wait); |
| | | } |
| | | }; |
| | | }, |
| | | handleType(){ |
| | | this.list = []; |
| | | this.currentPage = 1; |
| | |
| | | this.refresh(); |
| | | }) |
| | | } |
| | | }, |
| | | destroyed() { |
| | | window.removeEventListener("scroll", this.throttle(), false); |
| | | }, |
| | | } |
| | | </script> |