| | |
| | | </div> |
| | | </div> |
| | | <div class="center" v-loading="pageLoading"> |
| | | <scroll-pagination @load="init" :finishLoding="finishLoding" v-show="query.month&&list.length>0" style="height: 100%;" :key="'123'"> |
| | | <scroll-pagination @load="init" :finishLoding="finishLoding" v-show="query.month&&list.length>0" style="height: 100%;" :key="'123'" :list="list"> |
| | | <div class="clearfix"> |
| | | <div class="fixed-left"> |
| | | <div class="content-title" style="padding-left: 16px;box-sizing: border-box;"> |
| | |
| | | </div> |
| | | </div> |
| | | </scroll-pagination> |
| | | <scroll-pagination @load="initYear" :finishLoding="finishLoding" v-show="!query.month&&yearList.length>0" style="width: 100%;" :key="'111'"> |
| | | <scroll-pagination @load="initYear" :finishLoding="finishLoding" v-show="!query.month&&yearList.length>0" style="width: 100%;" :key="'111'" :list="yearList"> |
| | | <div class="clearfix year-table"> |
| | | <div class="fixed-left"> |
| | | <div class="content-title" style="padding-left: 16px;box-sizing: border-box;"> |
| | |
| | | monthList:[], |
| | | yearList:[], |
| | | downLoading:false, |
| | | keyMap:{}, |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | refresh(){ |
| | | this.list = []; |
| | | this.yearList = [] |
| | | this.keyMap = {}; |
| | | this.currentPage = 1 |
| | | this.query = { |
| | | userName:'', |
| | |
| | | } |
| | | }, |
| | | refreshTable(){ |
| | | this.keyMap = {}; |
| | | this.currentPage = 1 |
| | | if(this.query.month){ |
| | | this.list = []; |
| | |
| | | } |
| | | }, |
| | | init(){ |
| | | const key = `_${this.currentPage}` |
| | | const value = this.keyMap[key] |
| | | // 如果value存在,表示缓存有值,那么阻止请求 |
| | | if(value) { |
| | | return |
| | | } |
| | | // value不存在,表示第一次请求,设置占位 |
| | | this.keyMap[key] = 'temp' |
| | | if(this.currentPage==1){ |
| | | this.pageLoading = true |
| | | } |
| | |
| | | }) |
| | | }, |
| | | initYear(){ |
| | | const key = `_${this.currentPage}` |
| | | const value = this.keyMap[key] |
| | | // 如果value存在,表示缓存有值,那么阻止请求 |
| | | if(value) { |
| | | return |
| | | } |
| | | // value不存在,表示第一次请求,设置占位 |
| | | this.keyMap[key] = 'temp' |
| | | // pageYear |
| | | if(this.currentPage==1){ |
| | | this.pageLoading = true |