提交 f01bbf0f 编写于 作者: Q q4speed

修复响应时间断言更新bug

上级 f30c3032
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<el-row :gutter="10" type="flex" justify="space-between" align="middle"> <el-row :gutter="10" type="flex" justify="space-between" align="middle">
<el-col> <el-col>
<el-input v-model="time" step="100" size="small" type="number" <el-input :value="value" v-bind="$attrs" step="100" size="small" type="number" @change="change" @input="input"
:placeholder="$t('api_test.request.assertions.response_in_time')"/> :placeholder="$t('api_test.request.assertions.response_in_time')"/>
</el-col> </el-col>
<el-col class="assertion-btn"> <el-col class="assertion-btn">
...@@ -14,32 +14,32 @@ ...@@ -14,32 +14,32 @@
</template> </template>
<script> <script>
import {ResponseTime} from "../../model/ScenarioModel"; import {ResponseTime} from "../../model/ScenarioModel";
export default { export default {
name: "MsApiAssertionResponseTime", name: "MsApiAssertionResponseTime",
props: { props: {
edit: Boolean,
duration: ResponseTime, duration: ResponseTime,
value: [Number, String],
edit: Boolean,
callback: Function callback: Function
}, },
data() {
return {
time: this.duration.value
}
},
methods: { methods: {
add: function () { add() {
setTimeout(() => { this.duration.value = this.value;
this.duration.value = this.time; this.callback();
this.callback();
})
}, },
remove: function () { remove() {
this.duration.value = undefined; this.duration.value = undefined;
},
change(value) {
this.$emit('change', value);
},
input(value) {
this.$emit('input', value);
} }
} }
} }
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
<el-col :span="20"> <el-col :span="20">
<ms-api-assertion-text :list="assertions.regex" v-if="type === options.TEXT" :callback="after"/> <ms-api-assertion-text :list="assertions.regex" v-if="type === options.TEXT" :callback="after"/>
<ms-api-assertion-regex :list="assertions.regex" v-if="type === options.REGEX" :callback="after"/> <ms-api-assertion-regex :list="assertions.regex" v-if="type === options.REGEX" :callback="after"/>
<ms-api-assertion-response-time :duration="assertions.duration" v-if="type === options.RESPONSE_TIME" <ms-api-assertion-response-time v-model="time" :duration="assertions.duration"
:callback="after"/> v-if="type === options.RESPONSE_TIME" :callback="after"/>
</el-col> </el-col>
</el-row> </el-row>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
import MsApiAssertionText from "./ApiAssertionText"; import MsApiAssertionText from "./ApiAssertionText";
import MsApiAssertionRegex from "./ApiAssertionRegex"; import MsApiAssertionRegex from "./ApiAssertionRegex";
import MsApiAssertionResponseTime from "./ApiAssertionResponseTime"; import MsApiAssertionResponseTime from "./ApiAssertionResponseTime";
import {ASSERTION_TYPE, Assertions} from "../../model/ScenarioModel"; import {ASSERTION_TYPE, Assertions, ResponseTime} from "../../model/ScenarioModel";
import MsApiAssertionsEdit from "./ApiAssertionsEdit"; import MsApiAssertionsEdit from "./ApiAssertionsEdit";
export default { export default {
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
data() { data() {
return { return {
options: ASSERTION_TYPE, options: ASSERTION_TYPE,
time: "",
type: "", type: "",
} }
}, },
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<div> <div>
{{$t("api_test.request.assertions.response_time")}} {{$t("api_test.request.assertions.response_time")}}
</div> </div>
<ms-api-assertion-response-time :duration="assertions.duration" :edit="true"/> <ms-api-assertion-response-time v-model="assertions.duration.value" :duration="assertions.duration" :edit="true"/>
</div> </div>
</div> </div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册