style(接口自动化): 接口步骤样式统一

This commit is contained in:
fit2-zhao 2021-01-20 15:11:41 +08:00
parent cdf1b73253
commit e2eed011f7
3 changed files with 18 additions and 9 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="request-form"> <div class="request-form">
<component :is="component" :scenario="scenario" :controller="scenario" :timer="scenario" :assertions="scenario" :extract="scenario" :jsr223-processor="scenario" :request="scenario" :currentScenario="currentScenario" :currentEnvironmentId="currentEnvironmentId" :node="node" <component :is="component" :scenario="scenario" :controller="scenario" :timer="scenario" :assertions="scenario" :extract="scenario" :jsr223-processor="scenario" :request="scenario" :currentScenario="currentScenario" :currentEnvironmentId="currentEnvironmentId" :node="node"
:draggable="true" :title="title" @suggestClick="suggestClick(node)" :response="response" :draggable="true" :title="title" :color="titleColor" :background-color="backgroundColor" @suggestClick="suggestClick(node)" :response="response"
@remove="remove" @copyRow="copyRow"/> @remove="remove" @copyRow="copyRow"/>
</div> </div>
</template> </template>
@ -32,6 +32,8 @@
data() { data() {
return { return {
title: this.$t('api_test.automation.customize_script'), title: this.$t('api_test.automation.customize_script'),
titleColor: "",
backgroundColor: "",
} }
}, },
computed: { computed: {
@ -79,25 +81,31 @@
getComponent(type) { getComponent(type) {
if (type === ELEMENT_TYPE.JSR223PreProcessor) { if (type === ELEMENT_TYPE.JSR223PreProcessor) {
this.title = this.$t('api_test.definition.request.pre_script'); this.title = this.$t('api_test.definition.request.pre_script');
this.titleColor = "#B8741A";
this.backgroundColor = "#F9F1EA";
return "MsJsr233Processor"; return "MsJsr233Processor";
} else if (type === ELEMENT_TYPE.JSR223PostProcessor) { } else if (type === ELEMENT_TYPE.JSR223PostProcessor) {
this.title = this.$t('api_test.definition.request.post_script'); this.title = this.$t('api_test.definition.request.post_script');
this.titleColor = "#783887";
this.backgroundColor = "#F2ECF3";
return "MsJsr233Processor"; return "MsJsr233Processor";
} else { } else {
this.title = this.$t('api_test.automation.customize_script'); this.title = this.$t('api_test.automation.customize_script');
this.titleColor = "#7B4D12";
this.backgroundColor = "#F1EEE9";
return "MsJsr233Processor"; return "MsJsr233Processor";
} }
}, },
remove(row, node) { remove(row, node) {
this.$emit('remove',row,node); this.$emit('remove', row, node);
}, },
copyRow(row, node) { copyRow(row, node) {
this.$emit('copyRow',row,node); this.$emit('copyRow', row, node);
}, },
suggestClick(node) { suggestClick(node) {
this.$emit('suggestClick',node); this.$emit('suggestClick', node);
}, },
} }
} }

View File

@ -4,8 +4,8 @@
@remove="remove" @remove="remove"
:data="jsr223ProcessorData" :data="jsr223ProcessorData"
:draggable="draggable" :draggable="draggable"
color="#B8741A" :color="color"
background-color="#F9F1EA" :background-color="backgroundColor"
:title="title"> :title="title">
<el-row style="margin:0px 10px 10px"> <el-row style="margin:0px 10px 10px">
<el-col> <el-col>
@ -111,7 +111,8 @@
false false
}, },
title: String, title: String,
styleType: String, color: String,
backgroundColor: String,
node: {}, node: {},
}, },
watch: { watch: {

View File

@ -9,10 +9,10 @@
<div v-for="row in request.hashTree" :key="row.id"> <div v-for="row in request.hashTree" :key="row.id">
<!--前置脚本--> <!--前置脚本-->
<ms-jsr233-processor v-if="row.type==='JSR223PreProcessor'" @remove="remove" @copyRow="copyRow" :title="$t('api_test.definition.request.pre_script')" <ms-jsr233-processor v-if="row.type==='JSR223PreProcessor'" @remove="remove" @copyRow="copyRow" :title="$t('api_test.definition.request.pre_script')"
:jsr223-processor="row"/> :jsr223-processor="row" color="#B8741A" background-color="#F9F1EA"/>
<!--后置脚本--> <!--后置脚本-->
<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')" <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')"
:jsr223-processor="row"/> :jsr223-processor="row" color="#783887" background-color="#F2ECF3"/>
<!--断言规则--> <!--断言规则-->
<div style="margin-top: 10px"> <div style="margin-top: 10px">
<ms-api-assertions :response="response" v-if="row.type==='Assertions'" @copyRow="copyRow" @remove="remove" :is-read-only="isReadOnly" :assertions="row"/> <ms-api-assertions :response="response" v-if="row.type==='Assertions'" @copyRow="copyRow" @remove="remove" :is-read-only="isReadOnly" :assertions="row"/>