feat接口定义_请求体为form-data_的json参数的可以增加参数的优化

This commit is contained in:
wxg0103 2021-09-28 10:26:45 +08:00 committed by fit2-zhao
parent a1abd2fd76
commit 0a47d283a2
1 changed files with 213 additions and 212 deletions

View File

@ -100,18 +100,18 @@
</template>
<script>
import {KeyValue, Scenario} from "../model/ApiTestModel";
import {JMETER_FUNC, MOCKJS_FUNC} from "@/common/js/constants";
import MsApiVariableAdvance from "./ApiVariableAdvance";
import MsApiVariableJson from "./ApiVariableJson";
import MsApiBodyFileUpload from "./body/ApiBodyFileUpload";
import {REQUIRED} from "../model/JsonData";
import Vue from 'vue';
import ApiVariableSetting from "@/business/components/api/definition/components/ApiVariableSetting";
import {KeyValue, Scenario} from "../model/ApiTestModel";
import {JMETER_FUNC, MOCKJS_FUNC} from "@/common/js/constants";
import MsApiVariableAdvance from "./ApiVariableAdvance";
import MsApiVariableJson from "./ApiVariableJson";
import MsApiBodyFileUpload from "./body/ApiBodyFileUpload";
import {REQUIRED} from "../model/JsonData";
import Vue from 'vue';
import ApiVariableSetting from "@/business/components/api/definition/components/ApiVariableSetting";
export default {
export default {
name: "MsApiVariable",
components: {ApiVariableSetting, MsApiBodyFileUpload, MsApiVariableAdvance , MsApiVariableJson},
components: {ApiVariableSetting, MsApiBodyFileUpload, MsApiVariableAdvance, MsApiVariableJson},
props: {
keyPlaceholder: String,
valuePlaceholder: String,
@ -147,10 +147,10 @@
}
},
watch: {
isSelectAll: function(to, from) {
if(from == false && to == true) {
isSelectAll: function (to, from) {
if (from == false && to == true) {
this.selectAll();
} else if(from == true && to == false) {
} else if (from == true && to == false) {
this.invertSelect();
}
},
@ -240,10 +240,10 @@
return (((1 + Math.random()) * 0x100000) | 0).toString(16).substring(1);
},
advanced(item) {
if (item.type === 'json'){
if (item.type === 'json') {
this.$refs.variableJson.open(item);
this.currentItem = item;
}else {
} else {
this.$refs.variableAdvance.open();
this.currentItem = item;
}
@ -252,7 +252,7 @@
typeChange(item) {
if (item.type === 'file') {
item.contentType = 'application/octet-stream';
} else if (item.type === 'text'){
} else if (item.type === 'text') {
item.contentType = 'text/plain';
} else {
item.contentType = 'application/json'
@ -278,8 +278,9 @@
openApiVariableSetting(item) {
this.$refs.apiVariableSetting.open(item);
},
callback(item){
this.currentItem.value=item;
callback(item) {
this.currentItem.value = item;
this.currentItem = null;
}
},
created() {
@ -293,54 +294,54 @@
}));
}
}
}
}
</script>
<style scoped>
.kv-description {
.kv-description {
font-size: 13px;
}
}
.kv-row {
.kv-row {
margin-top: 10px;
}
}
.kv-delete {
.kv-delete {
width: 60px;
}
}
.kv-select {
.kv-select {
width: 50%;
}
}
.el-autocomplete {
.el-autocomplete {
width: 100%;
}
}
.kv-checkbox {
.kv-checkbox {
width: 20px;
margin-right: 10px;
}
}
.advanced-item-value >>> .el-dialog__body {
.advanced-item-value >>> .el-dialog__body {
padding: 15px 25px;
}
}
.el-row {
.el-row {
margin-bottom: 5px;
}
}
.kv-type {
.kv-type {
width: 70px;
}
}
.pointer {
.pointer {
cursor: pointer;
color: #1E90FF;
}
}
.kv-setting {
.kv-setting {
width: 40px;
padding: 0px !important;
}
}
</style>