From cdbdcb931c9580c06da465b33de699d0a1a810a4 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Mon, 5 Jun 2023 10:42:26 +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=8BTAB=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E8=A7=92=E6=A0=87=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1026581 --user=宋昌昌 统一角标风格为圆圈加数字,另外关联用例和关联缺陷下面都有数据,但是没有显示角标 https://www.tapd.cn/55049933/s/1378500 --- test-track/frontend/src/api/issue.js | 19 +-------- .../components/case/CaseEditInfoComponent.vue | 38 ++++++++++++++--- .../case/components/case/CaseIssueRelate.vue | 42 +++++++++++-------- .../case/components/case/CaseTestRelate.vue | 2 +- 4 files changed, 60 insertions(+), 41 deletions(-) diff --git a/test-track/frontend/src/api/issue.js b/test-track/frontend/src/api/issue.js index ee6f3f1c7a..7a5512a8dc 100644 --- a/test-track/frontend/src/api/issue.js +++ b/test-track/frontend/src/api/issue.js @@ -83,7 +83,7 @@ export function getIssuesByCaseId(refType, caseId, page) { } } -function like(key, target) { +export function like(key, target) { if (key === undefined || target === undefined) { return false; } @@ -93,22 +93,7 @@ function like(key, target) { export function getIssuesByCaseIdWithSearch(refType, caseId, page, condition) { if (caseId) { - return get('issues/get/case/' + refType + '/' + caseId) - .then((response) => { - if(condition && condition.name && response.data){ - //过滤 - page.data = response.data.filter((v) => { - return ( - like(condition.name, v.title) || - like(condition.name, v.num) - ); - }); - } else{ - page.data = response.data; - } - buildIssues(page); - parseFields(page); - }); + return get('issues/get/case/' + refType + '/' + caseId); } } diff --git a/test-track/frontend/src/business/case/components/case/CaseEditInfoComponent.vue b/test-track/frontend/src/business/case/components/case/CaseEditInfoComponent.vue index f097769f31..57b3f8ead2 100644 --- a/test-track/frontend/src/business/case/components/case/CaseEditInfoComponent.vue +++ b/test-track/frontend/src/business/case/components/case/CaseEditInfoComponent.vue @@ -3,6 +3,7 @@
+
+ + + {{ $t('case.associate_test_cases') }} +
+
{{ relateCaseCount }}
+
+
+ + {{ $t('test_track.case.relate_issue') }} +
+
{{ relateIssueCount }}
+
+
+ - + + {{ $t('commons.relationship.name') }} +
+
{{ relationshipCount }}
+
+
+ {{ $t('case.comment') }} @@ -236,6 +254,8 @@ export default { fileList: [], tableData: [], demandOptions: [], + relateCaseCount: 0, + relateIssueCount: 0, relationshipCount: 0, demandValue: [], demandLabel: "", @@ -344,6 +364,12 @@ export default { setRelationshipCount(count) { this.relationshipCount = count; }, + setRelateCaseCount(count) { + this.relateCaseCount = count; + }, + setRelateIssueCount(count) { + this.relateIssueCount = count; + }, setRelationshipGraph(val) { this.$emit("syncRelationGraphOpen", val); }, diff --git a/test-track/frontend/src/business/case/components/case/CaseIssueRelate.vue b/test-track/frontend/src/business/case/components/case/CaseIssueRelate.vue index 9c021c660d..a60b466541 100644 --- a/test-track/frontend/src/business/case/components/case/CaseIssueRelate.vue +++ b/test-track/frontend/src/business/case/components/case/CaseIssueRelate.vue @@ -185,23 +185,19 @@ import IssueDescriptionTableItem from "@/business/issue/IssueDescriptionTableIte import {ISSUE_STATUS_MAP, TAPD_ISSUE_STATUS_MAP} from "metersphere-frontend/src/utils/table-constants"; import IssueRelateList from "./CaseIssueRelateList"; import { + buildIssues, closeIssue, deleteIssueRelate, getIssuePartTemplateWithProject, - getIssuesByCaseId, + getIssuesByCaseIdWithSearch, + getPlatformStatus, issueStatusChange, - getIssuesByCaseIdWithSearch, getPlatformStatus, + like, + parseFields, } from "@/api/issue"; -import { - getCustomFieldValue, - getTableHeaderWithCustomFields, -} from "metersphere-frontend/src/utils/tableUtils"; +import {getCustomFieldValue, getTableHeaderWithCustomFields,} from "metersphere-frontend/src/utils/tableUtils"; import {LOCAL} from "metersphere-frontend/src/utils/constants"; -import { - getCurrentProjectID, - getCurrentWorkspaceId, -} from "metersphere-frontend/src/utils/token"; -import {operationConfirm} from "@/business/utils/sdk-utils"; +import {getCurrentProjectID, getCurrentWorkspaceId,} from "metersphere-frontend/src/utils/token"; import MsNewUiSearch from "metersphere-frontend/src/components/new-ui/MsSearch"; export default { @@ -297,6 +293,7 @@ export default { }); }, activated() { + this.search(); getPlatformStatus({ projectId: getCurrentProjectID(), workspaceId: getCurrentWorkspaceId() @@ -326,12 +323,23 @@ export default { getIssues() { if (!this.isCopy) { this.page.result = true; - let result = getIssuesByCaseIdWithSearch( - this.planId ? "PLAN_FUNCTIONAL" : "FUNCTIONAL", - this.getCaseResourceId(), - this.page, - this.condition - ); + let result = getIssuesByCaseIdWithSearch(this.planId ? "PLAN_FUNCTIONAL" : "FUNCTIONAL", this.getCaseResourceId()) + .then((response) => { + if(this.condition && this.condition.name && response.data){ + //过滤 + this.page.data = response.data.filter((v) => { + return ( + like(condition.name, v.title) || + like(condition.name, v.num) + ); + }); + } else { + this.page.data = response.data; + } + this.$emit("setCount", this.page.data.length); + buildIssues(page); + parseFields(page); + }); if (result) { this.page.result = result; } diff --git a/test-track/frontend/src/business/case/components/case/CaseTestRelate.vue b/test-track/frontend/src/business/case/components/case/CaseTestRelate.vue index 9e7efac9e6..2f690b7bd5 100644 --- a/test-track/frontend/src/business/case/components/case/CaseTestRelate.vue +++ b/test-track/frontend/src/business/case/components/case/CaseTestRelate.vue @@ -229,7 +229,7 @@ export default { } else { this.data = data; } - + this.$emit("setCount", this.data.length); this.notInIds = this.data.map((i) => i.testId); }); }