fix(环境设置): 修复环境设置时超时时间不能点加减号

--bug=1008086 --user=刘瑞斌 【环境管理】-创建环境时链接超时和响应超时的加减 功能不好使 https://www.tapd.cn/55049933/s/1070608
This commit is contained in:
CaptainB 2021-11-19 17:20:15 +08:00 committed by 刘瑞斌
parent 9971385089
commit 737f3d7819
2 changed files with 26 additions and 22 deletions

View File

@ -3,21 +3,21 @@
<el-table :data="hostTable" style="width: 100%" @cell-dblclick="dblHostTable" class="ht-tb">
<el-table-column prop="ip" label="IP">
<template slot-scope="scope">
<el-input v-if="scope.row.status" v-model="scope.row.ip"></el-input>
<el-input size="small" v-if="scope.row.status" v-model="scope.row.ip"></el-input>
<span v-else>{{scope.row.ip}}</span>
</template>
</el-table-column>
<el-table-column prop="domain" :label="$t('load_test.domain')">
<template slot-scope="scope">
<el-input v-if="scope.row.status" v-model="scope.row.domain"></el-input>
<el-input size="small" v-if="scope.row.status" v-model="scope.row.domain"></el-input>
<span v-else>{{scope.row.domain}}</span>
</template>
</el-table-column>
<el-table-column prop="annotation" :label="$t('commons.annotation')">
<template slot-scope="scope">
<el-input v-if="scope.row.status" v-model="scope.row.annotation"></el-input>
<el-input size="small" v-if="scope.row.status" v-model="scope.row.annotation"></el-input>
<span v-else>{{scope.row.annotation}}</span>
</template>
</el-table-column>

View File

@ -6,10 +6,16 @@
<el-switch v-model="commonConfig.enableHost" active-text="Hosts"/>
</el-form-item>
<el-form-item>
<span>{{$t('api_test.environment.request_timeout')}}:</span>
<el-input-number style="margin-left: 20px" v-model="commonConfig.requestTimeout">{{$t('api_test.environment.globalVariable')}}</el-input-number>
<span style="margin-left: 30px">{{$t('api_test.environment.response_timeout')}}:</span>
<el-input-number style="margin-left: 20px" v-model="commonConfig.responseTimeout">{{$t('api_test.environment.globalVariable')}}</el-input-number>
<span>{{ $t('api_test.environment.request_timeout') }}:</span>
<el-input-number style="margin-left: 20px" controls-position="right" size="small"
v-model="commonConfig.requestTimeout">
{{ $t('api_test.environment.globalVariable') }}
</el-input-number>
<span style="margin-left: 30px">{{ $t('api_test.environment.response_timeout') }}:</span>
<el-input-number style="margin-left: 20px" controls-position="right" size="small"
v-model="commonConfig.responseTimeout">
{{ $t('api_test.environment.globalVariable') }}
</el-input-number>
</el-form-item>
<el-form-item>
<ms-api-host-table v-if="commonConfig.enableHost" :hostTable="commonConfig.hosts" ref="refHostTable"/>
@ -19,7 +25,7 @@
</template>
<script>
import {CommonConfig, Environment} from "../../model/EnvironmentModel";
import {CommonConfig} from "../../model/EnvironmentModel";
import MsApiScenarioVariables from "../ApiScenarioVariables";
import MsApiHostTable from "../ApiHostTable";
@ -35,26 +41,24 @@ export default {
},
data() {
return {
rules: {
},
}
rules: {},
};
},
created() {
if(!this.commonConfig.requestTimeout){
this.commonConfig.requestTimeout = 60000;
if (!this.commonConfig.requestTimeout) {
this.$set(this.commonConfig, 'requestTimeout', 60000);
}
if(!this.commonConfig.responseTimeout){
this.commonConfig.responseTimeout = 60000;
if (!this.commonConfig.responseTimeout) {
this.$set(this.commonConfig, 'responseTimeout', 60000);
}
},
watch: {
commonConfig(){
if(!this.commonConfig.requestTimeout){
this.commonConfig.requestTimeout = 60000;
commonConfig() {
if (!this.commonConfig.requestTimeout) {
this.$set(this.commonConfig, 'requestTimeout', 60000);
}
if(!this.commonConfig.responseTimeout){
this.commonConfig.responseTimeout = 60000;
if (!this.commonConfig.responseTimeout) {
this.$set(this.commonConfig, 'responseTimeout', 60000);
}
}
},
@ -82,7 +86,7 @@ export default {
return isValidate;
}
}
}
};
</script>
<style scoped>