fix(接口测试): 请求体取消自动格式化

This commit is contained in:
chenjianxing 2020-11-24 14:36:15 +08:00
parent 8e4ada8e18
commit d02f530538
4 changed files with 27 additions and 17 deletions

@ -1 +1 @@
Subproject commit 419c75bca64b7c5bfbd1194d7f0fd9919f0caa04 Subproject commit 57d6f78efa4b0300be188e8b024511ceef0873ed

View File

@ -20,7 +20,7 @@
:description="$t('api_test.request.parameters_desc')" :description="$t('api_test.request.parameters_desc')"
v-if="body.isKV()"/> v-if="body.isKV()"/>
<div class="body-raw" v-if="body.type == 'Raw'"> <div class="body-raw" v-if="body.type == 'Raw'">
<ms-code-edit :mode="body.format" :read-only="isReadOnly" :data.sync="body.raw" :modes="modes" ref="codeEdit"/> <ms-code-edit :mode="body.format" :enable-format="false" :read-only="isReadOnly" :data.sync="body.raw" :modes="modes" ref="codeEdit"/>
</div> </div>
</div> </div>

View File

@ -28,6 +28,12 @@
init: { init: {
type: Function type: Function
}, },
enableFormat: {
type: Boolean,
default() {
return true;
}
},
readOnly: { readOnly: {
type: Boolean, type: Boolean,
default() { default() {
@ -74,20 +80,24 @@
} }
}, },
format() { format() {
switch (this.mode) { if (this.enableFormat) {
case 'json': switch (this.mode) {
this.formatData = formatJson(this.data); case 'json':
break; this.formatData = formatJson(this.data);
case 'html': break;
this.formatData = toDiffableHtml(this.data); case 'html':
break; this.formatData = toDiffableHtml(this.data);
case 'xml': break;
this.formatData = formatXml(this.data); case 'xml':
break; this.formatData = formatXml(this.data);
default: break;
if (this.data) { default:
this.formatData = this.data; if (this.data) {
} this.formatData = this.data;
}
}
} else {
this.formatData = this.data;
} }
} }
} }

@ -1 +1 @@
Subproject commit 33bbdb3f528c914bf333b2c1839dd6d3bbd9b569 Subproject commit 71d57ae5d7f8bb5c93a29504ac6f2300dc189ce9