From 931f31552bd137408c592ec29457ffed20a453a9 Mon Sep 17 00:00:00 2001 From: MeterSphere Bot <78466014+metersphere-bot@users.noreply.github.com> Date: Mon, 10 Oct 2022 19:56:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E9=A1=B5=E9=9D=A2=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=E9=83=A8=E5=88=86BUG=E4=BF=AE=E5=A4=8D=20(#18393)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1017613,1017617,1017618,1017638 --user=宋昌昌 【测试跟踪】功能用例列表页-复制用例,复制的用例再次复制,会丢失责任人信息 https://www.tapd.cn/55049933/s/1257568 Co-authored-by: song-cc-rock --- .../frontend/src/components/MsDialogHeader.vue | 2 +- .../base/mapper/ext/ExtTestReviewCaseMapper.xml | 10 ++++++---- test-track/frontend/src/api/testCase.js | 6 +----- .../src/business/case/components/TestCaseEdit.vue | 3 +++ .../src/business/case/components/TestCaseList.vue | 7 ++++--- .../business/case/components/TestCaseTestRelate.vue | 12 +++++++----- .../view/components/TestReviewTestCaseEdit.vue | 4 ++-- 7 files changed, 24 insertions(+), 20 deletions(-) diff --git a/framework/sdk-parent/frontend/src/components/MsDialogHeader.vue b/framework/sdk-parent/frontend/src/components/MsDialogHeader.vue index a7dfaf3eb3..a623321c7d 100644 --- a/framework/sdk-parent/frontend/src/components/MsDialogHeader.vue +++ b/framework/sdk-parent/frontend/src/components/MsDialogHeader.vue @@ -9,7 +9,7 @@
{{ $t('commons.cancel') }} - + {{ $t('commons.confirm') }}
diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml index 93a3335884..1b26d4e3d8 100644 --- a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml +++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml @@ -394,11 +394,13 @@ diff --git a/test-track/frontend/src/api/testCase.js b/test-track/frontend/src/api/testCase.js index 23b49c4956..f5c7a7fd40 100644 --- a/test-track/frontend/src/api/testCase.js +++ b/test-track/frontend/src/api/testCase.js @@ -152,13 +152,9 @@ export function getReviewCasesForMinder(request, callback) { } export function getRelateTest(caseId) { - if (caseId) { - return get('/test/case/relate/test/list/' + caseId); - } - return {}; + return get('/test/case/relate/test/list/' + caseId); } - export function deleteRelateTest(caseId, testId) { return get('/test/case/relate/delete/' + caseId + '/' + testId); } diff --git a/test-track/frontend/src/business/case/components/TestCaseEdit.vue b/test-track/frontend/src/business/case/components/TestCaseEdit.vue index 859c128160..78b63c30ae 100644 --- a/test-track/frontend/src/business/case/components/TestCaseEdit.vue +++ b/test-track/frontend/src/business/case/components/TestCaseEdit.vue @@ -622,6 +622,9 @@ export default { this.operationType = 'add'; this.copyCaseId = testCase.copyId; this.setFormData(testCase); + this.testCaseTemplate.customFields.forEach(item => { + item.isEdit = false; + }); this.setTestCaseExtInfo(testCase); this.getSelectOptions(); this.reload(); diff --git a/test-track/frontend/src/business/case/components/TestCaseList.vue b/test-track/frontend/src/business/case/components/TestCaseList.vue index cc15f21e1f..2253c4cb59 100644 --- a/test-track/frontend/src/business/case/components/TestCaseList.vue +++ b/test-track/frontend/src/business/case/components/TestCaseList.vue @@ -477,6 +477,10 @@ export default { if (ids) { this.condition.ids = ids; } + let dataSelectRange = this.$route.params.dataSelectRange; + if (!dataSelectRange) { + delete this.condition.filters.review_status + } this.initTableData(); this.condition.ids = null; this.getVersionOptions(); @@ -670,9 +674,6 @@ export default { this.condition.selectThisWeedRelevanceData = false; this.condition.caseCoverage = null; this.condition.filters.reviewStatus = ["Prepare", "Pass", "UnPass"]; - if (!this.selectDataRange) { - delete this.condition.filters.review_status - } switch (this.selectDataRange) { case 'thisWeekCount': this.condition.selectThisWeedData = true; diff --git a/test-track/frontend/src/business/case/components/TestCaseTestRelate.vue b/test-track/frontend/src/business/case/components/TestCaseTestRelate.vue index d4f21f0332..8cd64bbe27 100644 --- a/test-track/frontend/src/business/case/components/TestCaseTestRelate.vue +++ b/test-track/frontend/src/business/case/components/TestCaseTestRelate.vue @@ -132,11 +132,13 @@ export default { }); }, initTable() { - getRelateTest(this.caseId) - .then((response) => { - this.data = response.data; - this.notInIds = this.data.map(i => i.testId); - }); + if (this.caseId) { + getRelateTest(this.caseId) + .then((response) => { + this.data = response.data; + this.notInIds = this.data.map(i => i.testId); + }); + } }, } } diff --git a/test-track/frontend/src/business/review/view/components/TestReviewTestCaseEdit.vue b/test-track/frontend/src/business/review/view/components/TestReviewTestCaseEdit.vue index 3cee458d79..72f55e5e0b 100644 --- a/test-track/frontend/src/business/review/view/components/TestReviewTestCaseEdit.vue +++ b/test-track/frontend/src/business/review/view/components/TestReviewTestCaseEdit.vue @@ -385,7 +385,7 @@ export default { parseCustomField(item, this.testCaseTemplate, null, buildTestCaseOldFields(item)); this.isCustomFiledActive = true; this.testCase = item; - this.oldReviewStatus = this.testCase.status; + this.oldReviewStatus = this.testCase.reviewStatus; if (!this.testCase.actualResult) { // 如果没值,使用模板的默认值 this.testCase.actualResult = this.testCaseTemplate.actualResult; @@ -404,7 +404,7 @@ export default { openTestCaseEdit(testCase, tableData) { this.showDialog = true; // 一开始加载时候需要保存用例评审旧的状态 - this.oldReviewStatus = testCase.status; + this.oldReviewStatus = testCase.reviewStatus; this.activeTab = 'detail'; this.hasTapdId = false; this.hasZentaoId = false;