From bccc1e3b1c8a34d28cb232a21b69926430ab7bb1 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 24 Apr 2020 09:42:48 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E5=B1=95=E7=A4=BA=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/track/case/TestCase.vue | 15 ++++++++--- .../track/case/components/TestCaseEdit.vue | 25 +++++++++++++------ .../track/case/components/TestCaseList.vue | 19 +++++++------- 3 files changed, 38 insertions(+), 21 deletions(-) diff --git a/frontend/src/business/components/track/case/TestCase.vue b/frontend/src/business/components/track/case/TestCase.vue index d6c42790e7..e63ec65808 100644 --- a/frontend/src/business/components/track/case/TestCase.vue +++ b/frontend/src/business/components/track/case/TestCase.vue @@ -22,8 +22,8 @@ :current-project="currentProject" :selectNodeIds="selectNodeIds" :selectNodeNames="selectNodeNames" - @openTestCaseEditDialog="openTestCaseEditDialog" - @testCaseEdit="openTestCaseEditDialog" + @testCaseEdit="editTestCase" + @testCaseDetail="showTestCaseDetail" @refresh="refresh" ref="testCaseList"> @@ -32,6 +32,7 @@ @@ -60,7 +61,8 @@ currentProject: null, treeNodes: [], selectNodeIds: [], - selectNodeNames: [] + selectNodeNames: [], + testCaseReadOnly: true } }, mounted() { @@ -136,7 +138,12 @@ refreshTable() { this.$refs.testCaseList.initTableData(); }, - openTestCaseEditDialog(testCase) { + editTestCase(testCase) { + this.testCaseReadOnly = false; + this.$refs.testCaseEditDialog.open(testCase); + }, + showTestCaseDetail(testCase) { + this.testCaseReadOnly = true; this.$refs.testCaseEditDialog.open(testCase); }, getProjectByCaseId(caseId) { diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index acc373d1c6..d9600ec2fe 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -13,7 +13,7 @@ :label="$t('test_track.case.name')" :label-width="formLabelWidth" prop="name"> - + @@ -21,6 +21,7 @@ - + - + @@ -62,7 +63,7 @@ - + @@ -71,7 +72,7 @@ - + @@ -85,7 +86,7 @@ - @@ -143,7 +147,7 @@ icon="el-icon-delete" circle size="mini" @click="handleDeleteStep(scope.$index, scope.row)" - :disabled="scope.$index == 0 ? true : false"> + :disabled="readOnly || scope.$index == 0 ? true : false"> @@ -159,6 +163,7 @@ @@ -167,7 +172,7 @@ @@ -227,6 +232,10 @@ props: { treeNodes: { type: Array + }, + readOnly: { + type: Boolean, + default: true } }, methods: { diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index dd9fd93de5..dbab186688 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -19,6 +19,7 @@ - - - +