From 528d847fb6c6d3bcbd484e0e68e093f328173d6c Mon Sep 17 00:00:00 2001 From: piexlmax Date: Tue, 7 Sep 2021 15:11:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0getTableData=E7=9A=84?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=8F=91=E8=B5=B7=E5=89=8D=E5=90=8E=E9=92=A9?= =?UTF-8?q?=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/mixins/infoList.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/src/mixins/infoList.js b/web/src/mixins/infoList.js index b57e3a09..ff1b219f 100644 --- a/web/src/mixins/infoList.js +++ b/web/src/mixins/infoList.js @@ -44,14 +44,18 @@ export default { this.page = val this.getTableData() }, - async getTableData(page = this.page, pageSize = this.pageSize) { - const table = await this.listApi({ page, pageSize, ...this.searchInfo }) + // @params beforeFunc function 请求发起前执行的函数 默认为空函数 + // @params afterFunc function 请求完成后执行的函数 默认为空函数 + async getTableData(beforeFunc = () => {}, afterFunc = () => {}) { + beforeFunc() + const table = await this.listApi({ page: this.page, pageSize: this.pageSize, ...this.searchInfo }) if (table.code === 0) { this.tableData = table.data.list this.total = table.data.total this.page = table.data.page this.pageSize = table.data.pageSize } + afterFunc() } } } From 7ca856926a15b4d92429a691f8cf8083bff338af Mon Sep 17 00:00:00 2001 From: piexlmax Date: Tue, 7 Sep 2021 16:50:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=E7=9A=84=E6=96=87=E4=BB=B6=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/view/example/upload/upload.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/view/example/upload/upload.vue b/web/src/view/example/upload/upload.vue index 5aa89bca..377e8c72 100644 --- a/web/src/view/example/upload/upload.vue +++ b/web/src/view/example/upload/upload.vue @@ -163,7 +163,11 @@ export default { this.fullscreenLoading = false }, downloadFile(row) { - downloadImage(row.url, row.name) + if (row.url.indexOf('http://') > -1 || row.url.indexOf('https://') > -1) { + downloadImage(row.url, row.name) + } else { + downloadImage(this.path + row.url, row.name) + } } } }