fix(接口自动化): 修改移动问题
This commit is contained in:
parent
cc1e26fbdc
commit
413241a688
|
@ -4,6 +4,7 @@
|
|||
@copy="copyRow"
|
||||
@remove="remove"
|
||||
:data="request"
|
||||
:draggable="true"
|
||||
:color="displayColor.color"
|
||||
:background-color="displayColor.backgroundColor"
|
||||
:title="displayTitle">
|
||||
|
@ -12,7 +13,7 @@
|
|||
<slot name="headerLeft">
|
||||
<i class="icon el-icon-arrow-right" :class="{'is-active': request.active}"
|
||||
@click="active(request)"/>
|
||||
<el-input v-if="isShowInput || !request.name" size="small" v-model="request.name" class="name-input"
|
||||
<el-input draggable v-if="isShowInput || !request.name" size="small" v-model="request.name" class="name-input"
|
||||
@blur="isShowInput = false" :placeholder="$t('commons.input_name')"/>
|
||||
<span v-else>
|
||||
{{request.name}}
|
||||
|
@ -48,7 +49,7 @@
|
|||
<ms-dubbo-basis-parameters :request="request" v-if="request.protocol==='DUBBO' || request.protocol==='dubbo://'|| request.type==='DubboSampler'" :showScript="false"/>
|
||||
|
||||
<p class="tip">{{$t('api_test.definition.request.res_param')}} </p>
|
||||
<ms-request-result-tail :currentProtocol="request.protocol" :response="request.requestResult" ref="runResult"/>
|
||||
<ms-request-result-tail draggable :currentProtocol="request.protocol" :response="request.requestResult" ref="runResult"/>
|
||||
|
||||
<!-- 保存操作 -->
|
||||
<el-button type="primary" size="small" style="margin: 20px; float: right" @click="saveTestCase(item)" v-if="!request.referenced">
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
@copy="copyRow"
|
||||
@remove="remove"
|
||||
:data="timer"
|
||||
:draggable="true"
|
||||
:show-collapse="false"
|
||||
color="#67C23A"
|
||||
background-color="#F2F9EE"
|
||||
|
|
|
@ -4,20 +4,21 @@
|
|||
@remove="remove"
|
||||
:data="controller"
|
||||
:show-collapse="false"
|
||||
:draggable="true"
|
||||
color="#E6A23C"
|
||||
background-color="#FCF6EE"
|
||||
:title="$t('api_test.automation.if_controller')">
|
||||
|
||||
<template v-slot:headerLeft>
|
||||
|
||||
<el-input size="small" v-model="controller.variable" style="width: 20%" :placeholder="$t('api_test.request.condition_variable')"/>
|
||||
<el-input draggable size="small" v-model="controller.variable" style="width: 20%" :placeholder="$t('api_test.request.condition_variable')"/>
|
||||
|
||||
<el-select v-model="controller.operator" :placeholder="$t('commons.please_select')" size="small"
|
||||
@change="change" style="width: 10%;margin-left: 10px">
|
||||
<el-option v-for="o in operators" :key="o.value" :label="$t(o.label)" :value="o.value"/>
|
||||
</el-select>
|
||||
|
||||
<el-input size="small" v-model="controller.value" :placeholder="$t('api_test.value')" v-if="!hasEmptyOperator" style="width: 20%;margin-left: 20px"/>
|
||||
<el-input draggable size="small" v-model="controller.value" :placeholder="$t('api_test.value')" v-if="!hasEmptyOperator" style="width: 20%;margin-left: 20px"/>
|
||||
</template>
|
||||
|
||||
</api-base-component>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
@copy="copyRow"
|
||||
@remove="remove"
|
||||
:data="jsr223ProcessorData"
|
||||
:draggable="true"
|
||||
color="#B8741A"
|
||||
background-color="#F9F1EA"
|
||||
:title="title">
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
@copy="copyRow"
|
||||
@remove="remove"
|
||||
:data="controller"
|
||||
:draggable="true"
|
||||
color="#015478"
|
||||
background-color="#E6EEF2"
|
||||
:title="$t('api_test.automation.loop_controller')">
|
||||
|
@ -15,7 +16,7 @@
|
|||
</template>
|
||||
|
||||
|
||||
<div v-if="controller.loopType==='LOOP_COUNT'">
|
||||
<div v-if="controller.loopType==='LOOP_COUNT'" draggable>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<span class="ms-span ms-radio">{{$t('loop.loops')}}</span>
|
||||
|
@ -34,7 +35,7 @@
|
|||
</el-row>
|
||||
</div>
|
||||
|
||||
<div v-else-if="controller.loopType==='FOREACH'">
|
||||
<div v-else-if="controller.loopType==='FOREACH'" draggable>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-input :placeholder="$t('api_test.request.condition_variable')" v-model="controller.forEachController.inputVal" size="small"/>
|
||||
|
@ -52,7 +53,7 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-else draggable>
|
||||
<el-input size="small" v-model="controller.whileController.variable" style="width: 20%" :placeholder="$t('api_test.request.condition_variable')"/>
|
||||
|
||||
<el-select v-model="controller.whileController.operator" :placeholder="$t('commons.please_select')" size="small"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<slot name="headerLeft">
|
||||
<i class="icon el-icon-arrow-right" :class="{'is-active': data.active}"
|
||||
@click="active(data)"/>
|
||||
<el-input v-if="!data.name || isShowInput" size="small" v-model="data.name" class="name-input"
|
||||
<el-input :draggable="draggable" v-if="!data.name || isShowInput" size="small" v-model="data.name" class="name-input"
|
||||
@blur="isShowInput = false" :placeholder="$t('commons.input_name')"/>
|
||||
<span v-else>
|
||||
{{data.name}}
|
||||
|
@ -29,7 +29,7 @@
|
|||
</div>
|
||||
|
||||
<el-collapse-transition>
|
||||
<div v-if="data.active && showCollapse">
|
||||
<div v-if="data.active && showCollapse" draggable>
|
||||
<el-divider></el-divider>
|
||||
<slot></slot>
|
||||
</div>
|
||||
|
@ -46,6 +46,7 @@
|
|||
}
|
||||
},
|
||||
props: {
|
||||
draggable: Boolean,
|
||||
data: {
|
||||
type: Object,
|
||||
default() {
|
||||
|
|
|
@ -5,52 +5,12 @@
|
|||
@remove="remove"
|
||||
@active="active"
|
||||
:data="assertions"
|
||||
:draggable="draggable"
|
||||
color="#A30014"
|
||||
background-color="#F7E6E9"
|
||||
:title="$t('api_test.definition.request.assertions_rule')">
|
||||
|
||||
<el-input :draggable="draggable" size="small" v-model="assertions.name" style="width: 40%;margin-left: 20px" :placeholder="$t('commons.input_name')"/>
|
||||
<div style="margin-right: 20px; float: right">
|
||||
<i class="icon el-icon-arrow-right" :class="{'is-active': assertions.active}" @click="active(assertions)" style="margin-left: 20px"/>
|
||||
<el-switch v-model="assertions.enable" style="margin-left: 10px"/>
|
||||
<el-button size="mini" icon="el-icon-copy-document" circle @click="copyRow" style="margin-left: 10px"/>
|
||||
<el-button size="mini" icon="el-icon-delete" type="danger" circle @click="remove" style="margin-left: 10px"/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 请求参数-->
|
||||
<el-collapse-transition>
|
||||
<div v-if="assertions.active" :draggable="draggable">
|
||||
<div class="assertion-add">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="4">
|
||||
<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.regex')" :value="options.REGEX"/>
|
||||
<el-option :label="'JSONPath'" :value="options.JSON_PATH"/>
|
||||
<el-option :label="'XPath'" :value="options.XPATH2"/>
|
||||
<el-option :label="$t('api_test.request.assertions.response_time')" :value="options.DURATION"/>
|
||||
<el-option :label="$t('api_test.request.assertions.jsr223')" :value="options.JSR223"/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<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-json-path :is-read-only="isReadOnly" :list="assertions.jsonPath"
|
||||
v-if="type === options.JSON_PATH" :callback="after"/>
|
||||
<ms-api-assertion-x-path2 :is-read-only="isReadOnly" :list="assertions.xpath2" v-if="type === options.XPATH2"
|
||||
:callback="after"/>
|
||||
<ms-api-assertion-duration :is-read-only="isReadOnly" v-model="time" :duration="assertions.duration"
|
||||
v-if="type === options.DURATION" :callback="after"/>
|
||||
<ms-api-assertion-jsr223 :is-read-only="isReadOnly" :list="assertions.jsr223" v-if="type === options.JSR223"
|
||||
:callback="after"/>
|
||||
<el-button v-if="!type" :disabled="true" type="primary" size="small">
|
||||
{{ $t('api_test.request.assertions.add') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="assertion-add">
|
||||
<div class="assertion-add" :draggable="draggable">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="4">
|
||||
<el-select :disabled="isReadOnly" class="assertion-item" v-model="type"
|
||||
|
@ -108,7 +68,6 @@
|
|||
|
||||
export default {
|
||||
name: "MsApiAssertions",
|
||||
|
||||
components: {
|
||||
ApiBaseComponent,
|
||||
MsApiJsonpathSuggest,
|
||||
|
@ -119,8 +78,11 @@
|
|||
MsApiAssertionJsonPath,
|
||||
MsApiAssertionsEdit, MsApiAssertionDuration, MsApiAssertionRegex, MsApiAssertionText
|
||||
},
|
||||
|
||||
props: {
|
||||
draggable: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
assertions: {},
|
||||
node: {},
|
||||
request: {},
|
||||
|
@ -129,16 +91,12 @@
|
|||
type: String,
|
||||
default: "margin-top: 10px"
|
||||
},
|
||||
scenario: Scenario,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
draggable: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
options: ASSERTION_TYPE,
|
||||
|
@ -148,7 +106,6 @@
|
|||
reloadData: "",
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
after() {
|
||||
this.type = "";
|
||||
|
@ -192,7 +149,6 @@
|
|||
this.assertions.jsonPath = [];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -215,5 +171,4 @@
|
|||
/deep/ .el-card__body {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue