style(接口测试): 统一部分间距样式

This commit is contained in:
fit2-zhao 2022-03-16 13:17:58 +08:00 committed by CountryBuilder
parent 513c1897de
commit f40a839621
15 changed files with 50 additions and 69 deletions

View File

@ -64,6 +64,6 @@
<style scoped> <style scoped>
.assertion-btn { .assertion-btn {
text-align: center; text-align: center;
width: 60px; width: 40px;
} }
</style> </style>

View File

@ -116,6 +116,5 @@
.assertion-btn { .assertion-btn {
text-align: center; text-align: center;
width: 60px; width: 60px;
margin-right: 14px;
} }
</style> </style>

View File

@ -105,6 +105,6 @@ export default {
.assertion-btn { .assertion-btn {
text-align: center; text-align: center;
width: 60px; width: 50px;
} }
</style> </style>

View File

@ -66,7 +66,6 @@
.assertion-btn { .assertion-btn {
text-align: center; text-align: center;
width: 60px; width: 40px;
margin-left: 15px;
} }
</style> </style>

View File

@ -58,7 +58,16 @@
</div> </div>
<div class="assertion-item-editing response-time" v-if="isDocument"> <div class="assertion-item-editing response-time" v-if="isDocument">
<div> <div>
{{ assertions.document.type }}-{{ $t("api_test.definition.request.document_structure") }} <el-row :gutter="10" type="flex" justify="space-between" align="middle">
<el-col>
{{ assertions.document.type }}-{{ $t("api_test.definition.request.document_structure") }}
</el-col>
<el-col class="assertion-remove-btn">
<el-tooltip effect="dark" :content="$t('commons.remove')" placement="top-start">
<el-button icon="el-icon-delete" type="danger" size="mini" circle @click="remove()"/>
</el-tooltip>
</el-col>
</el-row>
</div> </div>
<ms-document-body :document="assertions.document" :apiId="apiId" :isReadOnly="isReadOnly" @remove="remove"/> <ms-document-body :document="assertions.document" :apiId="apiId" :isReadOnly="isReadOnly" @remove="remove"/>
</div> </div>
@ -157,5 +166,8 @@ export default {
margin-top: 10px; margin-top: 10px;
} }
.assertion-remove-btn {
text-align: center;
width: 40px;
}
</style> </style>

View File

@ -11,9 +11,6 @@
<el-checkbox v-model="checked" @change="checkedAPI">{{ $t('commons.follow_api') }}</el-checkbox> <el-checkbox v-model="checked" @change="checkedAPI">{{ $t('commons.follow_api') }}</el-checkbox>
</span> </span>
</el-col> </el-col>
<el-col class="assertion-btn">
<el-button :disabled="isReadOnly" type="danger" size="mini" icon="el-icon-delete" circle @click="removeDoc" style="float: right"/>
</el-col>
</el-row> </el-row>
</div> </div>
<el-table <el-table
@ -25,7 +22,7 @@
row-key="id" row-key="id"
border border
default-expand-all default-expand-all
:height="400" :height="300"
v-loading="loading"> v-loading="loading">
<el-table-column prop="name" :label="$t('api_test.definition.request.esb_table.name')" width="230"> <el-table-column prop="name" :label="$t('api_test.definition.request.esb_table.name')" width="230">

View File

@ -386,7 +386,7 @@ export default {
} }
.request-tabs { .request-tabs {
margin: 20px; margin: 10px;
min-height: 200px; min-height: 200px;
} }

View File

@ -324,7 +324,7 @@ export default {
} }
.request-tabs { .request-tabs {
margin: 20px; margin: 10px;
min-height: 200px; min-height: 200px;
} }

View File

@ -490,7 +490,7 @@ export default {
} }
.request-tabs { .request-tabs {
margin: 20px; margin: 10px;
min-height: 200px; min-height: 200px;
} }

View File

@ -354,7 +354,7 @@
} }
.request-tabs { .request-tabs {
margin: 20px; margin: 10px;
min-height: 200px; min-height: 200px;
} }

View File

@ -49,43 +49,36 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('api_test.definition.request.pre_script')" name="script" v-if="showPreScript">
<jsr233-processor-content
:jsr223-processor="request.tcpPreProcessor"
:is-pre-processor="true"
:is-read-only="isReadOnly"/>
</el-tab-pane>
<!-- 脚本步骤/断言步骤 --> <!-- 脚本步骤/断言步骤 -->
<el-tab-pane :label="$t('api_test.definition.request.pre_operation')" name="preOperate" v-if="showScript"> <el-tab-pane :label="$t('api_test.definition.request.pre_operation')" name="preOperate" v-if="showScript">
<span class="item-tabs" effect="dark" placement="top-start" slot="label"> <span class="item-tabs" effect="dark" placement="top-start" slot="label">
{{ $t('api_test.definition.request.pre_operation') }} {{ $t('api_test.definition.request.pre_operation') }}
<div class="el-step__icon is-text ms-api-col ms-header" v-if="request.preSize > 0"> <div class="el-step__icon is-text ms-api-col ms-header" v-if="request.preSize > 0">
<div class="el-step__icon-inner">{{ request.preSize }}</div> <div class="el-step__icon-inner">{{ request.preSize }}</div>
</div> </div>
</span> </span>
<ms-jmx-step :request="request" :apiId="request.id" :response="response" :tab-type="'pre'" <ms-jmx-step :request="request" :apiId="request.id" :response="response" :tab-type="'pre'"
ref="preStep"/> ref="preStep"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('api_test.definition.request.post_operation')" name="postOperate" <el-tab-pane :label="$t('api_test.definition.request.post_operation')" name="postOperate"
v-if="showScript"> v-if="showScript">
<span class="item-tabs" effect="dark" placement="top-start" slot="label"> <span class="item-tabs" effect="dark" placement="top-start" slot="label">
{{ $t('api_test.definition.request.post_operation') }} {{ $t('api_test.definition.request.post_operation') }}
<div class="el-step__icon is-text ms-api-col ms-header" v-if="request.postSize > 0"> <div class="el-step__icon is-text ms-api-col ms-header" v-if="request.postSize > 0">
<div class="el-step__icon-inner">{{ request.postSize }}</div> <div class="el-step__icon-inner">{{ request.postSize }}</div>
</div> </div>
</span> </span>
<ms-jmx-step :request="request" :apiId="request.id" :response="response" :tab-type="'post'" <ms-jmx-step :request="request" :apiId="request.id" :response="response" :tab-type="'post'"
ref="postStep"/> ref="postStep"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('api_test.definition.request.assertions_rule')" name="assertionsRule" <el-tab-pane :label="$t('api_test.definition.request.assertions_rule')" name="assertionsRule"
v-if="showScript"> v-if="showScript">
<span class="item-tabs" effect="dark" placement="top-start" slot="label"> <span class="item-tabs" effect="dark" placement="top-start" slot="label">
{{ $t('api_test.definition.request.assertions_rule') }} {{ $t('api_test.definition.request.assertions_rule') }}
<div class="el-step__icon is-text ms-api-col ms-header" v-if="request.ruleSize > 0"> <div class="el-step__icon is-text ms-api-col ms-header" v-if="request.ruleSize > 0">
<div class="el-step__icon-inner">{{ request.ruleSize }}</div> <div class="el-step__icon-inner">{{ request.ruleSize }}</div>
</div> </div>
</span> </span>
<ms-jmx-step :request="request" :apiId="request.id" :response="response" @reload="reloadBody" <ms-jmx-step :request="request" :apiId="request.id" :response="response" @reload="reloadBody"
:tab-type="'assertionsRule'" ref="assertionsRule"/> :tab-type="'assertionsRule'" ref="assertionsRule"/>
</el-tab-pane> </el-tab-pane>
@ -164,9 +157,7 @@
</el-tabs> </el-tabs>
</el-form> </el-form>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</template> </template>
@ -178,8 +169,6 @@ import MsApiExtract from "../../extract/ApiExtract";
import ApiRequestMethodSelect from "../../collapse/ApiRequestMethodSelect"; import ApiRequestMethodSelect from "../../collapse/ApiRequestMethodSelect";
import MsCodeEdit from "../../../../../common/components/MsCodeEdit"; import MsCodeEdit from "../../../../../common/components/MsCodeEdit";
import MsApiScenarioVariables from "../../ApiScenarioVariables"; import MsApiScenarioVariables from "../../ApiScenarioVariables";
import {createComponent} from "../../jmeter/components";
import {Assertions, Extract} from "../../../model/ApiTestModel";
import {parseEnvironment} from "../../../model/EnvironmentModel"; import {parseEnvironment} from "../../../model/EnvironmentModel";
import ApiEnvironmentConfig from "../../environment/ApiEnvironmentConfig"; import ApiEnvironmentConfig from "../../environment/ApiEnvironmentConfig";
import {API_STATUS} from "../../../model/JsonData"; import {API_STATUS} from "../../../model/JsonData";
@ -188,7 +177,6 @@ import {getCurrentProjectID, getUUID} from "@/common/js/utils";
import MsApiVariable from "../../ApiVariable"; import MsApiVariable from "../../ApiVariable";
import MsInstructionsIcon from "../../../../../common/components/MsInstructionsIcon"; import MsInstructionsIcon from "../../../../../common/components/MsInstructionsIcon";
import Jsr233ProcessorContent from "../../../../automation/scenario/common/Jsr233ProcessorContent"; import Jsr233ProcessorContent from "../../../../automation/scenario/common/Jsr233ProcessorContent";
import JSR223PreProcessor from "../../jmeter/components/pre-processors/jsr223-pre-processor";
import ApiDefinitionStepButton from "../components/ApiDefinitionStepButton"; import ApiDefinitionStepButton from "../components/ApiDefinitionStepButton";
import TcpXmlTable from "@/business/components/api/definition/components/complete/table/TcpXmlTable"; import TcpXmlTable from "@/business/components/api/definition/components/complete/table/TcpXmlTable";
import {TYPE_TO_C} from "@/business/components/api/automation/scenario/Setting"; import {TYPE_TO_C} from "@/business/components/api/automation/scenario/Setting";
@ -276,8 +264,9 @@ export default {
this.$set(this.request, 'parameters', []); this.$set(this.request, 'parameters', []);
this.request.parameters = []; this.request.parameters = [];
} }
if (!this.request.tcpPreProcessor) { if (this.request.tcpPreProcessor && this.request.tcpPreProcessor.script) {
this.$set(this.request, 'tcpPreProcessor', new JSR223PreProcessor()) this.request.hashTree.push(this.request.tcpPreProcessor);
this.request.tcpPreProcessor = undefined;
} }
if (this.request.tcpPreProcessor) { if (this.request.tcpPreProcessor) {
this.request.tcpPreProcessor.clazzName = TYPE_TO_C.get(this.request.tcpPreProcessor.type); this.request.tcpPreProcessor.clazzName = TYPE_TO_C.get(this.request.tcpPreProcessor.type);
@ -584,7 +573,7 @@ export default {
} }
.request-tabs { .request-tabs {
margin: 20px; margin: 10px;
min-height: 200px; min-height: 200px;
} }

View File

@ -292,7 +292,7 @@ export default {
} }
.request-tabs { .request-tabs {
margin: 20px; margin: 10px;
min-height: 200px; min-height: 200px;
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<div v-if="loaded"> <div>
<p> <p>
<el-select v-model="preOperate" size="mini" class="ms-select-step" v-if="tabType === 'pre'"> <el-select v-model="preOperate" size="mini" class="ms-select-step" v-if="tabType === 'pre'">
<el-option <el-option
@ -155,11 +155,6 @@ export default {
default: false default: false
} }
}, },
watch: {
'request.body.typeChange'() {
this.showHide();
}
},
data() { data() {
let validateURL = (rule, value, callback) => { let validateURL = (rule, value, callback) => {
try { try {
@ -346,7 +341,7 @@ export default {
let obj = JSON.parse(JSON.stringify(row)); let obj = JSON.parse(JSON.stringify(row));
obj.id = getUUID(); obj.id = getUUID();
const index = this.request.hashTree.findIndex(d => d.id === row.id); const index = this.request.hashTree.findIndex(d => d.id === row.id);
if (index !==-1) { if (index !== -1) {
this.request.hashTree.splice(index, 0, obj); this.request.hashTree.splice(index, 0, obj);
} else { } else {
this.request.hashTree.push(obj); this.request.hashTree.push(obj);
@ -380,12 +375,6 @@ export default {
this.isReloadData = false this.isReloadData = false
}) })
}, },
showHide() {
this.loaded = false
this.$nextTick(() => {
this.loaded = true
})
},
init() { init() {
if (!this.request.body) { if (!this.request.body) {
this.request.body = new Body(); this.request.body = new Body();
@ -566,12 +555,8 @@ export default {
} }
.ms-select-step { .ms-select-step {
margin-left: 15px; margin-left: 10px;
margin-right: 10px; margin-right: 10px;
width: 200px; width: 200px;
} }
.ms-assertions-button {
margin-left: 18px;
}
</style> </style>

View File

@ -175,7 +175,7 @@ export default {
} }
.request-tabs { .request-tabs {
margin: 20px; margin: 10px;
min-height: 200px; min-height: 200px;
} }

View File

@ -173,7 +173,7 @@ export default {
} }
.request-tabs { .request-tabs {
margin: 20px; margin: 10px;
min-height: 200px; min-height: 200px;
} }