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 = "";