feat(性能测试): 修复场景名称过长导致样式出错的问题

This commit is contained in:
Captain.B 2021-03-29 12:32:21 +08:00
parent fd89aff698
commit 4c5bcb6307
2 changed files with 51 additions and 24 deletions

View File

@ -1,24 +1,32 @@
<template> <template>
<div v-loading="result.loading" class="pressure-config-container"> <div v-loading="result.loading" class="pressure-config-container">
<el-row> <el-row>
<el-col :span="10"> <el-col :span="12">
<el-collapse v-model="activeNames" accordion> <el-collapse v-model="activeNames" accordion>
<el-collapse-item :name="index" <el-collapse-item :name="index"
v-for="(threadGroup, index) in threadGroups.filter(th=>th.enabled === 'true' && th.deleted=='false')" v-for="(threadGroup, index) in threadGroups.filter(th=>th.enabled === 'true' && th.deleted=='false')"
:key="index"> :key="index">
<template slot="title"> <template slot="title">
<div style="padding-right: 10px"> <el-row>
{{ threadGroup.attributes.testname }} <el-col :span="14">
</div> <el-tooltip :content="threadGroup.attributes.testname" placement="top">
<el-tag type="primary" size="mini" v-if="threadGroup.threadType === 'DURATION'"> <div style="padding-right:20px; font-size: 16px;" class="wordwrap">
{{ $t('load_test.thread_num') }}{{ threadGroup.threadNumber }}, {{ threadGroup.attributes.testname }}
{{ $t('load_test.duration') }}: {{ threadGroup.duration }} {{ getUnitLabel(threadGroup) }} </div>
</el-tag> </el-tooltip>
<el-tag type="primary" size="mini" v-if="threadGroup.threadType === 'ITERATION'"> </el-col>
{{ $t('load_test.thread_num') }} {{ threadGroup.threadNumber }}, <el-col :span="10">
{{ $t('load_test.iterate_num') }} {{ threadGroup.iterateNum }} <el-tag type="primary" size="mini" v-if="threadGroup.threadType === 'DURATION'">
</el-tag> {{ $t('load_test.thread_num') }}{{ threadGroup.threadNumber }},
{{ $t('load_test.duration') }}: {{ threadGroup.duration }} {{ getUnitLabel(threadGroup) }}
</el-tag>
<el-tag type="primary" size="mini" v-if="threadGroup.threadType === 'ITERATION'">
{{ $t('load_test.thread_num') }} {{ threadGroup.threadNumber }},
{{ $t('load_test.iterate_num') }} {{ threadGroup.iterateNum }}
</el-tag>
</el-col>
</el-row>
</template> </template>
<el-form :inline="true"> <el-form :inline="true">
<el-form-item :label="$t('load_test.thread_num')"> <el-form-item :label="$t('load_test.thread_num')">
@ -134,7 +142,7 @@
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
</el-col> </el-col>
<el-col :span="14"> <el-col :span="12">
<ms-chart class="chart-container" ref="chart1" :options="options" :autoresize="true"></ms-chart> <ms-chart class="chart-container" ref="chart1" :options="options" :autoresize="true"></ms-chart>
</el-col> </el-col>
</el-row> </el-row>
@ -578,4 +586,9 @@ export default {
.title { .title {
margin-left: 60px; margin-left: 60px;
} }
.wordwrap {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style> </style>

View File

@ -23,17 +23,25 @@
v-for="(threadGroup, index) in threadGroups.filter(th=>th.enabled === 'true' && th.deleted=='false')" v-for="(threadGroup, index) in threadGroups.filter(th=>th.enabled === 'true' && th.deleted=='false')"
:key="index"> :key="index">
<template slot="title"> <template slot="title">
<div style="padding-right: 20px; font-size: 16px;"> <el-row>
{{ threadGroup.attributes.testname }} <el-col :span="14">
</div> <el-tooltip :content="threadGroup.attributes.testname" placement="top">
<el-tag type="primary" size="mini" v-if="threadGroup.threadType === 'DURATION'"> <div style="padding-right:20px; font-size: 16px;" class="wordwrap">
{{ $t('load_test.thread_num') }}{{ threadGroup.threadNumber }}, {{ threadGroup.attributes.testname }}
{{ $t('load_test.duration') }}: {{ threadGroup.duration }} {{ getUnitLabel(threadGroup) }} </div>
</el-tag> </el-tooltip>
<el-tag type="primary" size="mini" v-if="threadGroup.threadType === 'ITERATION'"> </el-col>
{{ $t('load_test.thread_num') }} {{ threadGroup.threadNumber }}, <el-col :span="10">
{{ $t('load_test.iterate_num') }} {{ threadGroup.iterateNum }} <el-tag type="primary" size="mini" v-if="threadGroup.threadType === 'DURATION'">
</el-tag> {{ $t('load_test.thread_num') }}{{ threadGroup.threadNumber }},
{{ $t('load_test.duration') }}: {{ threadGroup.duration }} {{ getUnitLabel(threadGroup) }}
</el-tag>
<el-tag type="primary" size="mini" v-if="threadGroup.threadType === 'ITERATION'">
{{ $t('load_test.thread_num') }} {{ threadGroup.threadNumber }},
{{ $t('load_test.iterate_num') }} {{ threadGroup.iterateNum }}
</el-tag>
</el-col>
</el-row>
</template> </template>
<el-form :inline="true"> <el-form :inline="true">
<el-form-item :label="$t('load_test.thread_num')"> <el-form-item :label="$t('load_test.thread_num')">
@ -705,4 +713,10 @@ export default {
.title { .title {
margin-left: 60px; margin-left: 60px;
} }
.wordwrap {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style> </style>