From 54ba05d9f4e12e9fb44c87b2875081ecbc42b821 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 18 Aug 2021 11:35:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=A8=E4=BE=8B=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=88=97=E5=AE=BD=E8=B0=83=E6=95=B4#1005639?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1005639 --user=lyh 【测试跟踪】测试用例列表名称列还是显示不全 https://www.tapd.cn/55049933/s/1036071 --- .../service/TestReviewTestCaseService.java | 2 +- .../functional/FunctionalTestCaseList.vue | 2 +- .../components/TestReviewTestCaseList.vue | 380 +++++++----------- 3 files changed, 148 insertions(+), 236 deletions(-) diff --git a/backend/src/main/java/io/metersphere/track/service/TestReviewTestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestReviewTestCaseService.java index d477d420f4..8fe10f48a3 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestReviewTestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestReviewTestCaseService.java @@ -62,7 +62,7 @@ public class TestReviewTestCaseService { request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders())); List list = extTestReviewCaseMapper.list(request); QueryMemberRequest queryMemberRequest = new QueryMemberRequest(); - queryMemberRequest.setWorkspaceId(SessionUtils.getCurrentWorkspaceId()); + queryMemberRequest.setWorkspaceId(SessionUtils.getCurrentProjectId()); Map userMap = userService.getMemberList(queryMemberRequest) .stream().collect(Collectors.toMap(User::getId, User::getName)); list.forEach(item -> { diff --git a/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue b/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue index 630fd64763..288964ccbd 100644 --- a/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue @@ -295,7 +295,7 @@ export default { // updata: false, type: TEST_PLAN_FUNCTION_TEST_CASE, fields: [], - fieldsWidth: getCustomTableWidth('TRACK_TEST_CASE'), + fieldsWidth: getCustomTableWidth('TEST_PLAN_FUNCTION_TEST_CASE'), screenHeight: 'calc(100vh - 275px)', tableLabel: [], result: {}, diff --git a/frontend/src/business/components/track/review/view/components/TestReviewTestCaseList.vue b/frontend/src/business/components/track/review/view/components/TestReviewTestCaseList.vue index 59089cf113..9c4a13c1dd 100644 --- a/frontend/src/business/components/track/review/view/components/TestReviewTestCaseList.vue +++ b/frontend/src/business/components/track/review/view/components/TestReviewTestCaseList.vue @@ -15,180 +15,132 @@ @refresh="initTableData"/> - - + + + - + - - - - - - - - - - + + + + + ref="testReviewTestCaseEdit" + :search-param="condition" + @refresh="initTableData" + :is-read-only="isReadOnly" + @refreshTable="search"/> { - if (unSelectIds.indexOf(row.id) < 0) { - this.$refs.caseTable.toggleRowSelection(row, true); - - //默认全选,需要把选中对行添加到selectRows中。不然会影响到勾选函数统计 - if (!this.selectRows.has(row)) { - this.$set(row, "showMore", true); - this.selectRows.add(row); - } - } else { - //不勾选的行,也要判断是否被加入了selectRow中。加入了的话就去除。 - if (this.selectRows.has(row)) { - this.$set(row, "showMore", false); - this.selectRows.delete(row); - } - } - }); - } - }, showDetail(row, event, column) { this.isReadOnly = true; this.$refs.testReviewTestCaseEdit.openTestCaseEdit(row); }, refresh() { this.condition = {components: TEST_CASE_CONFIGS}; - this.selectRows.clear(); + this.tableClear(); this.$emit('refresh'); }, refreshTableAndReview() { @@ -429,10 +369,11 @@ export default { confirmButtonText: this.$t('commons.confirm'), callback: (action) => { if (action === 'confirm') { - let param = buildBatchParam(this); + let param = buildBatchParam(this, this.$refs.table.selectIds); + param.ids = this.$refs.table.selectIds; param.reviewId = this.reviewId; this.$post('/test/review/case/batch/delete', param, () => { - this.selectRows.clear(); + this.tableClear(); this.$emit("refresh"); this.$success(this.$t('test_track.cancel_relevance_success')); }); @@ -448,47 +389,22 @@ export default { }); }, handleEditBatch() { - this.$refs.batchEdit.open(this.selectRows.size); + this.$refs.batchEdit.open(this.$refs.table.selectRows.size); }, batchEdit(form) { let reviewId = this.reviewId; - let param = buildBatchParam(this); + let param = buildBatchParam(this, this.$refs.table.selectIds); + param.ids = Array.from(this.$refs.table.selectRows).map(row => row.caseId); param[form.type] = form.value; - param.ids = Array.from(this.selectRows).map(row => row.caseId); param.reviewId = reviewId; this.$post('/test/review/case/batch/edit/status', param, () => { - this.selectRows.clear(); + this.tableClear(); this.status = ''; this.$post('/test/case/review/edit/status/' + reviewId); this.$success(this.$t('commons.save_success')); this.$emit('refresh'); }); }, - handleSelectAll(selection) { - if (selection.length > 0) { - this.tableData.forEach(item => { - this.$set(item, "showMore", true); - this.selectRows.add(item); - }); - } else { - this.selectRows.clear(); - this.tableData.forEach(row => { - this.$set(row, "showMore", false); - }); - } - }, - handleSelectionChange(selection, row) { - _handleSelect(this, selection, row, this.selectRows); - setUnSelectIds(this.tableData, this.condition, this.selectRows); - this.selectDataCounts = getSelectDataCounts(this.condition, this.total, this.selectRows); - // if (this.selectRows.has(row)) { - // this.$set(row, "showMore", false); - // this.selectRows.delete(row); - // } else { - // this.$set(row, "showMore", true); - // this.selectRows.add(row); - // } - }, openTestReport() { this.$refs.testReportTemplateList.open(this.reviewId); }, @@ -500,18 +416,6 @@ export default { }); } }, - filter(filters) { - _filter(filters, this.condition); - this.initTableData(); - }, - sort(column) { - // 每次只对一个字段排序 - if (this.condition.orders) { - this.condition.orders = []; - } - _sort(column, this.condition); - this.initTableData(); - }, startReview() { if (this.tableData.length !== 0) { this.isReadOnly = false; @@ -531,7 +435,11 @@ export default { //更新统计信息 this.selectDataCounts = getSelectDataCounts(this.condition, this.total, this.selectRows); }, - + tableClear() { + if (this.$refs.table) { + this.$refs.table.clear(); + } + } } }; @@ -542,5 +450,9 @@ export default { font-weight: bold; font-size: 0px; } + +.ms-table-header { + margin-bottom: 10px; +}