fix(测试跟踪):修复功能用例关联devops后,级联选择保存后回显为空

--bug=1022341 --user=王旭 【测试跟踪】github#21508,功能用例关联的devops需求,保存后回显为空 https://www.tapd.cn/55049933/s/1355940
This commit is contained in:
WangXu10 2023-03-27 17:00:16 +08:00 committed by fit2-zhao
parent 7119e050b7
commit c19dee8651
1 changed files with 9 additions and 35 deletions

View File

@ -313,8 +313,10 @@ export default {
return this.contentObject.content.defaultValue; return this.contentObject.content.defaultValue;
} }
}, },
getStoryPlatform() { getStoryPlatform(demandOptions) {
let demandOptions = this.contentObject.content.demandOptions || []; if (!demandOptions) {
demandOptions = this.contentObject.content.demandOptions || [];
}
let optionPlatform = ""; let optionPlatform = "";
if (demandOptions.length > 0) { if (demandOptions.length > 0) {
for (let i = 0; i < demandOptions.length; i++) { for (let i = 0; i < demandOptions.length; i++) {
@ -323,7 +325,7 @@ export default {
break; break;
} }
if (demandOptions[i].children && demandOptions[i].children.length > 0) { if (demandOptions[i].children && demandOptions[i].children.length > 0) {
optionPlatform = this.findChilder( optionPlatform = this.getStoryPlatform(
demandOptions[i].children, demandOptions[i].children,
this.contentObject.content.demandId, this.contentObject.content.demandId,
); );
@ -332,23 +334,10 @@ export default {
} }
return optionPlatform; return optionPlatform;
}, },
findChilder(data, demandId) { getStoryLabel(demandOptions) {
let optionPlatform = ""; if (!demandOptions) {
if (data.children && data.children.length > 0) { demandOptions = this.contentObject.content.demandOptions || [];
this.findChilder(
data.children,
demandId
);
} }
data.forEach((item) => {
if (item.value === demandId) {
optionPlatform = this.handleDemandOptionPlatform(item);
}
});
return optionPlatform;
},
getStoryLabel() {
let demandOptions = this.contentObject.content.demandOptions || [];
let optionPlatform = ""; let optionPlatform = "";
if (demandOptions.length > 0) { if (demandOptions.length > 0) {
for (let i = 0; i < demandOptions.length; i++) { for (let i = 0; i < demandOptions.length; i++) {
@ -357,7 +346,7 @@ export default {
break; break;
} }
if (demandOptions[i].children && demandOptions[i].children.length > 0) { if (demandOptions[i].children && demandOptions[i].children.length > 0) {
optionPlatform = this.findDemandOptionLabelChilder( optionPlatform = this.getStoryLabel(
demandOptions[i].children, demandOptions[i].children,
this.contentObject.content.demandId, this.contentObject.content.demandId,
); );
@ -369,21 +358,6 @@ export default {
} }
return optionPlatform; 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) { handleDemandOptionPlatform(data) {
if (data.platform) { if (data.platform) {
return data.platform; return data.platform;