From e12ec631a163bf5130fcd1b87fd57629745c3bd8 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Wed, 13 Apr 2022 14:51:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化功能用例编辑页面 --- .../components/track/case/TestCase.vue | 2 +- .../track/case/components/TestCaseEdit.vue | 40 ++++------ .../case/components/TestCaseEditOtherInfo.vue | 76 +++++++++++++++++-- 3 files changed, 86 insertions(+), 32 deletions(-) diff --git a/frontend/src/business/components/track/case/TestCase.vue b/frontend/src/business/components/track/case/TestCase.vue index d54fad4d18..cfa26a5164 100644 --- a/frontend/src/business/components/track/case/TestCase.vue +++ b/frontend/src/business/components/track/case/TestCase.vue @@ -131,7 +131,7 @@ :select-node="selectNode" :select-condition="condition" :public-enable="currentActiveName === 'default' ? false : true" - :type="type" + :case-type="type" @addTab="addTab" ref="testCaseEdit"> diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index 393bb7ce00..48f852021c 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -1,9 +1,9 @@ @@ -86,6 +117,8 @@ import TestCaseTestRelate from "@/business/components/track/case/components/Test import DependenciesList from "@/business/components/common/components/graph/DependenciesList"; import TabPaneCount from "@/business/components/track/plan/view/comonents/report/detail/component/TabPaneCount"; import {getRelationshipCountCase} from "@/network/testCase"; +import TestCaseComment from "@/business/components/track/case/components/TestCaseComment"; +import ReviewCommentItem from "@/business/components/track/review/commom/ReviewCommentItem"; export default { name: "TestCaseEditOtherInfo", @@ -93,8 +126,11 @@ export default { TabPaneCount, DependenciesList, TestCaseTestRelate, - FormRichTextItem, TestCaseIssueRelate, TestCaseAttachment, MsRichText, TestCaseRichText}, - props: ['form', 'labelWidth', 'caseId', 'readOnly', 'projectId', 'isTestPlan', 'planId', 'versionEnable', 'isCopy', 'isTestPlanEdit'], + TestCaseComment, + ReviewCommentItem, + FormRichTextItem, TestCaseIssueRelate, TestCaseAttachment, MsRichText, TestCaseRichText + }, + props: ['form', 'labelWidth', 'caseId', 'readOnly', 'projectId', 'isTestPlan', 'planId', 'versionEnable', 'isCopy', 'isTestPlanEdit', 'type', 'comments'], data() { return { result: {}, @@ -153,6 +189,20 @@ export default { updateRemark(text) { this.form.remark = text; }, + openComment() { + this.$emit('openComment'); + }, + getComments(testCase) { + let id = ''; + if (testCase) { + id = testCase.id; + } else { + id = this.form.id; + } + this.result = this.$get('/test/case/comment/list/' + id, res => { + this.comments = res.data; + }) + }, setRelationshipCount(count) { this.relationshipCount = count; }, @@ -280,13 +330,21 @@ export default { if (response.data.data && response.data.data.length > 0) { this.buildDemandCascaderOptions(response.data.data, this.demandOptions, []); } - this.demandOptions.unshift({value: 'other', label: 'Other: ' + this.$t('test_track.case.other'), platform: 'Other'}); + this.demandOptions.unshift({ + value: 'other', + label: 'Other: ' + this.$t('test_track.case.other'), + platform: 'Other' + }); if (this.form.demandId === 'other') { this.demandValue = ['other']; } this.result = {loading: false}; }).catch(() => { - this.demandOptions.unshift({value: 'other', label: 'Other: ' + this.$t('test_track.case.other'), platform: 'Other'}); + this.demandOptions.unshift({ + value: 'other', + label: 'Other: ' + this.$t('test_track.case.other'), + platform: 'Other' + }); if (this.form.demandId === 'other') { this.demandValue = ['other']; } @@ -335,4 +393,12 @@ export default { .el-cascader >>> .el-input { cursor: pointer; } +.ms-header{ + background: #783887; + color: white; + height: 18px; + width: 18px; + font-size: xx-small; + border-radius: 50%; +}