fix(接口测试): 修复接口文档响应体部分字段没有格式化解析的问题

--bug=1020653 --user=宋天阳 【接口测试】接口高级设置问题汇总 {#_orginal_url#}
This commit is contained in:
song-tianyang 2022-12-07 11:21:59 +08:00 committed by 建国
parent 1ce58d3bee
commit a826da059a
2 changed files with 20 additions and 23 deletions

View File

@ -7,6 +7,7 @@
<api-params-config
v-if="apiParamsConfigFields"
@refresh="refreshApiParamsField"
:storage-key="apiParamStorageKey"
:api-params-config-fields="apiParamsConfigFields" />
</div>
</el-row>
@ -69,40 +70,17 @@ export default {
apiInfo: Object,
},
activated() {
this.formatTableData();
this.initTableColumn();
},
created: function () {
this.formatTableData();
this.initTableColumn();
},
mounted() {
this.formatTableData();
this.initTableColumn();
},
computed: {},
watch: {},
methods: {
formatTableData() {
if (this.tableData) {
this.tableData.forEach((item) => {
if (item.urlEncode !== null && item.urlEncode !== undefined) {
if (item.urlEncode === true) {
item.urlEncode = this.$t('commons.yes');
} else {
item.urlEncode = this.$t('commons.no');
}
}
if (item.enable !== null && item.enable !== undefined) {
if (item.enable === true) {
item.enable = this.$t('commons.yes');
} else {
item.enable = this.$t('commons.no');
}
}
});
}
},
refreshApiParamsField() {
this.initTableColumn();
this.reloadedApiVariable = false;
@ -176,6 +154,24 @@ export default {
returnJsonArr.push(item);
}
}
returnJsonArr.forEach((item) => {
if (item.urlEncode !== null && item.urlEncode !== undefined) {
if (item.urlEncode === true) {
item.urlEncode = this.$t('commons.yes');
} else {
item.urlEncode = this.$t('commons.no');
}
}
if (item.enable !== null && item.enable !== undefined) {
if (item.enable === true) {
item.enable = this.$t('commons.yes');
} else {
item.enable = this.$t('commons.no');
}
}
});
return returnJsonArr;
},
formatBoolean(row, column, cellValue) {

View File

@ -109,6 +109,7 @@ export default {
legend: {
orient: 'vertical',
icon: 'rect',
inactiveBorderWidth: 0.1,
selectedMode: dataIsNotEmpty,
itemGap: 16,
left: '50%',