refactor(性能测试): 查询报告日志修改

This commit is contained in:
Captain.B 2020-12-22 18:03:56 +08:00
parent bb3845e28f
commit 5835bc6ab3
1 changed files with 103 additions and 96 deletions

View File

@ -1,18 +1,18 @@
<template>
<div v-loading="result.loading">
<el-tabs type="border-card" :stretch="true">
<el-tabs type="border-card" :stretch="true" @tab-click="selectTab">
<el-tab-pane v-for="item in resource" :key="item.resourceId" :label="item.resourceName" class="logging-content">
<ul class="infinite-list" v-infinite-scroll="load(item.resourceId)" infinite-scroll-disabled="disabled">
<li class="infinite-list-item" v-for="(log, index) in logContent" :key="index">{{ log.content }}</li>
</ul>
<el-link type="primary" @click="downloadLogFile(item)">{{$t('load_test.download_log_file')}}</el-link>
<el-link type="primary" @click="downloadLogFile(item)">{{ $t('load_test.download_log_file') }}</el-link>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
export default {
export default {
name: "LogDetails",
data() {
return {
@ -53,6 +53,13 @@
this.loading = false;
})
},
selectTab(tab) {
let resourceId = tab.$vnode.key;
this.loading = false;
this.page = 1;
this.logContent = [];
this.load(resourceId);
},
downloadLogFile(item) {
let config = {
url: '/performance/report/log/download/' + this.id + '/' + item.resourceId,
@ -95,25 +102,25 @@
}
},
props: ['report']
}
}
</script>
<style scoped>
.logging-content {
.logging-content {
white-space: pre-line;
overflow: auto;
}
}
.infinite-list {
.infinite-list {
height: 500px;
padding: 0;
margin: 0;
list-style: none;
overflow: auto
}
}
.infinite-list-item {
.infinite-list-item {
overflow: hidden;
}
}
</style>