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 <api-params-config
v-if="apiParamsConfigFields" v-if="apiParamsConfigFields"
@refresh="refreshApiParamsField" @refresh="refreshApiParamsField"
:storage-key="apiParamStorageKey"
:api-params-config-fields="apiParamsConfigFields" /> :api-params-config-fields="apiParamsConfigFields" />
</div> </div>
</el-row> </el-row>
@ -69,40 +70,17 @@ export default {
apiInfo: Object, apiInfo: Object,
}, },
activated() { activated() {
this.formatTableData();
this.initTableColumn(); this.initTableColumn();
}, },
created: function () { created: function () {
this.formatTableData();
this.initTableColumn(); this.initTableColumn();
}, },
mounted() { mounted() {
this.formatTableData();
this.initTableColumn(); this.initTableColumn();
}, },
computed: {}, computed: {},
watch: {}, watch: {},
methods: { 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() { refreshApiParamsField() {
this.initTableColumn(); this.initTableColumn();
this.reloadedApiVariable = false; this.reloadedApiVariable = false;
@ -176,6 +154,24 @@ export default {
returnJsonArr.push(item); 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; return returnJsonArr;
}, },
formatBoolean(row, column, cellValue) { formatBoolean(row, column, cellValue) {

View File

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