From ef9eb48046f8dfbb3c18b0f45befcbeddbdf6899 Mon Sep 17 00:00:00 2001
From: value <z1292839451@163.com>
Date: 星期三, 29 五月 2024 03:56:23 +0800
Subject: [PATCH] 光纤配置数据回显和保存
---
src/components/view/a6-personnel-overview.vue | 54 +++++++++++++++++++++++++-----------------------------
1 files changed, 25 insertions(+), 29 deletions(-)
diff --git a/src/components/view/a6-personnel-overview.vue b/src/components/view/a6-personnel-overview.vue
index bf88add..9b7c972 100644
--- a/src/components/view/a6-personnel-overview.vue
+++ b/src/components/view/a6-personnel-overview.vue
@@ -46,7 +46,6 @@
}
.card li{
width: 320px;
- /* height: 170px; */
border-radius: 8px 8px 8px 8px;
box-shadow: 4px 4px 8px 0px rgba(51,51,51,0.04);
border: 1px solid #EEEEEE;
@@ -88,11 +87,12 @@
</div>
<div class="search_thing" style="padding-left: 30px;">
<el-button size="small" @click="refresh()">閲� 缃�</el-button>
- <el-button size="small" type="primary" @click="currentPage= 1,list=[],finishLoding = false,refreshTable()">鏌� 璇�</el-button>
+ <el-button size="small" type="primary" @click="currentPage= 1,list=[],finishLoding = false,keyMap = {},refreshTable()">鏌� 璇�</el-button>
</div>
</div>
- <div class="table" @scroll="scrollFn">
- <ul v-loading="loading" class="card">
+ <div class="table" v-loading="loading">
+ <scroll-pagination @load="refreshTable" :finishLoding="finishLoding" :list="list">
+ <ul class="card" style="margin-top: 10px;">
<li v-for="(m,i) in list" :key="i">
<el-image style="width: 80px;
height: 112px;" :src="javaApi+'/img/'+m.pictureUrl">
@@ -119,27 +119,18 @@
<div class="title">{{ m.name }}</div>
</li>
</ul>
- <div v-if="list.length<1&&!loading&&!isLoding" style="color:#909399;font-size:14px;text-align: center;margin-top:200px" >鏆傛棤鏁版嵁</div>
- <div v-if="list.length>0">
- <el-button
- v-if="isLoding"
- type="text"
- style="display: flex; margin: 0 auto; color: #909399"
- ><i class="el-icon-loading" style="font-size:20px"></i
- ></el-button>
- <el-button
- type="text"
- v-if="finishLoding"
- style="display: flex; margin: 0 auto; color: #909399"
- >宸茬粡娌℃湁鏇村鍟</el-button
- >
- </div>
+ </scroll-pagination>
+ <div v-if="list.length<1&&!loading" style="color:#909399;font-size:14px;text-align: center;margin-top:200px" >鏆傛棤鏁版嵁</div>
</div>
</div>
</template>
<script>
+import ScrollPagination from '../tool/scroll-paging.vue'
export default {
+ components: {
+ ScrollPagination
+ },
data() {
return {
entity:{
@@ -152,26 +143,30 @@
pageSize: 16, // 涓�椤�16鏉�
total: '',
loading: true, // 缁勪欢loading鐨勫睍绀�,榛樿涓簍rue
- isLoding: false, // 鍔犺浇涓紝loading鍥炬爣,榛樿涓簍rue
- finishLoding: false // 鍔犺浇瀹屾垚锛屾樉绀哄凡缁忔病鏈夋洿澶氫簡
+ finishLoding: false, // 鍔犺浇瀹屾垚锛屾樉绀哄凡缁忔病鏈夋洿澶氫簡
+ keyMap: {}
}
},
created() {
+ this.keyMap = {};
this.currentPage = 1;
this.list = [];
this.refreshTable();
},
methods: {
refreshTable() {
- if(this.currentPage>1){
- this.isLoding = true
- }else{
+ 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
}
- if(this.list.length==0){
- window.addEventListener("scroll", this.throttle(this.scrollFn, 20000));
- }
- this.$axios.post(this.$api.user.selectUserList,{
+ this.$axios.post(this.$api.user.selectPersonnelOverview,{
page: {
current: this.currentPage,
size: this.pageSize
@@ -195,13 +190,14 @@
if(this.total==this.list.length){
this.finishLoding = true;
}
+ this.currentPage++;
}
}
this.loading = false
- this.isLoding = false;
})
},
refresh() {
+ this.keyMap = {};
this.currentPage= 1;
this.list=[];
this.finishLoding = false;
--
Gitblit v1.9.3