fix(接口测试): 响应时间断言格式校验

This commit is contained in:
chenjianxing 2020-11-23 11:28:26 +08:00
parent 5e7fd1f72a
commit 1b1611514c
3 changed files with 17 additions and 6 deletions

@ -1 +1 @@
Subproject commit 419c75bca64b7c5bfbd1194d7f0fd9919f0caa04
Subproject commit 57d6f78efa4b0300be188e8b024511ceef0873ed

View File

@ -2,7 +2,7 @@
<div>
<el-row :gutter="10" type="flex" justify="space-between" align="middle">
<el-col>
<el-input :disabled="isReadOnly" :value="value" v-bind="$attrs" step="100" size="small" type="number" @change="change" @input="input"
<el-input :disabled="isReadOnly" :value="value" v-bind="$attrs" step="100" size="small" type="number" @change="change" @input="input" :min="0"
:placeholder="$t('api_test.request.assertions.response_in_time')"/>
</el-col>
<el-col class="assertion-btn">
@ -35,17 +35,28 @@
methods: {
add() {
this.duration.value = this.value;
this.callback();
if (this.validate()) {
this.duration.value = this.value;
this.callback();
}
},
remove() {
this.duration.value = undefined;
},
change(value) {
this.$emit('change', value);
if (this.validate()) {
this.$emit('change', value);
}
},
input(value) {
this.$emit('input', value);
},
validate() {
if (Number(this.value) < 0 || this.value=='') {
this.$error(this.$t('commons.formatErr'));
return false;
}
return true;
}
}
}

@ -1 +1 @@
Subproject commit 33bbdb3f528c914bf333b2c1839dd6d3bbd9b569
Subproject commit 71d57ae5d7f8bb5c93a29504ac6f2300dc189ce9