From 8578954c138e2b73735109f7f70a7ace733fe144 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 7 Jul 2021 10:52:40 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=BC=BA=E9=99=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=A2=9E=E5=8A=A0=E7=94=A8=E4=BE=8B=E6=95=B0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/base/domain/IssuesDao.java | 1 + .../io/metersphere/track/service/IssuesService.java | 4 ++++ .../business/components/track/issue/IssueList.vue | 13 ++++++++++++- frontend/src/common/js/default-table-header.js | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/base/domain/IssuesDao.java b/backend/src/main/java/io/metersphere/base/domain/IssuesDao.java index bbca3ab6e8..fe2587f8d7 100644 --- a/backend/src/main/java/io/metersphere/base/domain/IssuesDao.java +++ b/backend/src/main/java/io/metersphere/base/domain/IssuesDao.java @@ -10,4 +10,5 @@ public class IssuesDao extends IssuesWithBLOBs { private String projectName; private String creatorName; private String resourceName; + private long caseCount; } diff --git a/backend/src/main/java/io/metersphere/track/service/IssuesService.java b/backend/src/main/java/io/metersphere/track/service/IssuesService.java index dd7777cc9b..8a04c6964d 100644 --- a/backend/src/main/java/io/metersphere/track/service/IssuesService.java +++ b/backend/src/main/java/io/metersphere/track/service/IssuesService.java @@ -341,6 +341,10 @@ public class IssuesService { if (planMap.get(item.getResourceId()) != null) { item.setResourceName(planMap.get(item.getResourceId())); } + TestCaseIssuesExample example = new TestCaseIssuesExample(); + example.createCriteria().andIssuesIdEqualTo(item.getId()); + long caseCount = testCaseIssuesMapper.countByExample(example); + item.setCaseCount(caseCount); }); return issues; } diff --git a/frontend/src/business/components/track/issue/IssueList.vue b/frontend/src/business/components/track/issue/IssueList.vue index 4f63f950a2..ea742c7f06 100644 --- a/frontend/src/business/components/track/issue/IssueList.vue +++ b/frontend/src/business/components/track/issue/IssueList.vue @@ -105,9 +105,20 @@ - + + + +