fix(性能测试): 修复报告也csv配置没有显示的问题

This commit is contained in:
CaptainB 2022-03-11 15:06:50 +08:00 committed by 刘瑞斌
parent 038a26a7cc
commit aa1d53b96e
1 changed files with 18 additions and 2 deletions

View File

@ -2,11 +2,11 @@
<el-tabs>
<el-tab-pane :label="$t('load_test.pressure_config')">
<performance-pressure-config :is-read-only="true" :test="test" :report="report" :report-id="reportId"
:is-share="isShare" :share-id="shareId"/>
:is-share="isShare" :share-id="shareId" @fileChange="fileChange"/>
</el-tab-pane>
<el-tab-pane :label="$t('load_test.advanced_config')">
<performance-advanced-config :is-read-only="true" :report-id="reportId" :report="report" :is-share="isShare"
:share-id="shareId"/>
:share-id="shareId" ref="advancedConfig"/>
</el-tab-pane>
</el-tabs>
</template>
@ -26,6 +26,22 @@ export default {
report: Object,
isShare: Boolean,
shareId: String,
},
methods: {
fileChange(threadGroups) {
let csvSet = new Set;
threadGroups.forEach(tg => {
if (tg.csvFiles) {
tg.csvFiles.map(item => csvSet.add(item));
}
});
let csvFiles = [];
for (const f of csvSet) {
csvFiles.push({name: f, csvSplit: false, csvHasHeader: true});
}
this.$refs.advancedConfig.csvFiles = csvFiles;
},
}
};
</script>