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 @@ - - - +