From d77dae6292d73a9caf920e5afa615e068523defd Mon Sep 17 00:00:00 2001 From: zyn Date: Fri, 1 Dec 2023 16:26:54 +0800 Subject: [PATCH 1/3] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzwlComponents/phone/PhoneScroll.vue | 36 +++++++++++-------- src/pages/phone/domesticStand/index.vue | 8 ++--- .../standDynamics/components/DataCenter.vue | 4 +-- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/components/hzwlComponents/phone/PhoneScroll.vue b/src/components/hzwlComponents/phone/PhoneScroll.vue index 8cbd30c10..632ccc387 100644 --- a/src/components/hzwlComponents/phone/PhoneScroll.vue +++ b/src/components/hzwlComponents/phone/PhoneScroll.vue @@ -17,17 +17,6 @@ - - 加载中... - @@ -40,12 +29,23 @@ color="#3170A8" style="text-align: center" >加载中... - + + + 加载中... @@ -129,6 +129,10 @@ export default { }, watch: { data() { + if (this.data.length === 0) { + this.scrollTo(0,0) + this.isEmpty = true + } this.refreshScroll() } }, @@ -191,6 +195,7 @@ export default { // 下拉刷新回调 async pullingDownHandler () { this.showPullDownText('pullDownLoading') + this.hidePullUpText() // 从第一页获取数据 await this.getDataHandler(1) @@ -201,8 +206,7 @@ export default { }, showPullUpText () { - this.isEmpty = false - this.isShowAll = false + this.hidePullUpText() if (this.data.length === 0) { this.isEmpty = true } else { @@ -211,6 +215,10 @@ export default { } } }, + hidePullUpText () { + this.isEmpty = false + this.isShowAll = false + }, showPullDownText (key) { this.isEnterThreshold = false this.isLeaveThreshold = false diff --git a/src/pages/phone/domesticStand/index.vue b/src/pages/phone/domesticStand/index.vue index de1706dbe..aab90e329 100644 --- a/src/pages/phone/domesticStand/index.vue +++ b/src/pages/phone/domesticStand/index.vue @@ -183,10 +183,10 @@ export default { methods: { onSearch () { this.list = [] - this.searchQuery.page = 1 - // 返回顶部 - this.$refs.scroll.scrollTo(0, 0) - this.getData() + // this.searchQuery.page = 1 + // // 返回顶部 + // this.$refs.scroll.scrollTo(0, 0) + this.getData(1) }, getData (page) { switch (this.$route.query.standType) { diff --git a/src/pages/phone/standDynamics/components/DataCenter.vue b/src/pages/phone/standDynamics/components/DataCenter.vue index 090e5c156..0a18981ce 100644 --- a/src/pages/phone/standDynamics/components/DataCenter.vue +++ b/src/pages/phone/standDynamics/components/DataCenter.vue @@ -67,8 +67,8 @@ export default { setChecked (currentData) { this.currentSearch = currentData this.searchQuery.treeId = currentData.id || '' - this.searchQuery.page = 1 - this.getData() + this.list = [] + this.getData(1) }, getData (page) { return new Promise((resolve, reject) => { From c44ba54cc75ec9fb956a81c480994e744539436d Mon Sep 17 00:00:00 2001 From: zyn Date: Fri, 1 Dec 2023 16:33:19 +0800 Subject: [PATCH 2/3] =?UTF-8?q?refactor:=20=E6=89=8B=E6=9C=BA=E7=AB=AF-?= =?UTF-8?q?=E5=85=A8=E5=BA=93=E6=90=9C=E7=B4=A2=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/phone/databaseSearch/index.vue | 241 +++++++++++++++++++++++ src/router/index.js | 10 + 2 files changed, 251 insertions(+) create mode 100644 src/pages/phone/databaseSearch/index.vue diff --git a/src/pages/phone/databaseSearch/index.vue b/src/pages/phone/databaseSearch/index.vue new file mode 100644 index 000000000..62353cf64 --- /dev/null +++ b/src/pages/phone/databaseSearch/index.vue @@ -0,0 +1,241 @@ + + + + + diff --git a/src/router/index.js b/src/router/index.js index 6b89bad68..58daf03be 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -96,12 +96,22 @@ const routes = [ component: () => import('@/pages/phone/phoneHome') }, + /* { path: '/databaseSearch', name: 'databaseSearch', component: () => import('@/pages/phone/databaseSearch') }, + */ + { + path: '/databaseSearch', + name: 'databaseSearch', + component: () => import('@/pages/phone/databaseSearch/index'), + meta: { + keepAlive: true + } + }, { path: '/standDynamics', name: 'standDynamics', From 7575cbbfae7615d3e9c7b4fc7c1c03f65b259df4 Mon Sep 17 00:00:00 2001 From: zyn Date: Fri, 1 Dec 2023 16:51:28 +0800 Subject: [PATCH 3/3] =?UTF-8?q?perf(=E6=89=8B=E6=9C=BA=E7=AB=AF):=20?= =?UTF-8?q?=E8=B5=84=E6=96=99=E4=B8=AD=E5=BF=83=E7=BB=93=E6=9E=84=E6=A0=91?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/phone/standDynamics/components/folderPopup.vue | 3 ++- src/pages/phone/standDynamics/components/folderTree.vue | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pages/phone/standDynamics/components/folderPopup.vue b/src/pages/phone/standDynamics/components/folderPopup.vue index 7f3d5f023..e5e4c5042 100644 --- a/src/pages/phone/standDynamics/components/folderPopup.vue +++ b/src/pages/phone/standDynamics/components/folderPopup.vue @@ -4,7 +4,8 @@ :style="{ height: '100%', width: '90%' }" round :close-on-click-overlay="false" - @click-overlay="handleCancel"> + @click-overlay="handleCancel" + get-container="body">