fix(测试跟踪): 关联需求缺少other选项

--bug=1023703 --user=陈建星 【测试跟踪】功能用例编辑页面,关联需求,不展示默认的other需求了 https://www.tapd.cn/55049933/s/1341502
This commit is contained in:
chenjianxing 2023-02-22 21:15:38 +08:00 committed by jianxing
parent 5e276b6426
commit 41ab6604dc
1 changed files with 6 additions and 3 deletions

View File

@ -629,18 +629,21 @@ export default {
issueDemandList(this.projectId) issueDemandList(this.projectId)
.then((r) => { .then((r) => {
this.demandOptions = []; this.demandOptions = [];
this.demandList = r.data; if (r.data) {
this.demandList = r.data;
}
this.buildDemandOptions(); this.buildDemandOptions();
}) })
.catch(() => { .catch((r) => {
this.demandOptions = [];
this.addOtherOption(); this.addOtherOption();
}); });
} }
}, },
buildDemandOptions() { buildDemandOptions() {
this.demandOptions = []; this.demandOptions = [];
this.addOtherOption();
if (this.demandList.length > 0) { if (this.demandList.length > 0) {
this.addOtherOption();
this.buildDemandCascaderOptions(this.demandList, this.demandOptions, []); this.buildDemandCascaderOptions(this.demandList, this.demandOptions, []);
} }
}, },