From 60351d21194db8223ba6d87cc221633515264514 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 22 Feb 2023 16:01:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E5=BA=93=E5=88=97=E8=A1=A8=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1023677 --user=陈建星 【测试跟踪】功能测试-公共用例库列表-标签为空显示为[] https://www.tapd.cn/55049933/s/1340774 --- .../business/case/components/TestCaseList.vue | 21 +++------------- .../components/public/PublicTestCaseList.vue | 25 ++++++++++++++++--- .../frontend/src/business/case/test-case.js | 24 ++++++++++++++++++ 3 files changed, 48 insertions(+), 22 deletions(-) diff --git a/test-track/frontend/src/business/case/components/TestCaseList.vue b/test-track/frontend/src/business/case/components/TestCaseList.vue index 983caaa045..929860a838 100644 --- a/test-track/frontend/src/business/case/components/TestCaseList.vue +++ b/test-track/frontend/src/business/case/components/TestCaseList.vue @@ -312,7 +312,7 @@ import { getCustomFieldValueForTrack, getProjectMemberOption } from "@/business/utils/sdk-utils"; -import {initTestCaseConditionComponents, openCaseEdit} from "@/business/case/test-case"; +import {getTagToolTips, initTestCaseConditionComponents, openCaseEdit, parseColumnTag} from "@/business/case/test-case"; export default { @@ -628,25 +628,10 @@ export default { }); }, getTagToolTips(tags) { - try { - let showTips = ''; - tags.forEach((item) => { - showTips += item + ','; - }); - return showTips.substr(0, showTips.length - 1); - } catch (e) { - return ''; - } + return getTagToolTips(tags); }, parseColumnTag(tags) { - if (tags.length > 1) { - let parseTags = []; - parseTags.push(tags[0]); - parseTags.push("+" + (tags.length - 1)); - return parseTags; - } else { - return tags; - } + return parseColumnTag(tags); }, initConditionComponents() { this.condition.components = initTestCaseConditionComponents(this.condition, this.testCaseTemplate.customFields, this.trashEnable); diff --git a/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue b/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue index b8fb4a9bed..93cf126228 100644 --- a/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue +++ b/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue @@ -143,9 +143,20 @@ :label="$t('commons.tag')" min-width="80"> @@ -240,7 +251,7 @@ import {useStore} from "@/store"; import {getProjectMemberUserFilter} from "@/api/user"; import TypeTableItem from "@/business/common/tableItems/planview/TypeTableItem"; import {getVersionFilters} from "@/business/utils/sdk-utils"; -import {openCaseEdit} from "@/business/case/test-case"; +import {getTagToolTips, openCaseEdit, parseColumnTag} from "@/business/case/test-case"; import PublicTestCaseShow from "@/business/case/components/public/PublicTestCaseShow" @@ -503,6 +514,12 @@ export default { }) } }, + getTagToolTips(tags) { + return getTagToolTips(tags); + }, + parseColumnTag(tags) { + return parseColumnTag(tags); + }, isOwner(testCase) { return testCase.maintainer === this.currentUser || testCase.createUser === this.currentUser; }, diff --git a/test-track/frontend/src/business/case/test-case.js b/test-track/frontend/src/business/case/test-case.js index ecc05e3dec..ef23efaa3a 100644 --- a/test-track/frontend/src/business/case/test-case.js +++ b/test-track/frontend/src/business/case/test-case.js @@ -96,3 +96,27 @@ export function openCaseCreate(query, v) { }); window.open(TestCaseData.href, '_blank'); } + +export function getTagToolTips(tags) { + try { + let showTips = ''; + tags.forEach((item) => { + showTips += item + ','; + }); + return showTips.substr(0, showTips.length - 1); + } catch (e) { + return ''; + } +} + + +export function parseColumnTag(tags) { + if (tags.length > 1) { + let parseTags = []; + parseTags.push(tags[0]); + parseTags.push("+" + (tags.length - 1)); + return parseTags; + } else { + return tags; + } +}