From ef48e4b7a4d34e63ffd2cb23c406f4da6eb72ed7 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期二, 14 五月 2024 13:42:26 +0800 Subject: [PATCH] 优化消息管理,标准库管理 --- src/view/notice.vue | 39 +++------------------------------------ 1 files changed, 3 insertions(+), 36 deletions(-) diff --git a/src/view/notice.vue b/src/view/notice.vue index 4a10fef..a6391f9 100644 --- a/src/view/notice.vue +++ b/src/view/notice.vue @@ -37,7 +37,8 @@ <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> @@ -192,6 +193,7 @@ this.list = []; this.currentPage = 1; this.refresh(); + this.$emit('goNoticeDetail') }) }, handleDropdown(e,row){ @@ -222,38 +224,6 @@ }) }).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; @@ -274,9 +244,6 @@ this.refresh(); }) } - }, - destroyed() { - window.removeEventListener("scroll", this.throttle(), false); }, } </script> -- Gitblit v1.9.3