From 1516949ffc4401f2932763d3bbab43b1b5f31a44 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Fri, 4 Jun 2021 10:34:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E5=B8=83=E5=BC=8F=E5=8E=8B=E6=B5=8B?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=20=E5=90=84node=E8=8A=82=E7=82=B9=E9=97=B4?= =?UTF-8?q?=E7=9A=84jmeter=E6=97=A5=E5=BF=97=E5=87=BA=E7=8E=B0=E4=B8=B2?= =?UTF-8?q?=E8=81=94=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #3479 --- .../report/components/LogDetails.vue | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/frontend/src/business/components/performance/report/components/LogDetails.vue b/frontend/src/business/components/performance/report/components/LogDetails.vue index bc47751584..8d7c3eb17d 100644 --- a/frontend/src/business/components/performance/report/components/LogDetails.vue +++ b/frontend/src/business/components/performance/report/components/LogDetails.vue @@ -3,7 +3,9 @@
    -
  • {{ log.content }}
  • +
  • + {{ log.content }} +
{{ $t('load_test.download_log_file') }}
@@ -17,13 +19,13 @@ export default { data() { return { resource: [], - logContent: [], + logContent: {}, result: {}, id: '', page: 1, pageCount: 5, loading: false, - } + }; }, computed: { @@ -37,8 +39,11 @@ export default { this.result = this.$get("/performance/report/log/resource/" + this.id, data => { this.resource = data.data; this.page = 1; - this.logContent = []; - }) + this.logContent = data.data.map(item => item.resourceId).reduce((result, curr) => { + result[curr] = []; + return result; + }, {}); + }); }, load(resourceId) { if (this.loading || this.page > this.pageCount) return; @@ -47,17 +52,17 @@ export default { this.$get(url, res => { let data = res.data; data.listObject.forEach(log => { - this.logContent.push(log); - }) + this.logContent[resourceId].push(log); + }); this.page++; this.loading = false; - }) + }); }, selectTab(tab) { let resourceId = tab.$vnode.key; this.loading = false; this.page = 1; - this.logContent = []; + this.logContent[resourceId] = []; this.load(resourceId); }, downloadLogFile(item) { @@ -67,7 +72,7 @@ export default { responseType: 'blob' }; this.result = this.$request(config).then(response => { - const filename = 'jmeter.log' + const filename = 'jmeter.log'; const blob = new Blob([response.data]); if ("download" in document.createElement("a")) { // 非IE下载 @@ -76,7 +81,7 @@ export default { aTag.download = filename; aTag.href = URL.createObjectURL(blob); aTag.click(); - URL.revokeObjectURL(aTag.href) + URL.revokeObjectURL(aTag.href); } else { // IE10+下载 navigator.msSaveBlob(blob, filename); @@ -102,7 +107,7 @@ export default { } }, props: ['report'] -} +};