From bbfc9fbaf97d337e08662fd2ad89b806323902de Mon Sep 17 00:00:00 2001 From: zyn Date: Wed, 29 Nov 2023 13:43:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/phone/domesticStand/index.vue | 47 ++++++++++--------- .../standDynamics/components/DataCenter.vue | 45 ++++++++++-------- .../components/StandardRegulations.vue | 47 ++++++++++--------- .../components/UnderResearchStandards.vue | 47 ++++++++++--------- src/pages/phone/standDynamics/index.vue | 6 +-- 5 files changed, 106 insertions(+), 86 deletions(-) diff --git a/src/pages/phone/domesticStand/index.vue b/src/pages/phone/domesticStand/index.vue index 0e597c8ed..de1706dbe 100644 --- a/src/pages/phone/domesticStand/index.vue +++ b/src/pages/phone/domesticStand/index.vue @@ -27,9 +27,13 @@ ref="scroll" height="calc(100vh - 100px)" :data="list" + :page="searchQuery.page" + :pageSize="searchQuery.pageSize" :total="total" :loading="loading" - :pullingUpHandler="pullingUpHandler"> + pullUpLoad + pullDownRefresh + :getDataHandler="getData">
{ - if (res.ok) { - this.total = res.data.count - - if (this.searchQuery.page === 1) { - this.list = res.data.list - } else { - this.list = [...this.list, ...res.data.list] - } + return new Promise((resolve, reject) => { + const config = { + _this: this, + loading: 'loading' } + if (page) { + this.searchQuery.page = page + } + this.$http._postData("search/searchCenter/searchSarBykey", this.searchQuery, config).then(res => { + if (res.ok) { + this.total = res.data.count + + if (this.searchQuery.page === 1) { + this.list = res.data.list + } else { + this.list = [...this.list, ...res.data.list] + } + } + }).finally(() => { + resolve() + }) }) }, onChoose () { diff --git a/src/pages/phone/standDynamics/components/DataCenter.vue b/src/pages/phone/standDynamics/components/DataCenter.vue index 78f3c9e22..090e5c156 100644 --- a/src/pages/phone/standDynamics/components/DataCenter.vue +++ b/src/pages/phone/standDynamics/components/DataCenter.vue @@ -6,9 +6,13 @@ + pullUpLoad + pullDownRefresh + :getDataHandler="getData">
@@ -57,12 +61,6 @@ export default { this.getData() }, methods: { - pullingUpHandler () { - if (this.searchQuery.page * this.searchQuery.pageSize <= this.total) { - this.searchQuery.page = this.searchQuery.page + 1 - this.getData() - } - }, onOpen () { this.$refs.folderPopupRef.open(this.searchQuery.treeId || null) }, @@ -72,20 +70,27 @@ export default { this.searchQuery.page = 1 this.getData() }, - getData () { - const config = { - _this: this, - loading: 'loading' - } - this.$http._getData('fileMaterialCenter/file-material', this.searchQuery, config).then(res => { - if (res.ok) { - this.total = res.data.total - if (this.searchQuery.page === 1) { - this.list = res.data.records - } else { - this.list = [...this.list, ...res.data.records] - } + getData (page) { + return new Promise((resolve, reject) => { + const config = { + _this: this, + loading: 'loading' } + if (page) { + this.searchQuery.page = page + } + this.$http._getData('fileMaterialCenter/file-material', this.searchQuery, config).then(res => { + if (res.ok) { + this.total = res.data.total + if (this.searchQuery.page === 1) { + this.list = res.data.records + } else { + this.list = [...this.list, ...res.data.records] + } + } + }).finally(() => { + resolve() + }) }) }, jumpDetails(item) { diff --git a/src/pages/phone/standDynamics/components/StandardRegulations.vue b/src/pages/phone/standDynamics/components/StandardRegulations.vue index a073b65dd..fcb37b826 100644 --- a/src/pages/phone/standDynamics/components/StandardRegulations.vue +++ b/src/pages/phone/standDynamics/components/StandardRegulations.vue @@ -2,9 +2,13 @@ + pullUpLoad + pullDownRefresh + :getDataHandler="getData">
@@ -55,27 +59,28 @@ export default { this.getData() }, methods: { - pullingUpHandler () { - if (this.searchQuery.page * this.searchQuery.pageSize <= this.total) { - this.searchQuery.page = this.searchQuery.page + 1 - this.getData() - } - }, - getData () { - const config = { - _this: this, - loading: 'loading' - } - this.$http._getData("lawss/NewsFeed/getNewsFeed", this.searchQuery, config).then(res => { - if (res.ok) { - this.total = res.data.total - - if (this.searchQuery.page === 1) { - this.list = res.data.records - } else { - this.list = [...this.list, ...res.data.records] - } + getData (page) { + return new Promise((resolve, reject) => { + const config = { + _this: this, + loading: 'loading' } + if (page) { + this.searchQuery.page = page + } + this.$http._getData("lawss/NewsFeed/getNewsFeed", this.searchQuery, config).then(res => { + if (res.ok) { + this.total = res.data.total + + if (this.searchQuery.page === 1) { + this.list = res.data.records + } else { + this.list = [...this.list, ...res.data.records] + } + } + }).finally(() => { + resolve() + }) }) }, getDicTypeListCode () { diff --git a/src/pages/phone/standDynamics/components/UnderResearchStandards.vue b/src/pages/phone/standDynamics/components/UnderResearchStandards.vue index ca3eec05a..82c122a4a 100644 --- a/src/pages/phone/standDynamics/components/UnderResearchStandards.vue +++ b/src/pages/phone/standDynamics/components/UnderResearchStandards.vue @@ -2,9 +2,13 @@ + pullUpLoad + pullDownRefresh + :getDataHandler="getData">
@@ -54,27 +58,28 @@ export default { this.getData() }, methods: { - pullingUpHandler () { - if (this.searchQuery.page * this.searchQuery.pageSize <= this.total) { - this.searchQuery.page = this.searchQuery.page + 1 - this.getData() - } - }, - getData () { - const config = { - _this: this, - loading: 'loading' - } - this.$http._getData("lawss/NewsFeed/getNewsFeed", this.searchQuery, config).then(res => { - if (res.ok) { - this.total = res.data.total - - if (this.searchQuery.page === 1) { - this.list = res.data.records - } else { - this.list = [...this.list, ...res.data.records] - } + getData (page) { + return new Promise((resolve, reject) => { + const config = { + _this: this, + loading: 'loading' } + if (page) { + this.searchQuery.page = page + } + this.$http._getData("lawss/NewsFeed/getNewsFeed", this.searchQuery, config).then(res => { + if (res.ok) { + this.total = res.data.total + + if (this.searchQuery.page === 1) { + this.list = res.data.records + } else { + this.list = [...this.list, ...res.data.records] + } + } + }).finally(() => { + resolve() + }) }) }, getDicTypeListCode () { diff --git a/src/pages/phone/standDynamics/index.vue b/src/pages/phone/standDynamics/index.vue index 3ad0f0720..834847a84 100644 --- a/src/pages/phone/standDynamics/index.vue +++ b/src/pages/phone/standDynamics/index.vue @@ -8,13 +8,13 @@
- + - + - +