From f2065c1bd49e03d10333260c24f03b9ec9a0f0ef Mon Sep 17 00:00:00 2001 From: zhaochengke Date: Wed, 15 Jun 2022 15:11:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=85=E5=9F=BA=E5=9C=B0=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E6=96=B0=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../homeApplication/applicationList.vue | 77 ++- .../homeApplication/proposerLite.vue | 579 ++++++++++++------ 2 files changed, 431 insertions(+), 225 deletions(-) diff --git a/src/views/onlineHome/homestead/homeApplication/applicationList.vue b/src/views/onlineHome/homestead/homeApplication/applicationList.vue index ce83e835..7ddf3899 100644 --- a/src/views/onlineHome/homestead/homeApplication/applicationList.vue +++ b/src/views/onlineHome/homestead/homeApplication/applicationList.vue @@ -15,12 +15,12 @@ - + @@ -72,6 +72,7 @@ export default { loading: false, finished: false, refreshing: false, + total: 0, queryParams:{ pageNum:1, pageSize:10, @@ -84,7 +85,7 @@ export default { this.houseGetDicts("house_apply_status").then((response) => { console.log(response) this.houseApplyStatus = response.data; - //this.refresh(); + this.getList(); }); }, methods: { @@ -104,30 +105,51 @@ export default { ? 'modify' : 'view'; window.location = 'proposerLite?type=' + type + '&id=' + row.id; }, - getList(){ - setTimeout(() => { - getList(this.queryParams).then(response => { - console.log(response) - for (var i = 0; i < response.rows.length; i++) { - var houseApplyStatusName = this.selectDictLabel(this.houseApplyStatus, response.rows[i].houseApplyStatus); - // if(response.rows[i].auditStatus !== '0' && response.rows[i].auditStatus === '2'){ - // houseApplyStatusName = houseApplyStatusName+ ' ● 已驳回'; - // } - response.rows[i].houseApplyStatusName = houseApplyStatusName; - this.applicationList.push(response.rows[i]); - } - if(this.applicationList.length >= response.total){ - this.finished = true; - return; - }else{ - this.loading = false; - this.queryParams.pageNum += 1 ; - } - }).finally(() => { - this.loading = false; - this.refreshing = false; - }); - }, 1000); + getList(target){ + let type = typeof (target); + console.log(type, target); + if(target && this.finished) + return; + if (target === 0) { + this.refreshing = true; + this.finished = true; + this.total = 0; + this.queryParams.pageNum = 1; + this.applicationList = []; + } + else if (type === 'number') + this.queryParams.pageNum = target; + else if (type === 'string') { + this.queryParams.pageNum = eval(this.queryParams.pageNum + target) + } + else + { + this.refreshing = true; + this.finished = true; + this.total = 0; + this.queryParams.pageNum = 1; + this.applicationList = [] + } + getList(this.queryParams).then(response => { + console.log(response) + if (response.rows.length === 0) { + this.finished = true; + return; + } + for (var i = 0; i < response.rows.length; i++) { + var houseApplyStatusName = this.selectDictLabel(this.houseApplyStatus, response.rows[i].houseApplyStatus); + // if(response.rows[i].auditStatus !== '0' && response.rows[i].auditStatus === '2'){ + // houseApplyStatusName = houseApplyStatusName+ ' ● 已驳回'; + // } + response.rows[i].houseApplyStatusName = houseApplyStatusName; + this.applicationList.push(response.rows[i]); + } + this.total += response.rows.length; + this.finished = this.total >= response.total; + }).finally(() => { + this.loading = false; + this.refreshing = false; + }); }, deleteList(id,index){ this.$dialog.confirm({ @@ -147,6 +169,7 @@ export default { }); }, refresh() { + this.getList(); return; this.applicationList = []; this.queryParams.pageNum = 1; this.refreshing = true; diff --git a/src/views/onlineHome/homestead/homeApplication/proposerLite.vue b/src/views/onlineHome/homestead/homeApplication/proposerLite.vue index 8c55d198..4fe602d2 100644 --- a/src/views/onlineHome/homestead/homeApplication/proposerLite.vue +++ b/src/views/onlineHome/homestead/homeApplication/proposerLite.vue @@ -291,7 +291,7 @@ -