diff --git a/frontend/src/business/components/track/case/TestCase.vue b/frontend/src/business/components/track/case/TestCase.vue index 731bcc3f63..7262e7ce39 100644 --- a/frontend/src/business/components/track/case/TestCase.vue +++ b/frontend/src/business/components/track/case/TestCase.vue @@ -14,6 +14,7 @@ @refresh="refresh" :tree-nodes="treeNodes" :type="'edit'" + :select-node.sync="selectNode" ref="nodeTree"/> @@ -35,6 +36,7 @@ @refresh="refresh" :read-only="testCaseReadOnly" :tree-nodes="treeNodes" + :select-node="selectNode" ref="testCaseEditDialog"> @@ -63,7 +65,8 @@ treeNodes: [], selectNodeIds: [], selectNodeNames: [], - testCaseReadOnly: true + testCaseReadOnly: true, + selectNode: {}, } }, mounted() { @@ -141,6 +144,7 @@ }, editTestCase(testCase) { this.testCaseReadOnly = false; + console.log(this.selectNode); this.$refs.testCaseEditDialog.open(testCase); }, copyTestCase(testCase) { @@ -162,6 +166,7 @@ refresh() { this.selectNodeIds = []; this.selectNodeNames = []; + this.selectNode = {}; this.$refs.testCaseList.initTableData(); this.getNodeTree(); }, diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index c95d95447c..7112654a8b 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -19,6 +19,7 @@ + - import {CURRENT_PROJECT, WORKSPACE_ID} from '../../../../../common/js/constants'; + import {CURRENT_PROJECT, WORKSPACE_ID, TokenKey} from '../../../../../common/js/constants'; import MsDialogFooter from '../../../common/components/MsDialogFooter' @@ -236,6 +237,9 @@ readOnly: { type: Boolean, default: true + }, + selectNode: { + type: Object } }, methods: { @@ -255,6 +259,17 @@ tmp.steps = JSON.parse(testCase.steps); Object.assign(this.form, tmp); this.form.module = testCase.nodeId; + } else { + if (this.selectNode.data) { + this.form.module = this.selectNode.data.id; + } else { + this.form.module = this.moduleOptions[0].id; + } + let user = JSON.parse(localStorage.getItem(TokenKey)); + this.form.priority = 'P3'; + this.form.type = 'functional'; + this.form.method = 'manual'; + this.form.maintainer = user.id; } this.dialogFormVisible = true; }, diff --git a/frontend/src/business/components/track/common/NodeTree.vue b/frontend/src/business/components/track/common/NodeTree.vue index 82007f9360..7334aff21f 100644 --- a/frontend/src/business/components/track/common/NodeTree.vue +++ b/frontend/src/business/components/track/common/NodeTree.vue @@ -21,7 +21,7 @@