From d223d69743babcecf5cf23cf342c49e5ddedb04d Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Mon, 3 Apr 2023 18:07:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E7=BC=96=E8=BE=91=E6=97=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=A1=A8=E6=A0=BC=E4=B8=8D?= =?UTF-8?q?=E5=9B=9E=E6=98=BE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1025081 --user=宋天阳 [接口测试]接口自动化-编辑场景-请求体中添加本地文件后不回显文件名,保存重新查看正常 https://www.tapd.cn/55049933/s/1358826 --- .../definition/components/ApiVariable.vue | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/api-test/frontend/src/business/definition/components/ApiVariable.vue b/api-test/frontend/src/business/definition/components/ApiVariable.vue index 906d599a00..d031ce9bd1 100644 --- a/api-test/frontend/src/business/definition/components/ApiVariable.vue +++ b/api-test/frontend/src/business/definition/components/ApiVariable.vue @@ -525,6 +525,7 @@ export default { this.storageKey = 'API_RESPONSE_PARAMS_SHOW_FIELD'; } if (this.parameters.length === 0 || this.parameters[this.parameters.length - 1].name) { + //如果参数最后没有空白行,需要加入一个空白行 this.parameters.push( new KeyValue({ contentType: 'text/plain', @@ -543,6 +544,24 @@ export default { value: null, }) ); + } else { + //检查最后一个空白行是否缺少参数,缺少参数会影响数据反显.(多存在于旧数据) + if (!this.parameters[this.parameters.length - 1].max) { + this.$set(this.parameters[this.parameters.length - 1], 'max', 0); + } + if (!this.parameters[this.parameters.length - 1].min) { + this.$set(this.parameters[this.parameters.length - 1], 'min', 0); + } + if (!this.parameters[this.parameters.length - 1].value) { + this.$set(this.parameters[this.parameters.length - 1], 'value', null); + } + if (!this.parameters[this.parameters.length - 1].uuid) { + this.$set(this.parameters[this.parameters.length - 1], 'uuid', this.uuid()); + } + if (!this.parameters[this.parameters.length - 1].description) { + this.$set(this.parameters[this.parameters.length - 1], 'description', null); + } + this.$set(this.parameters[this.parameters.length - 1], 'files', null); } let savedApiParamsShowFields = getShowFields(this.storageKey); if (savedApiParamsShowFields) {