fix(性能测试): --bug=1007382 --user=刘瑞斌 【性能测试】执行提示参数不能为空,但是都填写了 https://www.tapd.cn/55049933/s/1060870

This commit is contained in:
CaptainB 2021-10-28 14:22:03 +08:00 committed by 刘瑞斌
parent 7fc0ce913b
commit b454e625f9
1 changed files with 17 additions and 15 deletions

View File

@ -6,11 +6,11 @@
<el-form-item :label="$t('load_test.select_resource_pool')">
<el-select v-model="resourcePool" :disabled="isReadOnly" size="mini" @change="resourcePoolChange">
<el-option
v-for="item in resourcePools"
:key="item.id"
:label="item.name"
:disabled="!item.performance"
:value="item.id">
v-for="item in resourcePools"
:key="item.id"
:label="item.name"
:disabled="!item.performance"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
@ -82,10 +82,10 @@
<el-form-item :label="$t('load_test.on_sample_error')">
<el-select v-model="threadGroup.onSampleError" :disabled="isReadOnly" size="mini">
<el-option
v-for="item in onSampleErrors"
:key="item.value"
:label="item.label"
:value="item.value">
v-for="item in onSampleErrors"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
@ -223,7 +223,6 @@
</template>
<script>
import echarts from "echarts";
import MsChart from "@/business/components/common/chart/MsChart";
import {findThreadGroup} from "@/business/components/performance/test/model/ThreadGroup";
import {hasPermission} from "@/common/js/utils";
@ -253,11 +252,11 @@ const DELETED = "deleted";
const hexToRgba = function (hex, opacity) {
return 'rgba(' + parseInt('0x' + hex.slice(1, 3)) + ',' + parseInt('0x' + hex.slice(3, 5)) + ','
+ parseInt('0x' + hex.slice(5, 7)) + ',' + opacity + ')';
+ parseInt('0x' + hex.slice(5, 7)) + ',' + opacity + ')';
};
const hexToRgb = function (hex) {
return 'rgb(' + parseInt('0x' + hex.slice(1, 3)) + ',' + parseInt('0x' + hex.slice(3, 5))
+ ',' + parseInt('0x' + hex.slice(5, 7)) + ')';
+ ',' + parseInt('0x' + hex.slice(5, 7)) + ')';
};
export default {
@ -498,8 +497,8 @@ export default {
let tg = handler.threadGroups[i];
if (tg.enabled === 'false' ||
tg.deleted === 'true' ||
tg.threadType === 'ITERATION') {
tg.deleted === 'true' ||
tg.threadType === 'ITERATION') {
continue;
}
if (this.getDuration(tg) < tg.rampUpTime) {
@ -594,12 +593,15 @@ export default {
}
for (let i = 0; i < this.threadGroups.length; i++) {
let tg = this.threadGroups[i];
if (tg.enabled === 'false' ) {
continue;
}
tg.durationHours = tg.durationHours || 0;
tg.durationMinutes = tg.durationMinutes || 0;
tg.durationSeconds = tg.durationSeconds || 0;
this.getDuration(tg);
if (!tg.threadNumber || !tg.duration
|| !tg.rampUpTime || !tg.step || !tg.iterateNum) {
|| !tg.rampUpTime || !tg.step || !tg.iterateNum) {
this.$warning(this.$t('load_test.pressure_config_params_is_empty'));
this.$emit('changeActive', '1');
return false;