fix(测试跟踪): 测试跟踪功能用例批量关联需求不显示问题

--bug=1019039 --user=宋昌昌 【测试跟踪】项目关联tapd-测试用例批量关联需求-需求列表不显示tapd的需求 https://www.tapd.cn/55049933/s/1282080
This commit is contained in:
song-cc-rock 2022-10-28 14:54:32 +08:00 committed by 刘瑞斌
parent 2cfa1a7bfe
commit f28adc6391
1 changed files with 27 additions and 25 deletions

View File

@ -33,6 +33,7 @@
<script>
import MsDialogFooter from "metersphere-frontend/src/components/MsDialogFooter";
import {getCurrentProjectID, removeGoBackListener} from "@/business/utils/sdk-utils";
import {issueDemandList} from "@/api/issue";
export default {
name: "RelateDemand",
@ -73,31 +74,32 @@ export default {
getDemandOptions() {
if (this.demandOptions.length === 0) {
this.result = {loading: true};
this.$get("/issues/demand/list/" + getCurrentProjectID()).then(response => {
this.demandOptions = [];
if (response.data.data && response.data.data.length > 0) {
this.buildDemandCascaderOptions(response.data.data, this.demandOptions, []);
}
this.demandOptions.unshift({
value: 'other',
label: 'Other: ' + this.$t('test_track.case.other'),
platform: 'Other'
});
if (this.form.demandId === 'other') {
this.demandValue = ['other'];
}
this.result = {loading: false};
}).catch(() => {
this.demandOptions.unshift({
value: 'other',
label: 'Other: ' + this.$t('test_track.case.other'),
platform: 'Other'
});
if (this.form.demandId === 'other') {
this.demandValue = ['other'];
}
this.result = {loading: false};
});
issueDemandList(getCurrentProjectID())
.then(response => {
this.demandOptions = [];
if (response.data && response.data.length > 0) {
this.buildDemandCascaderOptions(response.data, this.demandOptions, []);
}
this.demandOptions.unshift({
value: 'other',
label: 'Other: ' + this.$t('test_track.case.other'),
platform: 'Other'
});
if (this.form.demandId === 'other') {
this.demandValue = ['other'];
}
this.result = {loading: false};
}).catch(() => {
this.demandOptions.unshift({
value: 'other',
label: 'Other: ' + this.$t('test_track.case.other'),
platform: 'Other'
});
if (this.form.demandId === 'other') {
this.demandValue = ['other'];
}
this.result = {loading: false};
})
}
},
buildDemandCascaderOptions(data, options, pathArray) {