From a752897ab45858544e6a076510509f6ecbd8a259 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Mon, 28 Jun 2021 13:14:44 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E5=BC=95=E5=85=A5=E8=87=AA=E5=8A=A8=E5=8C=96=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E6=98=BE=E7=A4=BAcsv=E7=AD=89=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/components/ExistScenarios.vue | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/frontend/src/business/components/performance/test/components/ExistScenarios.vue b/frontend/src/business/components/performance/test/components/ExistScenarios.vue index 72926742e6..13b205a3cf 100644 --- a/frontend/src/business/components/performance/test/components/ExistScenarios.vue +++ b/frontend/src/business/components/performance/test/components/ExistScenarios.vue @@ -21,7 +21,8 @@ @@ -66,7 +67,7 @@ export default { total: 0, apiScenarios: [], selectIds: new Set, - } + }; }, methods: { open() { @@ -101,7 +102,7 @@ export default { let condition = { projectId: getCurrentProjectID(), filters: {status: ["Prepare", "Underway", "Completed"]} - } + }; this.projectLoadingResult = this.$post('/api/automation/list/' + this.currentPage + "/" + this.pageSize, condition, res => { let data = res.data; this.total = data.itemCount; @@ -111,7 +112,7 @@ export default { item.tags = JSON.parse(item.tags); } }); - }) + }); }, handleImport() { if (this.selectIds.size === 0) { @@ -133,7 +134,7 @@ export default { let data = response.data; data.forEach(d => { let jmxName = d.name + "_" + new Date().getTime() + ".jmx"; - let threadGroups = findThreadGroup(d.jmx, jmxName) + let threadGroups = findThreadGroup(d.jmx, jmxName); threadGroups.forEach(tg => { tg.options = {}; this.scenarios.push(tg); @@ -146,16 +147,21 @@ export default { type: 'JMX', updateTime: file.lastModified, }); - }) + // csv 处理 + d.fileMetadataList?.forEach(f => { + this.fileList.push(f); + this.tableData.push(f); + }); + }); this.$emit('fileChange', this.scenarios); this.$success(this.$t('test_track.case.import.success')); this.loadApiAutomationVisible = false; - }) + }); this.selectIds.clear(); }, } -} +};