diff --git a/nezha-fronted/src/components/charts/chart-alert-list.vue b/nezha-fronted/src/components/charts/chart-alert-list.vue index 23924646f..343b6754d 100644 --- a/nezha-fronted/src/components/charts/chart-alert-list.vue +++ b/nezha-fronted/src/components/charts/chart-alert-list.vue @@ -783,13 +783,15 @@ export default { }, }, - mounted() { - this.firstLoad = false; + created(){ //是否存在分页缓存 let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); if (pageSize != 'undefined' && pageSize != null) { this.pageObj.pageSize = pageSize } + }, + mounted() { + this.firstLoad = false; this.tablelable = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + '/alertList') ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + '/alertList')) : this.tableTitle; diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue index 5e671ef95..6b861ac55 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue @@ -686,12 +686,14 @@ } }, }, - mounted() { + created(){ //是否存在分页缓存 let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); if (pageSize) { this.pageObj.pageSize = pageSize } + }, + mounted() { this.tablelable = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-/alertList") ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-/alertList")) : this.tableTitle; diff --git a/nezha-fronted/src/components/common/pagination.vue b/nezha-fronted/src/components/common/pagination.vue index 71cce1305..5771a4a32 100644 --- a/nezha-fronted/src/components/common/pagination.vue +++ b/nezha-fronted/src/components/common/pagination.vue @@ -8,7 +8,7 @@ @current-change="current" :current-page="pageObj.pageNo" :page-sizes="pageSizes?pageSizes:[50, 100, 200]" - :page-size="pageSize" + :page-size="Number(pageObj.pageSize)" layout="total, prev, pager, next, slot" :total="this.pageObj.total" > @@ -125,7 +125,7 @@ export default { this.pageSize=this.postPageSizes[0]; this.resetPageSizes(); }else{ - let pageSize = ''; + let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); if(pageSize != 'undefined' && pageSize != null){ this.pageSize=parseInt(pageSize); } diff --git a/nezha-fronted/src/components/common/project/popData/alertTable.vue b/nezha-fronted/src/components/common/project/popData/alertTable.vue index 041de8515..acfab573a 100644 --- a/nezha-fronted/src/components/common/project/popData/alertTable.vue +++ b/nezha-fronted/src/components/common/project/popData/alertTable.vue @@ -330,6 +330,13 @@ deleteBox:{} } }, + created(){ + //是否存在分页缓存 + let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); + if (pageSize != 'undefined' && pageSize != null) { + this.pageObj.pageSize = pageSize + } + }, mounted(){ this.getAlertList(); }, diff --git a/nezha-fronted/src/components/common/project/popData/assetTable.vue b/nezha-fronted/src/components/common/project/popData/assetTable.vue index 8bc44dbb6..0eb885c17 100644 --- a/nezha-fronted/src/components/common/project/popData/assetTable.vue +++ b/nezha-fronted/src/components/common/project/popData/assetTable.vue @@ -234,6 +234,13 @@ deleteBox:{} } }, + created(){ + //是否存在分页缓存 + let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); + if (pageSize != 'undefined' && pageSize != null) { + this.pageObj.pageSize = pageSize + } + }, mounted(){ this.getTableTitle(); this.getAssetList(); diff --git a/nezha-fronted/src/components/common/project/popData/endpointTable.vue b/nezha-fronted/src/components/common/project/popData/endpointTable.vue index 8ca6d53a0..2954bcd84 100644 --- a/nezha-fronted/src/components/common/project/popData/endpointTable.vue +++ b/nezha-fronted/src/components/common/project/popData/endpointTable.vue @@ -203,6 +203,13 @@ deleteBox:{} } }, + created(){ + //是否存在分页缓存 + let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); + if (pageSize != 'undefined' && pageSize != null) { + this.pageObj.pageSize = pageSize + } + }, mounted(){ this.getEndpointList(); }, diff --git a/nezha-fronted/src/components/page/alert/config.vue b/nezha-fronted/src/components/page/alert/config.vue index 587ca4867..67700b2bd 100644 --- a/nezha-fronted/src/components/page/alert/config.vue +++ b/nezha-fronted/src/components/page/alert/config.vue @@ -550,17 +550,19 @@ bus.$off("dc-list-change"); bus.$off('alert-message-change') }, + created(){ + //是否存在分页缓存 + let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); + if (pageSize != 'undefined' && pageSize != null) { + this.pageObj.pageSize = pageSize + } + }, mounted() { //初始化表头 this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) : this.tableTitle; this.tableTitleReset(this.tableTitle,this.tools.customTableTitle); - //是否存在分页缓存 - let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); - if (pageSize != 'undefined' && pageSize != null) { - this.pageObj.pageSize = pageSize - } this.initEvent(); this.getTableData(); diff --git a/nezha-fronted/src/components/page/alert/list.vue b/nezha-fronted/src/components/page/alert/list.vue index 4c771c8db..fe9d237af 100644 --- a/nezha-fronted/src/components/page/alert/list.vue +++ b/nezha-fronted/src/components/page/alert/list.vue @@ -719,6 +719,13 @@ this.$bottomBoxWindow.showSubListWatch(vm, n); }, }, + created(){ + //是否存在分页缓存 + let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); + if (pageSize != 'undefined' && pageSize != null) { + this.pageObj.pageSize = pageSize + } + }, mounted() { //初始化表头 this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index 1bcf900cf..663c50542 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -767,7 +767,13 @@ self.tools.tableHover = false; } }, - + created(){ + //是否存在分页缓存 + let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); + if (pageSize != 'undefined' && pageSize != null) { + this.pageObj.pageSize = pageSize + } + }, mounted() { //初始化表头 let tableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) diff --git a/nezha-fronted/src/components/page/config/account.vue b/nezha-fronted/src/components/page/config/account.vue index c0221cd6d..75a873b18 100644 --- a/nezha-fronted/src/components/page/config/account.vue +++ b/nezha-fronted/src/components/page/config/account.vue @@ -375,17 +375,19 @@ this.$bottomBoxWindow.showSubListWatch(vm, n); }, }, + created(){ + //是否存在分页缓存 + let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); + if (pageSize != 'undefined' && pageSize != null) { + this.pageObj.pageSize = pageSize + } + }, mounted() { //初始化表头 this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) : this.tableTitle; this.tableTitleReset(this.tableTitle,this.tools.customTableTitle); - //是否存在分页缓存 - let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); - if (pageSize != 'undefined' && pageSize != null) { - this.pageObj.pageSize = pageSize - } this.getTableData(); this.$nextTick(() => { diff --git a/nezha-fronted/src/components/page/config/dc.vue b/nezha-fronted/src/components/page/config/dc.vue index 83b7a8865..5292d40bc 100644 --- a/nezha-fronted/src/components/page/config/dc.vue +++ b/nezha-fronted/src/components/page/config/dc.vue @@ -509,6 +509,13 @@ beforeDestroy(){ bus.$off("dc-list-change"); }, + created(){ + //是否存在分页缓存 + let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); + if (pageSize != 'undefined' && pageSize != null) { + this.pageObj.pageSize = pageSize + } + }, destroyed() { window.onresize = null; }, @@ -518,11 +525,6 @@ ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) : this.tableTitle; this.tableTitleReset(this.tableTitle,this.tools.customTableTitle); - //是否存在分页缓存 - let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); - if (pageSize != 'undefined' && pageSize != null) { - this.pageObj.pageSize = pageSize; - } this.getTableData(); this.$nextTick(function(){ this.getUserData();//绑定滚动条事件,控制top按钮 diff --git a/nezha-fronted/src/components/page/config/mib.vue b/nezha-fronted/src/components/page/config/mib.vue index 5649bf2ba..eb5af3701 100644 --- a/nezha-fronted/src/components/page/config/mib.vue +++ b/nezha-fronted/src/components/page/config/mib.vue @@ -347,17 +347,19 @@ self.tools.tableHover = false; } }, + created(){ + //是否存在分页缓存 + let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); + if (pageSize != 'undefined' && pageSize != null) { + this.pageObj.pageSize = pageSize + } + }, mounted() { //初始化表头 this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) : this.tableTitle; this.tableTitleReset(this.tableTitle,this.tools.customTableTitle); - //是否存在分页缓存 - let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); - if (pageSize != 'undefined' && pageSize != null) { - this.pageObj.pageSize = pageSize - } this.getTableData(); this.$nextTick(() => { diff --git a/nezha-fronted/src/components/page/config/model.vue b/nezha-fronted/src/components/page/config/model.vue index bd61c56dc..65a6199c2 100644 --- a/nezha-fronted/src/components/page/config/model.vue +++ b/nezha-fronted/src/components/page/config/model.vue @@ -347,17 +347,19 @@ self.tools.tableHover = false; } }, + created(){ + //是否存在分页缓存 + let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); + if (pageSize != 'undefined' && pageSize != null) { + this.pageObj.pageSize = pageSize + } + }, mounted() { //初始化表头 this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) : this.tableTitle; this.tableTitleReset(this.tableTitle,this.tools.customTableTitle); - //是否存在分页缓存 - let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); - if (pageSize != 'undefined' && pageSize != null) { - this.pageObj.pageSize = pageSize - } this.getTableData(); this.$nextTick(() => { diff --git a/nezha-fronted/src/components/page/config/operationlog.vue b/nezha-fronted/src/components/page/config/operationlog.vue index 150472dbc..ef68e939e 100644 --- a/nezha-fronted/src/components/page/config/operationlog.vue +++ b/nezha-fronted/src/components/page/config/operationlog.vue @@ -286,18 +286,19 @@ } } }, + created(){ + //是否存在分页缓存 + let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); + if (pageSize != 'undefined' && pageSize != null) { + this.pageObj.pageSize = pageSize + } + }, mounted() { //初始化表头 this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) : this.tableTitle; this.tableTitleReset(this.tableTitle,this.tools.customTableTitle); - //是否存在分页缓存 - let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); - if (pageSize && pageSize != 'undefined') { - this.pageObj.pageSize = pageSize - } - this.getTableData(); this.$nextTick(() => { //绑定滚动条事件,控制top按钮 diff --git a/nezha-fronted/src/components/page/config/promServer.vue b/nezha-fronted/src/components/page/config/promServer.vue index 278e76c19..0f1460f72 100644 --- a/nezha-fronted/src/components/page/config/promServer.vue +++ b/nezha-fronted/src/components/page/config/promServer.vue @@ -412,6 +412,13 @@ self.tools.tableHover = false; } }, + created(){ + //是否存在分页缓存 + let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); + if (pageSize != 'undefined' && pageSize != null) { + this.pageObj.pageSize = pageSize + } + }, mounted() { //初始化数据 Promise.all([this.getDcData()]).then(response => { diff --git a/nezha-fronted/src/components/page/config/terminallog.vue b/nezha-fronted/src/components/page/config/terminallog.vue index 5b52e2057..ca21077b2 100644 --- a/nezha-fronted/src/components/page/config/terminallog.vue +++ b/nezha-fronted/src/components/page/config/terminallog.vue @@ -299,17 +299,19 @@ }, watch:{ }, + created(){ + //是否存在分页缓存 + let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); + if (pageSize != 'undefined' && pageSize != null) { + this.pageObj.pageSize = pageSize + } + }, mounted() { //初始化表头 this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) : this.tableTitle; this.tableTitleReset(this.tableTitle,this.tools.customTableTitle); - //是否存在分页缓存 - let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); - if (pageSize && pageSize != 'undefined') { - this.pageObj.pageSize = pageSize - } this.getTableData(); this.$nextTick(() => { diff --git a/nezha-fronted/src/components/page/project/project.vue b/nezha-fronted/src/components/page/project/project.vue index 899ce7a66..7d067198b 100644 --- a/nezha-fronted/src/components/page/project/project.vue +++ b/nezha-fronted/src/components/page/project/project.vue @@ -767,6 +767,11 @@ }, created(){ this.currentProject=this.$store.state.currentProject; + //是否存在分页缓存 + let pageSize=localStorage.getItem('nz-pageSize-'+localStorage.getItem('nz-username')+'-'+this.tableId); + if(pageSize){ + this.endpointPageObj.pageSize=pageSize + } this.getModuleList(); this.getUserData(); this.getProjectList(); @@ -776,11 +781,6 @@ this.tools.customTableTitle=localStorage.getItem("nz-tableTitle-"+localStorage.getItem("nz-username")+"-"+this.$route.path) ?JSON.parse(localStorage.getItem("nz-tableTitle-"+localStorage.getItem("nz-username")+"-"+this.$route.path)) :this.tableTitle; - //是否存在分页缓存 - let pageSize=localStorage.getItem('nz-pageSize-'+localStorage.getItem('nz-username')+'-'+this.tableId); - if(pageSize){ - this.endpointPageObj.pageSize=pageSize - } setTimeout(()=>{ this.ready=true; },300);