refactor(性能测试): 修改日志详情查询

This commit is contained in:
CaptainB 2022-06-20 14:11:18 +08:00 committed by f2c-ci-robot[bot]
parent e314945620
commit 0cdd7136d5
1 changed files with 8 additions and 2 deletions

View File

@ -14,13 +14,16 @@
</el-col> </el-col>
<el-col :span="20"> <el-col :span="20">
<div v-if="currentInstance" class="logging-content"> <div v-if="currentInstance" class="logging-content">
<ul class="infinite-list" v-infinite-scroll="load(currentInstance)"> <ul class="infinite-list">
<li class="infinite-list-item" v-for="(log, index) in logContent[currentInstance]" <li class="infinite-list-item" v-for="(log, index) in logContent[currentInstance]"
:key="currentInstance+index"> :key="currentInstance+index">
{{ log.content }} {{ log.content }}
</li> </li>
</ul> </ul>
<el-link type="primary" @click="downloadLogFile(currentInstance)">{{ $t('load_test.download_log_file') }}</el-link> <el-link type="primary" @click="downloadLogFile(currentInstance)">{{
$t('load_test.download_log_file')
}}
</el-link>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -70,6 +73,7 @@ export default {
this.resource = data; this.resource = data;
if (!this.currentInstance) { if (!this.currentInstance) {
this.currentInstance = this.resource[0]?.resourceId; this.currentInstance = this.resource[0]?.resourceId;
this.changeInstance(this.currentInstance);
} }
this.page = data.map(item => item.resourceId).reduce((result, curr) => { this.page = data.map(item => item.resourceId).reduce((result, curr) => {
result[curr] = 1; result[curr] = 1;
@ -106,6 +110,8 @@ export default {
}); });
this.page[resourceId]++; this.page[resourceId]++;
this.loading = false; this.loading = false;
//
this.load(resourceId);
}, },
changeInstance(instance) { changeInstance(instance) {
this.currentInstance = instance; this.currentInstance = instance;