优化断言和提取页面
This commit is contained in:
parent
cee30dd126
commit
1ab097bc29
|
@ -7,7 +7,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="assertion-btn">
|
<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="danger" size="mini" icon="el-icon-delete" circle @click="remove" v-if="edit"/>
|
||||||
<el-button :disabled="isReadOnly" type="primary" size="small" icon="el-icon-plus" plain @click="add" v-else/>
|
<el-button :disabled="isReadOnly" type="primary" size="small" @click="add" v-else>Add</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="assertion-btn">
|
<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="danger" size="mini" icon="el-icon-delete" circle @click="remove" v-if="edit"/>
|
||||||
<el-button :disabled="isReadOnly" type="primary" size="small" icon="el-icon-plus" plain @click="add" v-else/>
|
<el-button :disabled="isReadOnly" type="primary" size="small" @click="add" v-else>Add</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
:placeholder="$t('api_test.request.assertions.value')"/>
|
:placeholder="$t('api_test.request.assertions.value')"/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col class="assertion-btn">
|
<el-col class="assertion-btn">
|
||||||
<el-button :disabled="isReadOnly" type="primary" size="small" icon="el-icon-plus" plain @click="add"/>
|
<el-button :disabled="isReadOnly" type="primary" size="small" @click="add">Add</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,21 +1,24 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-row :gutter="10">
|
<div class="assertion-add">
|
||||||
<el-col :span="4">
|
<el-row :gutter="10">
|
||||||
<el-select :disabled="isReadOnly" class="assertion-item" v-model="type" :placeholder="$t('api_test.request.assertions.select_type')"
|
<el-col :span="4">
|
||||||
size="small">
|
<el-select :disabled="isReadOnly" class="assertion-item" v-model="type" :placeholder="$t('api_test.request.assertions.select_type')"
|
||||||
<el-option :label="$t('api_test.request.assertions.text')" :value="options.TEXT"/>
|
size="small">
|
||||||
<el-option :label="$t('api_test.request.assertions.regex')" :value="options.REGEX"/>
|
<el-option :label="$t('api_test.request.assertions.text')" :value="options.TEXT"/>
|
||||||
<el-option :label="$t('api_test.request.assertions.response_time')" :value="options.DURATION"/>
|
<el-option :label="$t('api_test.request.assertions.regex')" :value="options.REGEX"/>
|
||||||
</el-select>
|
<el-option :label="$t('api_test.request.assertions.response_time')" :value="options.DURATION"/>
|
||||||
</el-col>
|
</el-select>
|
||||||
<el-col :span="20">
|
</el-col>
|
||||||
<ms-api-assertion-text :is-read-only="isReadOnly" :list="assertions.regex" v-if="type === options.TEXT" :callback="after"/>
|
<el-col :span="20">
|
||||||
<ms-api-assertion-regex :is-read-only="isReadOnly" :list="assertions.regex" v-if="type === options.REGEX" :callback="after"/>
|
<ms-api-assertion-text :is-read-only="isReadOnly" :list="assertions.regex" v-if="type === options.TEXT" :callback="after"/>
|
||||||
<ms-api-assertion-duration :is-read-only="isReadOnly" v-model="time" :duration="assertions.duration"
|
<ms-api-assertion-regex :is-read-only="isReadOnly" :list="assertions.regex" v-if="type === options.REGEX" :callback="after"/>
|
||||||
v-if="type === options.DURATION" :callback="after"/>
|
<ms-api-assertion-duration :is-read-only="isReadOnly" v-model="time" :duration="assertions.duration"
|
||||||
</el-col>
|
v-if="type === options.DURATION" :callback="after"/>
|
||||||
</el-row>
|
<el-button v-if="!type" :disabled="true" type="primary" size="small">Add</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
<ms-api-assertions-edit :is-read-only="isReadOnly" :assertions="assertions"/>
|
<ms-api-assertions-edit :is-read-only="isReadOnly" :assertions="assertions"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -62,4 +65,11 @@
|
||||||
.assertion-item {
|
.assertion-item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.assertion-add {
|
||||||
|
padding: 10px;
|
||||||
|
border: #DCDFE6 solid 1px;
|
||||||
|
margin: 5px 0;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -3,19 +3,23 @@
|
||||||
<div class="extract-description">
|
<div class="extract-description">
|
||||||
{{$t('api_test.request.extract.description')}}
|
{{$t('api_test.request.extract.description')}}
|
||||||
</div>
|
</div>
|
||||||
<el-row :gutter="10">
|
<div class="extract-add">
|
||||||
<el-col :span="2">
|
<el-row :gutter="10">
|
||||||
<el-select :disabled="isReadOnly" class="extract-item" v-model="type" :placeholder="$t('api_test.request.extract.select_type')"
|
<el-col :span="2">
|
||||||
size="small">
|
<el-select :disabled="isReadOnly" class="extract-item" v-model="type" :placeholder="$t('api_test.request.extract.select_type')"
|
||||||
<el-option :label="$t('api_test.request.extract.regex')" :value="options.REGEX"/>
|
size="small">
|
||||||
<el-option label="JSONPath" :value="options.JSON_PATH"/>
|
<el-option :label="$t('api_test.request.extract.regex')" :value="options.REGEX"/>
|
||||||
<el-option label="XPath" :value="options.XPATH"/>
|
<el-option label="JSONPath" :value="options.JSON_PATH"/>
|
||||||
</el-select>
|
<el-option label="XPath" :value="options.XPATH"/>
|
||||||
</el-col>
|
</el-select>
|
||||||
<el-col :span="22">
|
</el-col>
|
||||||
<ms-api-extract-common :is-read-only="isReadOnly" :extract-type="type" :list="list" v-if="type" :callback="after"/>
|
<el-col :span="22">
|
||||||
</el-col>
|
<ms-api-extract-common :is-read-only="isReadOnly" :extract-type="type" :list="list" v-if="type" :callback="after"/>
|
||||||
</el-row>
|
</el-col>
|
||||||
|
|
||||||
|
<el-button v-if="!type" :disabled="true" type="primary" size="small">Add</el-button>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
<ms-api-extract-edit :is-read-only="isReadOnly" :extract="extract"/>
|
<ms-api-extract-edit :is-read-only="isReadOnly" :extract="extract"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -81,4 +85,11 @@
|
||||||
.extract-item {
|
.extract-item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.extract-add {
|
||||||
|
padding: 10px;
|
||||||
|
border: #DCDFE6 solid 1px;
|
||||||
|
margin: 5px 0;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<el-col class="extract-btn">
|
<el-col class="extract-btn">
|
||||||
<el-button :disabled="isReadOnly" type="danger" size="mini" icon="el-icon-delete" circle @click="remove"
|
<el-button :disabled="isReadOnly" type="danger" size="mini" icon="el-icon-delete" circle @click="remove"
|
||||||
v-if="edit"/>
|
v-if="edit"/>
|
||||||
<el-button :disabled="isReadOnly" type="primary" size="small" icon="el-icon-plus" plain @click="add" v-else/>
|
<el-button :disabled="isReadOnly" type="primary" size="small" @click="add" v-else>Add</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue