From f56fc3c44f12024265abb7260143d25de3f49bb5 Mon Sep 17 00:00:00 2001
From: 晏有为 <13214124+yan-youwei@user.noreply.gitee.com>
Date: 星期一, 27 五月 2024 16:23:18 +0800
Subject: [PATCH] 客户管理添加,字段优化
---
src/view/notice.vue | 62 +++++++++++--------------------
1 files changed, 22 insertions(+), 40 deletions(-)
diff --git a/src/view/notice.vue b/src/view/notice.vue
index 4a10fef..bc84174 100644
--- a/src/view/notice.vue
+++ b/src/view/notice.vue
@@ -4,7 +4,7 @@
title="娑堟伅閫氱煡"
:visible.sync="drawer"
:direction="direction"
- :before-close="handleClose" style="height: 100vh;z-index: 9999999;">
+ :before-close="handleClose" style="height: 100vh;z-index: 9999999;" size="450px">
<div class="head">
<div class="head-search">
<label>娑堟伅绫诲瀷锛�</label>
@@ -34,10 +34,11 @@
</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">
- <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>
@@ -124,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
}
@@ -179,8 +190,8 @@
},
goNoticeDetail(row){
this.$axios.put(this.$api.informationNotification.triggerModificationStatusToRead+'/'+row.id).then(res => {
- this.drawer = false;
row.num = Math.random(100);
+ localStorage.setItem("noticeInfo", JSON.stringify(row))
this.$bus.$emit("change", JSON.stringify(row));
this.$parent.addTab({
v: "娑堟伅璇︽儏",
@@ -190,9 +201,12 @@
p: "abcd"
},29);
this.list = [];
+ this.keyMap = {};
this.currentPage = 1;
this.refresh();
+ this.$emit('goNoticeDetail')
})
+ this.drawer = false;
},
handleDropdown(e,row){
switch(e){
@@ -215,6 +229,7 @@
}
this.$message.success('鍒犻櫎鎴愬姛')
this.list = [];
+ this.keyMap = {};
this.currentPage = 1;
this.refresh()
}).catch(e => {
@@ -222,40 +237,9 @@
})
}).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.keyMap = {};
this.currentPage = 1;
this.refresh();
},
@@ -270,13 +254,11 @@
}
this.$message.success('鎿嶄綔鎴愬姛')
this.list = [];
+ this.keyMap = {};
this.currentPage = 1;
this.refresh();
})
}
- },
- destroyed() {
- window.removeEventListener("scroll", this.throttle(), false);
},
}
</script>
--
Gitblit v1.9.3