From c19dee86515a72b8a0c785da3e72a6583ec4ac6b Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Mon, 27 Mar 2023 17:00:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA)?= =?UTF-8?q?=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E5=85=B3=E8=81=94devops=E5=90=8E=EF=BC=8C=E7=BA=A7=E8=81=94?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E4=BF=9D=E5=AD=98=E5=90=8E=E5=9B=9E=E6=98=BE?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1022341 --user=王旭 【测试跟踪】github#21508,功能用例关联的devops需求,保存后回显为空 https://www.tapd.cn/55049933/s/1355940 --- .../case/components/BaseEditItemComponent.vue | 44 ++++--------------- 1 file changed, 9 insertions(+), 35 deletions(-) diff --git a/test-track/frontend/src/business/case/components/BaseEditItemComponent.vue b/test-track/frontend/src/business/case/components/BaseEditItemComponent.vue index 72ac27c10c..5044783655 100644 --- a/test-track/frontend/src/business/case/components/BaseEditItemComponent.vue +++ b/test-track/frontend/src/business/case/components/BaseEditItemComponent.vue @@ -313,8 +313,10 @@ export default { return this.contentObject.content.defaultValue; } }, - getStoryPlatform() { - let demandOptions = this.contentObject.content.demandOptions || []; + getStoryPlatform(demandOptions) { + if (!demandOptions) { + demandOptions = this.contentObject.content.demandOptions || []; + } let optionPlatform = ""; if (demandOptions.length > 0) { for (let i = 0; i < demandOptions.length; i++) { @@ -323,7 +325,7 @@ export default { break; } if (demandOptions[i].children && demandOptions[i].children.length > 0) { - optionPlatform = this.findChilder( + optionPlatform = this.getStoryPlatform( demandOptions[i].children, this.contentObject.content.demandId, ); @@ -332,23 +334,10 @@ export default { } return optionPlatform; }, - findChilder(data, demandId) { - let optionPlatform = ""; - if (data.children && data.children.length > 0) { - this.findChilder( - data.children, - demandId - ); + getStoryLabel(demandOptions) { + if (!demandOptions) { + demandOptions = this.contentObject.content.demandOptions || []; } - data.forEach((item) => { - if (item.value === demandId) { - optionPlatform = this.handleDemandOptionPlatform(item); - } - }); - return optionPlatform; - }, - getStoryLabel() { - let demandOptions = this.contentObject.content.demandOptions || []; let optionPlatform = ""; if (demandOptions.length > 0) { for (let i = 0; i < demandOptions.length; i++) { @@ -357,7 +346,7 @@ export default { break; } if (demandOptions[i].children && demandOptions[i].children.length > 0) { - optionPlatform = this.findDemandOptionLabelChilder( + optionPlatform = this.getStoryLabel( demandOptions[i].children, this.contentObject.content.demandId, ); @@ -369,21 +358,6 @@ export default { } return optionPlatform; }, - findDemandOptionLabelChilder(data, demandId) { - let optionPlatform = ""; - if (data.children && data.children.length > 0) { - this.findChilder( - data.children, - demandId - ); - } - data.forEach((item) => { - if (item.value === demandId) { - optionPlatform = this.handleDemandOptionLabel(item); - } - }); - return optionPlatform; - }, handleDemandOptionPlatform(data) { if (data.platform) { return data.platform;