fix(接口测试): 文档结构增加移除功能

--bug=1008049 --user=赵勇 【接口测试】文档结构断言没有删除按钮 https://www.tapd.cn/55049933/s/1070011
This commit is contained in:
fit2-zhao 2021-11-18 17:54:41 +08:00 committed by fit2-zhao
parent be5f19854b
commit 3e33ef293d
3 changed files with 9 additions and 4 deletions

View File

@ -57,7 +57,10 @@
:edit="true"/>
</div>
<div class="assertion-item-editing response-time" v-if="isDocument">
<div> {{ assertions.document.type }}-{{ $t("api_test.definition.request.document_structure") }}</div>
<div>
{{ assertions.document.type }}-{{ $t("api_test.definition.request.document_structure") }}
<el-button :disabled="isReadOnly" type="danger" size="mini" icon="el-icon-delete" circle @click="remove" style="float: right"/>
</div>
<ms-document-body :document="assertions.document" :apiId="apiId"/>
</div>
</div>
@ -112,6 +115,9 @@ export default {
}
},
methods: {
remove() {
this.assertions.document = {type: "JSON", data: {xmlFollowAPI: false, jsonFollowAPI: false, json: [], xml: []}};
},
reload() {
this.loading = true
this.$nextTick(() => {

View File

@ -1,5 +1,5 @@
<template>
<div class="ms-border">
<div class="ms-border" style="margin-top: 10px">
<div style="margin-bottom: 10px">
<span class="ms-import" @click="importData">
<i class="el-icon-edit-outline" style="font-size: 16px"/>

View File

@ -8,8 +8,7 @@
</el-select>
</el-col>
<el-col class="assertion-btn">
<el-button :disabled="isReadOnly" type="danger" size="mini" icon="el-icon-delete" circle @click="remove" v-if="edit"/>
<el-button :disabled="isReadOnly" type="primary" size="small" @click="add" v-else>
<el-button :disabled="isReadOnly" type="primary" size="small" @click="add">
{{ $t('api_test.request.assertions.add') }}
</el-button>
</el-col>