From 2caf6c0b519300a24788b7cd8d57fb0c1f0b1a0e Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期二, 14 五月 2024 18:03:18 +0800 Subject: [PATCH] 优化 --- src/view/notice.vue | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/view/notice.vue b/src/view/notice.vue index a6391f9..be68420 100644 --- a/src/view/notice.vue +++ b/src/view/notice.vue @@ -34,7 +34,7 @@ </el-dropdown> </div> <div class="notice-content" v-loading="loading"> - <scroll-pagination @load="refresh" :finishLoding="finishLoding"> + <scroll-pagination @load="refresh" :finishLoding="finishLoding" :list="list"> <div class="notice-content-item" v-for="(m,i) in list" :key="i"> <div class="btns" v-if="m"> <!-- v-if="m.messageType==2||m.messageType==3" --> @@ -125,17 +125,27 @@ pageSize: 8, // 涓�椤�7鏉� total: null, loading: true, // 缁勪欢loading鐨勫睍绀�,榛樿涓簍rue - finishLoding: false // 鍔犺浇瀹屾垚锛屾樉绀哄凡缁忔病鏈夋洿澶氫簡 + finishLoding: false, // 鍔犺浇瀹屾垚锛屾樉绀哄凡缁忔病鏈夋洿澶氫簡 + keyMap:{} } }, mounted(){ this.getTypeDicts(); this.currentPage = 1; + this.keyMap = {}; this.list = []; this.refresh(); }, methods:{ refresh(){ + const key = `_${this.currentPage}` + const value = this.keyMap[key] + // 濡傛灉value瀛樺湪锛岃〃绀虹紦瀛樻湁鍊硷紝閭d箞闃绘璇锋眰 + if(value) { + return + } + // value涓嶅瓨鍦紝琛ㄧず绗竴娆¤姹�,璁剧疆鍗犱綅 + this.keyMap[key] = 'temp' if(this.currentPage==1){ this.loading = true } @@ -191,6 +201,7 @@ p: "abcd" },29); this.list = []; + this.keyMap = {}; this.currentPage = 1; this.refresh(); this.$emit('goNoticeDetail') @@ -217,6 +228,7 @@ } this.$message.success('鍒犻櫎鎴愬姛') this.list = []; + this.keyMap = {}; this.currentPage = 1; this.refresh() }).catch(e => { @@ -226,6 +238,7 @@ }, handleType(){ this.list = []; + this.keyMap = {}; this.currentPage = 1; this.refresh(); }, @@ -240,6 +253,7 @@ } this.$message.success('鎿嶄綔鎴愬姛') this.list = []; + this.keyMap = {}; this.currentPage = 1; this.refresh(); }) -- Gitblit v1.9.3