mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-04 13:09:28 +08:00
feat(接口自动化): 统一添加复制功能
This commit is contained in:
parent
541a823339
commit
90a9877178
@ -26,7 +26,8 @@
|
||||
<i class="icon el-icon-arrow-right" :class="{'is-active': request.active}"
|
||||
@click="active(request)" v-if="request.referenced!=undefined && request.referenced!='Deleted' && request.referenced!='REF'"/>
|
||||
<el-switch v-model="request.enable" style="margin-left: 10px"/>
|
||||
<el-button size="mini" icon="el-icon-delete" circle @click="remove" 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>
|
||||
</el-row>
|
||||
<!-- 请求参数-->
|
||||
@ -101,6 +102,9 @@
|
||||
remove() {
|
||||
this.$emit('remove', this.request, this.node);
|
||||
},
|
||||
copyRow() {
|
||||
this.$emit('copyRow', this.request, this.node);
|
||||
},
|
||||
active(item) {
|
||||
item.active = !item.active;
|
||||
this.reload();
|
||||
|
@ -11,7 +11,8 @@
|
||||
<el-tag size="mini" style="margin-left: 20px" v-if="scenario.referenced==='REF'">{{ $t('api_test.scenario.reference') }}</el-tag>
|
||||
<div style="margin-right: 20px; float: right">
|
||||
<el-switch v-model="scenario.enable" style="margin-left: 10px"/>
|
||||
<el-button size="mini" icon="el-icon-delete" circle @click="remove" 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>
|
||||
</el-row>
|
||||
</el-card>
|
||||
@ -55,6 +56,9 @@
|
||||
item.active = !item.active;
|
||||
this.reload();
|
||||
},
|
||||
copyRow() {
|
||||
this.$emit('copyRow', this.scenario, this.node);
|
||||
},
|
||||
reload() {
|
||||
this.loading = true
|
||||
this.$nextTick(() => {
|
||||
|
@ -10,7 +10,8 @@
|
||||
ms
|
||||
<div style="margin-right: 20px; float: right">
|
||||
<el-switch v-model="timer.enable" style="margin-left: 10px"/>
|
||||
<el-button size="mini" icon="el-icon-delete" circle @click="remove" 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>
|
||||
</el-row>
|
||||
</el-card>
|
||||
@ -30,7 +31,10 @@
|
||||
methods: {
|
||||
remove() {
|
||||
this.$emit('remove', this.timer, this.node);
|
||||
}
|
||||
},
|
||||
copyRow() {
|
||||
this.$emit('copyRow', this.timer, this.node);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -79,8 +79,7 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="Tag" prop="tagId">
|
||||
<el-select v-model="currentScenario.tagId" size="small" class="ms-scenario-input" placeholder="Tag"
|
||||
@change="tagChange" :multiple="true">
|
||||
<el-select v-model="currentScenario.tagId" size="small" class="ms-scenario-input" placeholder="Tag" :multiple="true">
|
||||
<el-option
|
||||
v-for="item in tags"
|
||||
:key="item.id"
|
||||
@ -168,26 +167,26 @@
|
||||
<span class="custom-tree-node father" slot-scope="{ node, data}" style="width: 96%">
|
||||
<template>
|
||||
<!-- 场景 -->
|
||||
<ms-api-scenario-component v-if="data.type==='scenario'" :scenario="data" :node="node" @remove="remove"/>
|
||||
<ms-api-scenario-component v-if="data.type==='scenario'" :scenario="data" :node="node" @remove="remove" @copyRow="copyRow"/>
|
||||
<!--条件控制器-->
|
||||
<ms-if-controller :controller="data" :node="node" v-if="data.type==='IfController'" @remove="remove"/>
|
||||
<ms-if-controller :controller="data" :node="node" v-if="data.type==='IfController'" @remove="remove" @copyRow="copyRow"/>
|
||||
<!--等待控制器-->
|
||||
<ms-constant-timer :timer="data" :node="node" v-if="data.type==='ConstantTimer'" @remove="remove"/>
|
||||
<ms-constant-timer :timer="data" :node="node" v-if="data.type==='ConstantTimer'" @remove="remove" @copyRow="copyRow"/>
|
||||
<!--自定义脚本-->
|
||||
<ms-jsr233-processor v-if="data.type==='JSR223Processor'" @remove="remove" :title="$t('api_test.automation.customize_script')"
|
||||
<ms-jsr233-processor v-if="data.type==='JSR223Processor'" @remove="remove" @copyRow="copyRow" :title="$t('api_test.automation.customize_script')"
|
||||
style-type="color: #7B4D12;background-color: #F1EEE9" :jsr223-processor="data" :node="node"/>
|
||||
<!--前置脚本-->
|
||||
<ms-jsr233-processor v-if="data.type==='JSR223PreProcessor'" @remove="remove" :title="$t('api_test.definition.request.pre_script')"
|
||||
<ms-jsr233-processor v-if="data.type==='JSR223PreProcessor'" @remove="remove" @copyRow="copyRow" :title="$t('api_test.definition.request.pre_script')"
|
||||
style-type="color: #B8741A;background-color: #F9F1EA" :jsr223-processor="data" :node="node"/>
|
||||
<!--后置脚本-->
|
||||
<ms-jsr233-processor v-if="data.type==='JSR223PostProcessor'" @remove="remove" :title="$t('api_test.definition.request.post_script')"
|
||||
<ms-jsr233-processor v-if="data.type==='JSR223PostProcessor'" @remove="remove" @copyRow="copyRow" :title="$t('api_test.definition.request.post_script')"
|
||||
style-type="color: #783887;background-color: #F2ECF3" :jsr223-processor="data" :node="node"/>
|
||||
<!--断言规则-->
|
||||
<ms-api-assertions v-if="data.type==='Assertions'" @remove="remove" customizeStyle="margin-top: 0px" :assertions="data" :node="node"/>
|
||||
<ms-api-assertions v-if="data.type==='Assertions'" @remove="remove" @copyRow="copyRow" customizeStyle="margin-top: 0px" :assertions="data" :node="node"/>
|
||||
<!--提取规则-->
|
||||
<ms-api-extract @remove="remove" v-if="data.type==='Extract'" customizeStyle="margin-top: 0px" :extract="data" :node="node"/>
|
||||
<ms-api-extract @remove="remove" @copyRow="copyRow" v-if="data.type==='Extract'" customizeStyle="margin-top: 0px" :extract="data" :node="node"/>
|
||||
<!--API 导入 -->
|
||||
<ms-api-component :request="data" @remove="remove" v-if="data.type==='HTTPSamplerProxy'||data.type==='DubboSampler'||data.type==='JDBCSampler'||data.type==='TCPSampler'" :node="node"/>
|
||||
<ms-api-component :request="data" @remove="remove" @copyRow="copyRow" v-if="data.type==='HTTPSamplerProxy'||data.type==='DubboSampler'||data.type==='JDBCSampler'||data.type==='TCPSampler'" :node="node"/>
|
||||
</template>
|
||||
</span>
|
||||
</el-tree>
|
||||
@ -513,9 +512,6 @@
|
||||
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
|
||||
this.maintainerOptions = response.data;
|
||||
});
|
||||
},
|
||||
tagChange() {
|
||||
|
||||
},
|
||||
openTagConfig() {
|
||||
if (!this.projectId) {
|
||||
@ -546,6 +542,16 @@
|
||||
this.sort();
|
||||
this.reload();
|
||||
},
|
||||
copyRow(row, node) {
|
||||
const parent = node.parent
|
||||
const hashTree = parent.data.hashTree || parent.data;
|
||||
let obj = {};
|
||||
Object.assign(obj, row);
|
||||
obj.resourceId = getUUID();
|
||||
hashTree.push(obj);
|
||||
this.sort();
|
||||
this.reload();
|
||||
},
|
||||
reload() {
|
||||
this.isReloadData = true
|
||||
this.$nextTick(() => {
|
||||
|
@ -16,7 +16,8 @@
|
||||
<el-input size="small" v-model="controller.value" :placeholder="$t('api_test.value')" v-if="!hasEmptyOperator" style="width: 20%;margin-left: 20px"/>
|
||||
<div style="margin-right: 20px; float: right">
|
||||
<el-switch v-model="controller.enable" style="margin-left: 10px"/>
|
||||
<el-button size="mini" icon="el-icon-delete" circle @click="remove" 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>
|
||||
</el-row>
|
||||
</el-card>
|
||||
@ -72,6 +73,9 @@
|
||||
remove() {
|
||||
this.$emit('remove', this.controller, this.node);
|
||||
},
|
||||
copyRow() {
|
||||
this.$emit('copyRow', this.controller, this.node);
|
||||
},
|
||||
change(value) {
|
||||
if (value.indexOf("empty") > 0 && !!this.controller.value) {
|
||||
this.controller.value = "";
|
||||
|
@ -10,7 +10,8 @@
|
||||
<div style="margin-right: 20px; float: right">
|
||||
<i class="icon el-icon-arrow-right" :class="{'is-active': this.jsr223ProcessorData.active}" @click="changeActive" style="margin-left: 20px"/>
|
||||
<el-switch v-model="jsr223ProcessorData.enable" style="margin-left: 10px"/>
|
||||
<el-button size="mini" icon="el-icon-delete" circle @click="remove" 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-row>
|
||||
@ -142,6 +143,9 @@
|
||||
remove() {
|
||||
this.$emit('remove', this.jsr223ProcessorData, this.node);
|
||||
},
|
||||
copyRow() {
|
||||
this.$emit('copyRow', this.jsr223ProcessorData, this.node);
|
||||
},
|
||||
reload() {
|
||||
this.isCodeEditAlive = false;
|
||||
this.$nextTick(() => (this.isCodeEditAlive = true));
|
||||
|
@ -11,7 +11,8 @@
|
||||
<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-delete" circle @click="remove" 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>
|
||||
<!-- 请求参数-->
|
||||
@ -109,6 +110,9 @@
|
||||
this.reloadData = getUUID().substring(0, 8);
|
||||
this.reload();
|
||||
},
|
||||
copyRow() {
|
||||
this.$emit('copyRow', this.assertions, this.node);
|
||||
},
|
||||
suggestJsonOpen() {
|
||||
if (!this.request.debugRequestResult) {
|
||||
this.$message(this.$t('api_test.request.assertions.debug_first'));
|
||||
|
@ -9,7 +9,8 @@
|
||||
<div style="margin-right: 20px; float: right">
|
||||
<i class="icon el-icon-arrow-right" :class="{'is-active': extract.active}" @click="active(extract)" style="margin-left: 20px"/>
|
||||
<el-switch v-model="extract.enable" style="margin-left: 10px"/>
|
||||
<el-button size="mini" icon="el-icon-delete" circle @click="remove" 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>
|
||||
<!-- 请求参数-->
|
||||
<el-collapse-transition>
|
||||
@ -87,6 +88,9 @@
|
||||
remove() {
|
||||
this.$emit('remove', this.extract, this.node);
|
||||
},
|
||||
copyRow() {
|
||||
this.$emit('copyRow', this.extract, this.node);
|
||||
},
|
||||
reload() {
|
||||
this.loading = true
|
||||
this.$nextTick(() => {
|
||||
|
@ -9,7 +9,8 @@
|
||||
<div style="margin-right: 20px; float: right">
|
||||
<i class="icon el-icon-arrow-right" :class="{'is-active': active}" @click="changeActive"/>
|
||||
<el-switch v-model="jsr223ProcessorData.enable" style="margin-left: 10px"/>
|
||||
<el-button size="mini" icon="el-icon-delete" circle @click="remove" 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-row>
|
||||
@ -147,6 +148,9 @@
|
||||
remove() {
|
||||
this.$emit('remove', this.jsr223ProcessorData);
|
||||
},
|
||||
copyRow() {
|
||||
this.$emit('copyRow', this.jsr223ProcessorData);
|
||||
},
|
||||
reload() {
|
||||
this.isCodeEditAlive = false;
|
||||
this.$nextTick(() => (this.isCodeEditAlive = true));
|
||||
|
@ -65,15 +65,15 @@
|
||||
</div>
|
||||
<div v-for="row in request.hashTree" :key="row.id" v-loading="isReloadData" style="margin-left: 20px;width: 100%">
|
||||
<!-- 前置脚本 -->
|
||||
<ms-jsr233-processor v-if="row.label ==='JSR223 PreProcessor'" @remove="remove" :is-read-only="false" :title="$t('api_test.definition.request.pre_script')" style-type="color: #B8741A;background-color: #F9F1EA"
|
||||
<ms-jsr233-processor v-if="row.label ==='JSR223 PreProcessor'" @copyRow="copyRow" @remove="remove" :is-read-only="false" :title="$t('api_test.definition.request.pre_script')" style-type="color: #B8741A;background-color: #F9F1EA"
|
||||
:jsr223-processor="row"/>
|
||||
<!--后置脚本-->
|
||||
<ms-jsr233-processor v-if="row.label ==='JSR223 PostProcessor'" @remove="remove" :is-read-only="false" :title="$t('api_test.definition.request.post_script')" style-type="color: #783887;background-color: #F2ECF3"
|
||||
<ms-jsr233-processor v-if="row.label ==='JSR223 PostProcessor'" @copyRow="copyRow" @remove="remove" :is-read-only="false" :title="$t('api_test.definition.request.post_script')" style-type="color: #783887;background-color: #F2ECF3"
|
||||
:jsr223-processor="row"/>
|
||||
<!--断言规则-->
|
||||
<ms-api-assertions v-if="row.type==='Assertions'" @remove="remove" :is-read-only="isReadOnly" :assertions="row"/>
|
||||
<ms-api-assertions v-if="row.type==='Assertions'" @copyRow="copyRow" @remove="remove" :is-read-only="isReadOnly" :assertions="row"/>
|
||||
<!--提取规则-->
|
||||
<ms-api-extract :is-read-only="isReadOnly" @remove="remove" v-if="row.type==='Extract'" :extract="row"/>
|
||||
<ms-api-extract :is-read-only="isReadOnly" @copyRow="copyRow" @remove="remove" v-if="row.type==='Extract'" :extract="row"/>
|
||||
|
||||
</div>
|
||||
</el-col>
|
||||
@ -107,6 +107,7 @@
|
||||
import {parseEnvironment} from "../../../model/EnvironmentModel";
|
||||
import ApiEnvironmentConfig from "../../environment/ApiEnvironmentConfig";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
import {getUUID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "MsDatabaseConfig",
|
||||
@ -165,6 +166,13 @@
|
||||
this.request.hashTree.splice(index, 1);
|
||||
this.reload();
|
||||
},
|
||||
copyRow(row) {
|
||||
let obj = {};
|
||||
Object.assign(obj, row);
|
||||
obj.id = getUUID();
|
||||
this.request.hashTree.push(obj);
|
||||
this.reload();
|
||||
},
|
||||
reload() {
|
||||
this.isReloadData = true
|
||||
this.$nextTick(() => {
|
||||
|
@ -44,15 +44,15 @@
|
||||
|
||||
<div v-for="row in request.hashTree" :key="row.id" v-loading="isReloadData" style="margin-left: 20px;width: 100%">
|
||||
<!-- 前置脚本 -->
|
||||
<ms-jsr233-processor v-if="row.label ==='JSR223 PreProcessor'" @remove="remove" :is-read-only="false" :title="$t('api_test.definition.request.pre_script')" style-type="color: #B8741A;background-color: #F9F1EA"
|
||||
<ms-jsr233-processor v-if="row.label ==='JSR223 PreProcessor'" @copyRow="copyRow" @remove="remove" :is-read-only="false" :title="$t('api_test.definition.request.pre_script')" style-type="color: #B8741A;background-color: #F9F1EA"
|
||||
:jsr223-processor="row"/>
|
||||
<!--后置脚本-->
|
||||
<ms-jsr233-processor v-if="row.label ==='JSR223 PostProcessor'" @remove="remove" :is-read-only="false" :title="$t('api_test.definition.request.post_script')" style-type="color: #783887;background-color: #F2ECF3"
|
||||
<ms-jsr233-processor v-if="row.label ==='JSR223 PostProcessor'" @copyRow="copyRow" @remove="remove" :is-read-only="false" :title="$t('api_test.definition.request.post_script')" style-type="color: #783887;background-color: #F2ECF3"
|
||||
:jsr223-processor="row"/>
|
||||
<!--断言规则-->
|
||||
<ms-api-assertions v-if="row.type==='Assertions'" @remove="remove" :is-read-only="isReadOnly" :assertions="row"/>
|
||||
<ms-api-assertions v-if="row.type==='Assertions'" @copyRow="copyRow" @remove="remove" :is-read-only="isReadOnly" :assertions="row"/>
|
||||
<!--提取规则-->
|
||||
<ms-api-extract :is-read-only="isReadOnly" @remove="remove" v-if="row.type==='Extract'" :extract="row"/>
|
||||
<ms-api-extract :is-read-only="isReadOnly" @copyRow="copyRow" @remove="remove" v-if="row.type==='Extract'" :extract="row"/>
|
||||
|
||||
</div>
|
||||
</el-col>
|
||||
@ -81,11 +81,11 @@
|
||||
import MsApiScenarioVariables from "../../ApiScenarioVariables";
|
||||
import {createComponent} from "../../jmeter/components";
|
||||
import {Assertions, Extract, DubboRequest} from "../../../model/ApiTestModel";
|
||||
import {parseEnvironment} from "../../../model/EnvironmentModel";
|
||||
import MsDubboInterface from "../../request/dubbo/Interface";
|
||||
import MsDubboRegistryCenter from "../../request/dubbo/RegistryCenter";
|
||||
import MsDubboConfigCenter from "../../request/dubbo/ConfigCenter";
|
||||
import MsDubboConsumerService from "../../request/dubbo/ConsumerAndService";
|
||||
import {getUUID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "MsDatabaseConfig",
|
||||
@ -140,6 +140,13 @@
|
||||
this.request.hashTree.splice(index, 1);
|
||||
this.reload();
|
||||
},
|
||||
copyRow(row) {
|
||||
let obj = {};
|
||||
Object.assign(obj, row);
|
||||
obj.id = getUUID();
|
||||
this.request.hashTree.push(obj);
|
||||
this.reload();
|
||||
},
|
||||
reload() {
|
||||
this.isReloadData = true
|
||||
this.$nextTick(() => {
|
||||
|
@ -30,7 +30,7 @@
|
||||
</el-tab-pane>
|
||||
|
||||
<!--REST 参数-->
|
||||
<el-tab-pane :label="$t('api_test.definition.request.rest_param')" name="rest" >
|
||||
<el-tab-pane :label="$t('api_test.definition.request.rest_param')" name="rest">
|
||||
<el-tooltip class="item-tabs" effect="dark" :content="$t('api_test.definition.request.rest_info')" placement="top-start" slot="label">
|
||||
<span>
|
||||
{{$t('api_test.definition.request.rest_param')}}
|
||||
@ -61,15 +61,15 @@
|
||||
|
||||
<div v-for="row in request.hashTree" :key="row.id" v-loading="isReloadData">
|
||||
<!-- 前置脚本 -->
|
||||
<ms-jsr233-processor v-if="row.label ==='JSR223 PreProcessor'" @remove="remove" :is-read-only="false" :title="$t('api_test.definition.request.pre_script')" style-type="color: #B8741A;background-color: #F9F1EA"
|
||||
<ms-jsr233-processor v-if="row.label ==='JSR223 PreProcessor'" @copyRow="copyRow" @remove="remove" :is-read-only="false" :title="$t('api_test.definition.request.pre_script')" style-type="color: #B8741A;background-color: #F9F1EA"
|
||||
:jsr223-processor="row"/>
|
||||
<!--后置脚本-->
|
||||
<ms-jsr233-processor v-if="row.label ==='JSR223 PostProcessor'" @remove="remove" :is-read-only="false" :title="$t('api_test.definition.request.post_script')" style-type="color: #783887;background-color: #F2ECF3"
|
||||
<ms-jsr233-processor v-if="row.label ==='JSR223 PostProcessor'" @copyRow="copyRow" @remove="remove" :is-read-only="false" :title="$t('api_test.definition.request.post_script')" style-type="color: #783887;background-color: #F2ECF3"
|
||||
:jsr223-processor="row"/>
|
||||
<!--断言规则-->
|
||||
<ms-api-assertions v-if="row.type==='Assertions'" @remove="remove" :is-read-only="isReadOnly" :assertions="row"/>
|
||||
<ms-api-assertions v-if="row.type==='Assertions'" @copyRow="copyRow" @remove="remove" :is-read-only="isReadOnly" :assertions="row"/>
|
||||
<!--提取规则-->
|
||||
<ms-api-extract :is-read-only="isReadOnly" @remove="remove" v-if="row.type==='Extract'" :extract="row"/>
|
||||
<ms-api-extract :is-read-only="isReadOnly" @copyRow="copyRow" @remove="remove" v-if="row.type==='Extract'" :extract="row"/>
|
||||
|
||||
</div>
|
||||
</el-col>
|
||||
@ -99,6 +99,7 @@
|
||||
import MsApiAssertions from "../../assertion/ApiAssertions";
|
||||
import MsApiExtract from "../../extract/ApiExtract";
|
||||
import {Assertions, Body, Extract} from "../../../model/ApiTestModel";
|
||||
import {getUUID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "MsApiHttpRequestForm",
|
||||
@ -180,6 +181,13 @@
|
||||
this.request.hashTree.splice(index, 1);
|
||||
this.reload();
|
||||
},
|
||||
copyRow(row) {
|
||||
let obj = {};
|
||||
Object.assign(obj, row);
|
||||
row.id = getUUID();
|
||||
this.request.hashTree.push(obj);
|
||||
this.reload();
|
||||
},
|
||||
reload() {
|
||||
this.isReloadData = true
|
||||
this.$nextTick(() => {
|
||||
|
@ -92,15 +92,15 @@
|
||||
</div>
|
||||
<div v-for="row in request.hashTree" :key="row.id" v-loading="isReloadData" style="margin-left: 20px;width: 100%">
|
||||
<!-- 前置脚本 -->
|
||||
<ms-jsr233-processor v-if="row.label ==='JSR223 PreProcessor'" @remove="remove" :is-read-only="false" :title="$t('api_test.definition.request.pre_script')" style-type="color: #B8741A;background-color: #F9F1EA"
|
||||
<ms-jsr233-processor v-if="row.label ==='JSR223 PreProcessor'" @copyRow="copyRow" @remove="remove" :is-read-only="false" :title="$t('api_test.definition.request.pre_script')" style-type="color: #B8741A;background-color: #F9F1EA"
|
||||
:jsr223-processor="row"/>
|
||||
<!--后置脚本-->
|
||||
<ms-jsr233-processor v-if="row.label ==='JSR223 PostProcessor'" @remove="remove" :is-read-only="false" :title="$t('api_test.definition.request.post_script')" style-type="color: #783887;background-color: #F2ECF3"
|
||||
<ms-jsr233-processor v-if="row.label ==='JSR223 PostProcessor'" @copyRow="copyRow" @remove="remove" :is-read-only="false" :title="$t('api_test.definition.request.post_script')" style-type="color: #783887;background-color: #F2ECF3"
|
||||
:jsr223-processor="row"/>
|
||||
<!--断言规则-->
|
||||
<ms-api-assertions v-if="row.type==='Assertions'" @remove="remove" :is-read-only="isReadOnly" :assertions="row"/>
|
||||
<ms-api-assertions v-if="row.type==='Assertions'" @copyRow="copyRow" @remove="remove" :is-read-only="isReadOnly" :assertions="row"/>
|
||||
<!--提取规则-->
|
||||
<ms-api-extract :is-read-only="isReadOnly" @remove="remove" v-if="row.type==='Extract'" :extract="row"/>
|
||||
<ms-api-extract :is-read-only="isReadOnly" @copyRow="copyRow" @remove="remove" v-if="row.type==='Extract'" :extract="row"/>
|
||||
|
||||
</div>
|
||||
</el-col>
|
||||
@ -132,7 +132,7 @@
|
||||
import ApiEnvironmentConfig from "../../environment/ApiEnvironmentConfig";
|
||||
import {API_STATUS} from "../../../model/JsonData";
|
||||
import TCPSampler from "../../jmeter/components/sampler/tcp-sampler";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
import {getCurrentProjectID, getUUID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "MsDatabaseConfig",
|
||||
@ -194,6 +194,13 @@
|
||||
this.request.hashTree.splice(index, 1);
|
||||
this.reload();
|
||||
},
|
||||
copyRow(row) {
|
||||
let obj = {};
|
||||
Object.assign(obj, row);
|
||||
obj.id = getUUID();
|
||||
this.request.hashTree.push(obj);
|
||||
this.reload();
|
||||
},
|
||||
reload() {
|
||||
this.isReloadData = true
|
||||
this.$nextTick(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user