接口测试只读
This commit is contained in:
parent
445d90c955
commit
aa60ed59fd
|
@ -1,17 +1,17 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-radio-group v-model="body.type" size="mini">
|
||||
<el-radio-button :label="type.KV">
|
||||
<el-radio-button :disabled="isReadOnly" :label="type.KV">
|
||||
{{$t('api_test.request.body_kv')}}
|
||||
</el-radio-button>
|
||||
<el-radio-button :label="type.RAW">
|
||||
<el-radio-button :disabled="isReadOnly" :label="type.RAW">
|
||||
{{$t('api_test.request.body_text')}}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<ms-api-key-value :items="body.kvs" v-if="body.isKV()"/>
|
||||
<ms-api-key-value :is-read-only="isReadOnly" :items="body.kvs" v-if="body.isKV()"/>
|
||||
|
||||
<el-input class="textarea" type="textarea" v-model="body.raw" :autosize="{ minRows: 10, maxRows: 25}" resize="none"
|
||||
<el-input :disabled="isReadOnly" class="textarea" type="textarea" v-model="body.raw" :autosize="{ minRows: 10, maxRows: 25}" resize="none"
|
||||
v-else/>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -24,7 +24,11 @@
|
|||
name: "MsApiBody",
|
||||
components: {MsApiKeyValue},
|
||||
props: {
|
||||
body: Body
|
||||
body: Body,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
|
|
|
@ -6,16 +6,16 @@
|
|||
<div class="kv-row" v-for="(item, index) in items" :key="index">
|
||||
<el-row type="flex" :gutter="20" justify="space-between" align="middle">
|
||||
<el-col>
|
||||
<el-input v-model="item.name" size="small" maxlength="100" @change="change"
|
||||
<el-input :disabled="isReadOnly" v-model="item.name" size="small" maxlength="100" @change="change"
|
||||
:placeholder="$t('api_test.key')" show-word-limit/>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-input v-model="item.value" size="small" maxlength="100" @change="change"
|
||||
<el-input :disabled="isReadOnly" v-model="item.value" size="small" maxlength="100" @change="change"
|
||||
:placeholder="$t('api_test.value')" show-word-limit/>
|
||||
</el-col>
|
||||
<el-col class="kv-delete">
|
||||
<el-button size="mini" class="el-icon-delete-solid" circle @click="remove(index)"
|
||||
:disabled="isDisable(index)"/>
|
||||
:disabled="isDisable(index) || isReadOnly"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
@ -30,7 +30,11 @@
|
|||
|
||||
props: {
|
||||
description: String,
|
||||
items: Array
|
||||
items: Array,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
<el-dropdown trigger="click" @command="handleCommand">
|
||||
<span class="el-dropdown-link el-icon-more"/>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type: 'copy', index: index}">
|
||||
<el-dropdown-item :disabled="isReadOnly" :command="{type: 'copy', index: index}">
|
||||
{{$t('api_test.request.copy')}}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type: 'delete', index: index}">
|
||||
<el-dropdown-item :disabled="isReadOnly" :command="{type: 'delete', index: index}">
|
||||
{{$t('api_test.request.delete')}}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
|
@ -26,7 +26,7 @@
|
|||
</el-row>
|
||||
</div>
|
||||
</draggable>
|
||||
<el-button class="request-create" type="primary" size="mini" icon="el-icon-plus" plain @click="createRequest"/>
|
||||
<el-button :disabled="isReadOnly" class="request-create" type="primary" size="mini" icon="el-icon-plus" plain @click="createRequest"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -41,7 +41,11 @@
|
|||
|
||||
props: {
|
||||
requests: Array,
|
||||
open: Function
|
||||
open: Function,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<template>
|
||||
<el-form :model="request" :rules="rules" ref="request" label-width="100px">
|
||||
<el-form-item :label="$t('api_test.request.name')" prop="name">
|
||||
<el-input v-model="request.name" maxlength="100" show-word-limit/>
|
||||
<el-input :disabled="isReadOnly" v-model="request.name" maxlength="100" show-word-limit/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('api_test.request.url')" prop="url">
|
||||
<el-input v-model="request.url" maxlength="100" :placeholder="$t('api_test.request.url_description')"
|
||||
<el-input :disabled="isReadOnly" v-model="request.url" maxlength="100" :placeholder="$t('api_test.request.url_description')"
|
||||
@change="urlChange" clearable>
|
||||
<el-select v-model="request.method" slot="prepend" class="request-method-select" @change="methodChange">
|
||||
<el-select :disabled="isReadOnly" v-model="request.method" slot="prepend" class="request-method-select" @change="methodChange">
|
||||
<el-option label="GET" value="GET"/>
|
||||
<el-option label="POST" value="POST"/>
|
||||
<el-option label="PUT" value="PUT"/>
|
||||
|
@ -22,20 +22,20 @@
|
|||
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane :label="$t('api_test.request.parameters')" name="parameters">
|
||||
<ms-api-key-value :items="request.parameters" :description="$t('api_test.request.parameters_desc')"
|
||||
<ms-api-key-value :is-read-only="isReadOnly" :items="request.parameters" :description="$t('api_test.request.parameters_desc')"
|
||||
@change="parametersChange"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('api_test.request.headers')" name="headers">
|
||||
<ms-api-key-value :items="request.headers"/>
|
||||
<ms-api-key-value :is-read-only="isReadOnly" :items="request.headers"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('api_test.request.body')" name="body" v-if="isNotGet">
|
||||
<ms-api-body :body="request.body"/>
|
||||
<ms-api-body :is-read-only="isReadOnly" :body="request.body"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('api_test.request.assertions.label')" name="assertions">
|
||||
<ms-api-assertions :assertions="request.assertions"/>
|
||||
<ms-api-assertions :is-read-only="isReadOnly" :assertions="request.assertions"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('api_test.request.extract.label')" name="extract">
|
||||
<ms-api-extract :extract="request.extract"/>
|
||||
<ms-api-extract :is-read-only="isReadOnly" :extract="request.extract"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
|
@ -52,7 +52,11 @@
|
|||
name: "MsApiRequestForm",
|
||||
components: {MsApiExtract, MsApiAssertions, MsApiBody, MsApiKeyValue},
|
||||
props: {
|
||||
request: Request
|
||||
request: Request,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
|
|
|
@ -16,27 +16,27 @@
|
|||
<el-dropdown trigger="click" @command="handleCommand">
|
||||
<span class="el-dropdown-link el-icon-more scenario-btn"/>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type: 'copy', index: index}">
|
||||
<el-dropdown-item :disabled="isReadOnly" :command="{type: 'copy', index: index}">
|
||||
{{$t('api_test.scenario.copy')}}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'delete', index:index}">
|
||||
<el-dropdown-item :disabled="isReadOnly" :command="{type:'delete', index:index}">
|
||||
{{$t('api_test.scenario.delete')}}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
<ms-api-request-config :requests="scenario.requests" :open="select"/>
|
||||
<ms-api-request-config :is-read-only="isReadOnly" :requests="scenario.requests" :open="select"/>
|
||||
</ms-api-collapse-item>
|
||||
</draggable>
|
||||
</ms-api-collapse>
|
||||
</div>
|
||||
<el-button class="scenario-create" type="primary" size="mini" icon="el-icon-plus" plain @click="createScenario"/>
|
||||
<el-button :disabled="isReadOnly" class="scenario-create" type="primary" size="mini" icon="el-icon-plus" plain @click="createScenario"/>
|
||||
</el-aside>
|
||||
|
||||
<el-main class="scenario-main">
|
||||
<div class="scenario-form">
|
||||
<ms-api-scenario-form :scenario="selected" v-if="isScenario"/>
|
||||
<ms-api-request-form :request="selected" v-if="isRequest"/>
|
||||
<ms-api-scenario-form :is-read-only="isReadOnly" :scenario="selected" v-if="isScenario"/>
|
||||
<ms-api-request-form :is-read-only="isReadOnly" :request="selected" v-if="isRequest"/>
|
||||
</div>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
@ -65,7 +65,11 @@
|
|||
},
|
||||
|
||||
props: {
|
||||
scenarios: Array
|
||||
scenarios: Array,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<el-form :model="scenario" :rules="rules" ref="scenario" label-width="100px">
|
||||
<el-form-item :label="$t('api_test.scenario.name')" prop="name">
|
||||
<el-input v-model="scenario.name" maxlength="100" show-word-limit/>
|
||||
<el-input :disabled="isReadOnly" v-model="scenario.name" maxlength="100" show-word-limit/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item :label="$t('api_test.scenario.base_url')" prop="url">-->
|
||||
|
@ -10,10 +10,10 @@
|
|||
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane :label="$t('api_test.scenario.variables')" name="parameters">
|
||||
<ms-api-scenario-variables :items="scenario.variables" :description="$t('api_test.scenario.kv_description')"/>
|
||||
<ms-api-scenario-variables :is-read-only="isReadOnly" :items="scenario.variables" :description="$t('api_test.scenario.kv_description')"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('api_test.scenario.headers')" name="headers">
|
||||
<ms-api-key-value :items="scenario.headers" :description="$t('api_test.scenario.kv_description')"/>
|
||||
<ms-api-key-value :is-read-only="isReadOnly" :items="scenario.headers" :description="$t('api_test.scenario.kv_description')"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
|
@ -28,7 +28,11 @@
|
|||
name: "MsApiScenarioForm",
|
||||
components: {MsApiScenarioVariables, MsApiKeyValue},
|
||||
props: {
|
||||
scenario: Scenario
|
||||
scenario: Scenario,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
|
|
|
@ -6,16 +6,16 @@
|
|||
<div class="kv-row" v-for="(item, index) in items" :key="index">
|
||||
<el-row type="flex" :gutter="20" justify="space-between" align="middle">
|
||||
<el-col>
|
||||
<ms-api-variable-input v-model="item.name" size="small" maxlength="100" @change="change"
|
||||
<ms-api-variable-input :is-read-only="isReadOnly" v-model="item.name" size="small" maxlength="100" @change="change"
|
||||
:placeholder="$t('api_test.variable_name')" show-word-limit/>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-input v-model="item.value" size="small" maxlength="100" @change="change"
|
||||
<el-input :disabled="isReadOnly" v-model="item.value" size="small" maxlength="100" @change="change"
|
||||
:placeholder="$t('api_test.value')" show-word-limit/>
|
||||
</el-col>
|
||||
<el-col class="kv-delete">
|
||||
<el-button size="mini" class="el-icon-delete-solid" circle @click="remove(index)"
|
||||
:disabled="isDisable(index)"/>
|
||||
:disabled="isDisable(index) || isReadOnly"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
@ -31,7 +31,11 @@
|
|||
components: {MsApiVariableInput},
|
||||
props: {
|
||||
description: String,
|
||||
items: Array
|
||||
items: Array,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="variable-input">
|
||||
<el-input :value="value" v-bind="$attrs" :size="size" @change="change" @input="input"/>
|
||||
<el-input :disabled="isReadOnly" :value="value" v-bind="$attrs" :size="size" @change="change" @input="input"/>
|
||||
<div class="variable-combine" v-if="value">
|
||||
<div class="variable">{{variable}}</div>
|
||||
<el-tooltip :content="$t('api_test.copied')" manual v-model="visible" placement="top" :visible-arrow="false">
|
||||
|
@ -14,7 +14,14 @@
|
|||
export default {
|
||||
name: "MsApiVariableInput",
|
||||
|
||||
props: ['value', 'size'],
|
||||
props: {
|
||||
value: String,
|
||||
size: String,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div>
|
||||
<el-row :gutter="10" type="flex" justify="space-between" align="middle">
|
||||
<el-col class="assertion-select">
|
||||
<el-select class="assertion-item" v-model="regex.subject" size="small"
|
||||
<el-select :disabled="isReadOnly" class="assertion-item" v-model="regex.subject" size="small"
|
||||
:placeholder="$t('api_test.request.assertions.select_subject')">
|
||||
<el-option label="Response Code" :value="subjects.RESPONSE_CODE"/>
|
||||
<el-option label="Response Headers" :value="subjects.RESPONSE_HEADERS"/>
|
||||
|
@ -10,12 +10,12 @@
|
|||
</el-select>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-input v-model="regex.expression" maxlength="255" size="small" show-word-limit
|
||||
<el-input :disabled="isReadOnly" v-model="regex.expression" maxlength="255" size="small" show-word-limit
|
||||
:placeholder="$t('api_test.request.assertions.expression')"/>
|
||||
</el-col>
|
||||
<el-col class="assertion-btn">
|
||||
<el-button type="danger" size="mini" icon="el-icon-delete" circle @click="remove" v-if="edit"/>
|
||||
<el-button type="primary" size="small" icon="el-icon-plus" plain @click="add" v-else/>
|
||||
<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-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
@ -40,7 +40,11 @@
|
|||
},
|
||||
index: Number,
|
||||
list: Array,
|
||||
callback: Function
|
||||
callback: Function,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
<div>
|
||||
<el-row :gutter="10" type="flex" justify="space-between" align="middle">
|
||||
<el-col>
|
||||
<el-input :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"
|
||||
:placeholder="$t('api_test.request.assertions.response_in_time')"/>
|
||||
</el-col>
|
||||
<el-col class="assertion-btn">
|
||||
<el-button type="danger" size="mini" icon="el-icon-delete" circle @click="remove" v-if="edit"/>
|
||||
<el-button type="primary" size="small" icon="el-icon-plus" plain @click="add" v-else/>
|
||||
<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-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
@ -24,7 +24,11 @@
|
|||
duration: ResponseTime,
|
||||
value: [Number, String],
|
||||
edit: Boolean,
|
||||
callback: Function
|
||||
callback: Function,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div>
|
||||
<el-row :gutter="10" type="flex" justify="space-between" align="middle">
|
||||
<el-col class="assertion-select">
|
||||
<el-select class="assertion-item" v-model="subject" size="small"
|
||||
<el-select :disabled="isReadOnly" class="assertion-item" v-model="subject" size="small"
|
||||
:placeholder="$t('api_test.request.assertions.select_subject')">
|
||||
<el-option label="Response Code" :value="subjects.RESPONSE_CODE"/>
|
||||
<el-option label="Response Headers" :value="subjects.RESPONSE_HEADERS"/>
|
||||
|
@ -10,7 +10,7 @@
|
|||
</el-select>
|
||||
</el-col>
|
||||
<el-col class="assertion-select">
|
||||
<el-select class="assertion-item" v-model="condition" size="small"
|
||||
<el-select :disabled="isReadOnly" class="assertion-item" v-model="condition" size="small"
|
||||
:placeholder="$t('api_test.request.assertions.select_condition')">
|
||||
<el-option :label="$t('api_test.request.assertions.contains')" value="CONTAINS"/>
|
||||
<el-option :label="$t('api_test.request.assertions.not_contains')" value="NOT_CONTAINS"/>
|
||||
|
@ -20,11 +20,11 @@
|
|||
</el-select>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-input v-model="value" maxlength="200" size="small" show-word-limit
|
||||
<el-input :disabled="isReadOnly" v-model="value" maxlength="200" size="small" show-word-limit
|
||||
:placeholder="$t('api_test.request.assertions.value')"/>
|
||||
</el-col>
|
||||
<el-col class="assertion-btn">
|
||||
<el-button type="primary" size="small" icon="el-icon-plus" plain @click="add"/>
|
||||
<el-button :disabled="isReadOnly" type="primary" size="small" icon="el-icon-plus" plain @click="add"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
@ -38,7 +38,11 @@
|
|||
|
||||
props: {
|
||||
list: Array,
|
||||
callback: Function
|
||||
callback: Function,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="4">
|
||||
<el-select class="assertion-item" v-model="type" :placeholder="$t('api_test.request.assertions.select_type')"
|
||||
<el-select :disabled="isReadOnly" class="assertion-item" v-model="type" :placeholder="$t('api_test.request.assertions.select_type')"
|
||||
size="small">
|
||||
<el-option :label="$t('api_test.request.assertions.text')" :value="options.TEXT"/>
|
||||
<el-option :label="$t('api_test.request.assertions.regex')" :value="options.REGEX"/>
|
||||
|
@ -10,14 +10,14 @@
|
|||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<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-response-time v-model="time" :duration="assertions.duration"
|
||||
<ms-api-assertion-text :is-read-only="isReadOnly" :list="assertions.regex" v-if="type === options.TEXT" :callback="after"/>
|
||||
<ms-api-assertion-regex :is-read-only="isReadOnly" :list="assertions.regex" v-if="type === options.REGEX" :callback="after"/>
|
||||
<ms-api-assertion-response-time :is-read-only="isReadOnly" v-model="time" :duration="assertions.duration"
|
||||
v-if="type === options.RESPONSE_TIME" :callback="after"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<ms-api-assertions-edit :assertions="assertions"/>
|
||||
<ms-api-assertions-edit :is-read-only="isReadOnly" :assertions="assertions"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -34,7 +34,11 @@
|
|||
components: {MsApiAssertionsEdit, MsApiAssertionResponseTime, MsApiAssertionRegex, MsApiAssertionText},
|
||||
|
||||
props: {
|
||||
assertions: Assertions
|
||||
assertions: Assertions,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
{{$t("api_test.request.assertions.regex")}}
|
||||
</div>
|
||||
<div class="regex-item" v-for="(regex, index) in assertions.regex" :key="index">
|
||||
<ms-api-assertion-regex :list="assertions.regex" :regex="regex" :edit="true" :index="index"/>
|
||||
<ms-api-assertion-regex :is-read-only="isReadOnly" :list="assertions.regex" :regex="regex" :edit="true" :index="index"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
|||
<div>
|
||||
{{$t("api_test.request.assertions.response_time")}}
|
||||
</div>
|
||||
<ms-api-assertion-response-time v-model="assertions.duration.value" :duration="assertions.duration" :edit="true"/>
|
||||
<ms-api-assertion-response-time :is-read-only="isReadOnly" v-model="assertions.duration.value" :duration="assertions.duration" :edit="true"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -30,7 +30,11 @@
|
|||
components: {MsApiAssertionResponseTime, MsApiAssertionRegex},
|
||||
|
||||
props: {
|
||||
assertions: Assertions
|
||||
assertions: Assertions,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
</div>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="4">
|
||||
<el-select class="extract-item" v-model="type" :placeholder="$t('api_test.request.extract.select_type')"
|
||||
<el-select :disabled="isReadOnly" class="extract-item" v-model="type" :placeholder="$t('api_test.request.extract.select_type')"
|
||||
size="small">
|
||||
<el-option :label="$t('api_test.request.extract.regex')" :value="options.REGEX"/>
|
||||
<el-option label="JSONPath" :value="options.JSON_PATH"/>
|
||||
|
@ -13,11 +13,11 @@
|
|||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<ms-api-extract-common :extract-type="type" :list="list" v-if="type" :callback="after"/>
|
||||
<ms-api-extract-common :is-read-only="isReadOnly" :extract-type="type" :list="list" v-if="type" :callback="after"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<ms-api-extract-edit :extract="extract"/>
|
||||
<ms-api-extract-edit :is-read-only="isReadOnly" :extract="extract"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -35,7 +35,11 @@
|
|||
},
|
||||
|
||||
props: {
|
||||
extract: Extract
|
||||
extract: Extract,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
<div>
|
||||
<el-row :gutter="10" type="flex" justify="space-between" align="middle">
|
||||
<el-col :span="10">
|
||||
<ms-api-variable-input v-model="common.variable" size="small" maxlength="60" @change="change"
|
||||
<ms-api-variable-input :is-read-only="isReadOnly" v-model="common.variable" size="small" maxlength="60" @change="change"
|
||||
:placeholder="$t('api_test.variable_name')"/>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-input v-model="common.expression" maxlength="255" size="small" :placeholder="expression"/>
|
||||
<el-input :disabled="isReadOnly" v-model="common.expression" maxlength="255" size="small" :placeholder="expression"/>
|
||||
</el-col>
|
||||
<el-col class="extract-btn">
|
||||
<el-button type="danger" size="mini" icon="el-icon-delete" circle @click="remove" v-if="edit"/>
|
||||
<el-button type="primary" size="small" icon="el-icon-plus" plain @click="add" v-else/>
|
||||
<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-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
@ -42,7 +42,11 @@
|
|||
},
|
||||
index: Number,
|
||||
list: Array,
|
||||
callback: Function
|
||||
callback: Function,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
{{$t("api_test.request.extract.regex")}}
|
||||
</div>
|
||||
<div class="regex-item" v-for="(regex, index) in extract.regex" :key="index">
|
||||
<ms-api-extract-common :extract-type="type.REGEX" :list="extract.regex" :common="regex"
|
||||
<ms-api-extract-common :is-read-only="isReadOnly" :extract-type="type.REGEX" :list="extract.regex" :common="regex"
|
||||
:edit="true" :index="index"/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -15,7 +15,7 @@
|
|||
JSONPath
|
||||
</div>
|
||||
<div class="regex-item" v-for="(json, index) in extract.json" :key="index">
|
||||
<ms-api-extract-common :extract-type="type.JSON_PATH" :list="extract.json" :common="json"
|
||||
<ms-api-extract-common :is-read-only="isReadOnly" :extract-type="type.JSON_PATH" :list="extract.json" :common="json"
|
||||
:edit="true" :index="index"/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -25,7 +25,7 @@
|
|||
XPath
|
||||
</div>
|
||||
<div class="regex-item" v-for="(xpath, index) in extract.xpath" :key="index">
|
||||
<ms-api-extract-common :extract-type="type.XPATH" :list="extract.xpath" :common="xpath"
|
||||
<ms-api-extract-common :is-read-only="isReadOnly" :extract-type="type.XPATH" :list="extract.xpath" :common="xpath"
|
||||
:edit="true" :index="index"/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -43,7 +43,11 @@
|
|||
components: {MsApiExtractCommon},
|
||||
|
||||
props: {
|
||||
extract: Extract
|
||||
extract: Extract,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
</el-row>
|
||||
</el-header>
|
||||
|
||||
<ms-api-scenario-config :scenarios="test.scenarioDefinition" ref="config"/>
|
||||
<ms-api-scenario-config :is-read-only="true" :scenarios="test.scenarioDefinition" ref="config"/>
|
||||
|
||||
</el-container>
|
||||
</el-card>
|
||||
|
|
Loading…
Reference in New Issue