diff --git a/frontend/src/business/components/track/case/components/TestCaseEditOtherInfo.vue b/frontend/src/business/components/track/case/components/TestCaseEditOtherInfo.vue index 36ef2656c9..cb8c962684 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEditOtherInfo.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEditOtherInfo.vue @@ -18,12 +18,17 @@ - + + + + @@ -160,6 +165,7 @@ export default { demandOptions: [], relationshipCount: 0, demandValue: [], + demandLabel: '', //sysList:this.sysList,//一级选择框的数据 props: { multiple: true, @@ -386,34 +392,29 @@ export default { } }, getDemandOptions() { - if (this.demandOptions.length === 0) { - this.result = {loading: true}; - this.$get("/issues/demand/list/" + this.projectId).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}; - }); + this.result = {loading: true}; + this.demandLabel = ''; + this.$get("/issues/demand/list/" + this.projectId).then(response => { + this.demandOptions = []; + if (response.data.data && response.data.data.length > 0) { + this.buildDemandCascaderOptions(response.data.data, this.demandOptions, []); + } + this.addOtherOption(); + }).catch(() => { + this.addOtherOption(); + }); + }, + addOtherOption() { + this.demandOptions.unshift({ + value: 'other', + label: 'Other: ' + this.$t('test_track.case.other'), + platform: 'Other' + }); + if (this.form.demandId === 'other') { + this.demandValue = ['other']; + this.demandLabel = 'Other: ' + this.$t('test_track.case.other'); } + this.result = {loading: false}; }, buildDemandCascaderOptions(data, options, pathArray) { data.forEach(item => { @@ -421,6 +422,9 @@ export default { label: item.platform + ': ' + item.name, value: item.id } + if (this.form.demandId === item.id) { + this.demandLabel = option.label; + } options.push(option); pathArray.push(item.id); if (item.id === this.form.demandId) { @@ -475,4 +479,8 @@ export default { word-break: break-all; margin-right: 5px; } + +.demandInput { + width: 200px; +} diff --git a/frontend/src/business/components/track/review/view/components/TestReviewTestCaseEdit.vue b/frontend/src/business/components/track/review/view/components/TestReviewTestCaseEdit.vue index a4c17aeacb..9efdb60f07 100644 --- a/frontend/src/business/components/track/review/view/components/TestReviewTestCaseEdit.vue +++ b/frontend/src/business/components/track/review/view/components/TestReviewTestCaseEdit.vue @@ -428,6 +428,10 @@ export default { this.testCaseTemplate = template; initFuc(testCase.id); }); + + if (this.$refs.otherInfo) { + this.$refs.otherInfo.reset(); + } }, openTestTestCase(item) { let testCaseData = this.$router.resolve(