From 720d24e6577d8207e7f1398e845238c7dfa3e56d Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 21 Jan 2022 09:43:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=88=87=E6=8D=A2=E7=89=88=E6=9C=AC=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=8F=B0=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/mapper/ext/ExtTestCaseMapper.xml | 2 +- .../track/controller/TestCaseController.java | 6 ---- .../track/service/TestCaseService.java | 4 +-- .../components/track/case/TestCase.vue | 2 -- .../track/case/components/TestCaseEdit.vue | 16 ++++------ .../case/components/TestCaseEditShow.vue | 29 +++++++------------ 6 files changed, 19 insertions(+), 40 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml index 7c6efa8595..9b1ee3a8f9 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml @@ -435,7 +435,7 @@ - from test_case + from test_case left join project on test_case.project_id = project.id diff --git a/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java index cfe83f5966..cad3c1a2f2 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java @@ -108,12 +108,6 @@ public class TestCaseController { return testCaseService.listTestCaseIds(request); } - @PostMapping("/list/ids/public") - public List getTestPlanCaseIdsPublic(@RequestBody QueryTestCaseRequest request) { - return testCaseService.publicListTestCase(request); - } - - @GetMapping("/relationship/case/{id}/{relationshipType}") public List getRelationshipCase(@PathVariable("id") String id, @PathVariable("relationshipType") String relationshipType) { return testCaseService.getRelationshipCase(id, relationshipType); diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index 5c85d1f0bc..b4ab217cac 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -1712,8 +1712,8 @@ public class TestCaseService { public List listTestCaseIds(QueryTestCaseRequest request) { setDefaultOrder(request); List selectFields = new ArrayList<>(); - selectFields.add("id"); - selectFields.add("name"); + selectFields.add("test_case.id"); + selectFields.add("test_case.name"); request.setSelectFields(selectFields); return extTestCaseMapper.listIds(request); } diff --git a/frontend/src/business/components/track/case/TestCase.vue b/frontend/src/business/components/track/case/TestCase.vue index c7675a6e48..fd95a89b20 100644 --- a/frontend/src/business/components/track/case/TestCase.vue +++ b/frontend/src/business/components/track/case/TestCase.vue @@ -663,7 +663,6 @@ export default { checkout(testCase, item) { Object.assign(item.testCaseInfo, testCase) //子组件先变更 copy 状态,再执行初始化操作 - this.$refs.testCaseEdit[0].changeType("copy"); this.$refs.testCaseEdit[0].initEdit(item.testCaseInfo, () => { this.$nextTick(() => { let vh = this.$refs.testCaseEdit[0].$refs.versionHistory; @@ -676,7 +675,6 @@ export default { checkoutPublic(testCase, item) { Object.assign(item.testCaseInfo, testCase) //子组件先变更 copy 状态,再执行初始化操作 - this.$refs.testCaseEditShow[0].changeType("copy"); this.$refs.testCaseEditShow[0].initEdit(item.testCaseInfo, () => { this.$nextTick(() => { let vh = this.$refs.testCaseEditShow[0].$refs.versionHistory; diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index 916692a39a..0b38e26793 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -114,7 +114,8 @@ + :label-width="formLabelWidth" :case-id="form.id" :version-enable="versionEnable" + ref="otherInfo"/> {{ $t('test_track.review.comment') }}: @@ -637,17 +638,11 @@ export default { }, initTestCases(testCase) { if (this.publicEnable) { - this.result = this.$post('/test/case/list/ids/public', this.selectCondition, response => { - this.testCases = response.data; - for (let i = 0; i < this.testCases.length; i++) { - if (this.testCases[i].id === testCase.id) { - this.index = i; - this.getTestCase(i); - } - } - }); + this.selectCondition.projectId = null; } else { this.selectCondition.workspaceId = null; + } + this.selectCondition.versionId = testCase.versionId this.result = this.$post('/test/case/list/ids', this.selectCondition, response => { this.testCases = response.data; for (let i = 0; i < this.testCases.length; i++) { @@ -657,7 +652,6 @@ export default { } } }); - } }, getTestCase(index) { let id = ""; diff --git a/frontend/src/business/components/track/case/components/TestCaseEditShow.vue b/frontend/src/business/components/track/case/components/TestCaseEditShow.vue index f2e10d4ba9..7979f3919b 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEditShow.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEditShow.vue @@ -594,27 +594,20 @@ export default { }, initTestCases(testCase) { if (this.publicEnable) { - this.result = this.$post('/test/case/list/ids/public', this.selectCondition, response => { - this.testCases = response.data; - for (let i = 0; i < this.testCases.length; i++) { - if (this.testCases[i].id === testCase.id) { - this.index = i; - this.getTestCase(i); - } - } - }); + this.selectCondition.projectId = null; } else { this.selectCondition.workspaceId = null; - this.result = this.$post('/test/case/list/ids', this.selectCondition, response => { - this.testCases = response.data; - for (let i = 0; i < this.testCases.length; i++) { - if (this.testCases[i].id === testCase.id) { - this.index = i; - this.getTestCase(i); - } - } - }); } + this.selectCondition.versionId = testCase.versionId + this.result = this.$post('/test/case/list/ids', this.selectCondition, response => { + this.testCases = response.data; + for (let i = 0; i < this.testCases.length; i++) { + if (this.testCases[i].id === testCase.id) { + this.index = i; + this.getTestCase(i); + } + } + }); }, getTestCase(index) { let id = "";