From 9443960c6143b5c5acf8eb5e0fa07b309a1559ab Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 19 Jan 2022 11:10:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=84=91=E5=9B=BE=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=90=8E=E4=BF=9D=E5=AD=98=E5=9C=A8=E6=94=B9?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=B8=8B=E5=88=9B=E5=BB=BA=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=8A=A5=E9=94=99=20--bug=3D1009498=20--user?= =?UTF-8?q?=3D=E9=99=88=E5=BB=BA=E6=98=9F=20[=20github#9020]=E8=84=91?= =?UTF-8?q?=E5=9B=BE=E7=BC=96=E5=86=99=E7=94=A8=E4=BE=8B=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8C=E4=B8=8D=E8=83=BD=E4=BF=AE=E6=94=B9=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E4=B8=8B=E9=9D=A2=E7=9A=84=E7=94=A8=E4=BE=8B=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8E=E4=BC=9A=E6=8A=A5=E9=94=99=20https:?= =?UTF-8?q?//www.tapd.cn/55049933/s/1093818?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/components/MsModuleMinder.vue | 6 +-- .../track/common/minder/TestCaseMinder.vue | 37 +++++++++++-------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/frontend/src/business/components/common/components/MsModuleMinder.vue b/frontend/src/business/components/common/components/MsModuleMinder.vue index 4f7ca24869..8ca6ad00dc 100644 --- a/frontend/src/business/components/common/components/MsModuleMinder.vue +++ b/frontend/src/business/components/common/components/MsModuleMinder.vue @@ -92,7 +92,7 @@ export default { id: "root", type: 'node', level: 0, - resource: this.showModuleTag ? ['模块'] : [], + resource: this.showModuleTag ? [this.$t('test_track.module.module')] : [], path: "", tagEnable: this.tagEnable }, @@ -165,7 +165,7 @@ export default { disable: this.moduleDisable, type: 'node', level: item.level, - resource: this.showModuleTag ? ['模块'] : [], + resource: this.showModuleTag ? [this.$t('test_track.module.module')] : [], caseNum: item.caseNum, path: root.data.path + "/" + item.name, expandState:"collapse" @@ -223,7 +223,7 @@ export default { tagEnable: this.tagEnable, type: 'node', level: nodeData.level, - resource: this.showModuleTag ? ['模块'] : [], + resource: this.showModuleTag ? [this.$t('test_track.module.module')] : [], }, children: [] }, diff --git a/frontend/src/business/components/track/common/minder/TestCaseMinder.vue b/frontend/src/business/components/track/common/minder/TestCaseMinder.vue index 8be8b5815b..622bf37fc5 100644 --- a/frontend/src/business/components/track/common/minder/TestCaseMinder.vue +++ b/frontend/src/business/components/track/common/minder/TestCaseMinder.vue @@ -28,8 +28,15 @@ import MsModuleMinder from "@/business/components/common/components/MsModuleMind import { getChildNodeId, handleAfterSave, - handleExpandToLevel, handleMinderIssueDelete, handleTestCaseAdd, handTestCaeEdit, isModuleNode, isModuleNodeData, - listenBeforeExecCommand, listenDblclick, + handleExpandToLevel, + handleMinderIssueDelete, + handleTestCaseAdd, + handTestCaeEdit, + isCaseNodeData, + isModuleNode, + isModuleNodeData, + listenBeforeExecCommand, + listenDblclick, listenNodeSelected, loadSelectNodes, priorityDisableCheck, @@ -201,24 +208,25 @@ name: "TestCaseMinder", }, buildSaveParam(root, parent, preNode, nextNode) { let data = root.data; - if (data.resource && data.resource.indexOf(this.$t('api_test.definition.request.case')) > -1) { + if (isCaseNodeData(data)) { this.buildSaveCase(root, parent, preNode, nextNode); } else { let deleteChild = data.deleteChild; - if (deleteChild && deleteChild.length > 0 && data.type === 'node') { + if (deleteChild && deleteChild.length > 0 && isModuleNodeData(data)) { this.deleteNodes.push(...deleteChild); } if (data.type !== 'tmp' && data.changed) { - if (data.contextChanged && data.resource && - (data.resource.indexOf(this.$t('test_track.module.module')) > -1 || data.resource.indexOf("模块") > -1)) { - this.buildSaveModules(root, data, parent); - root.children && root.children.forEach(i => { - if (isModuleNode(i)) { - i.data.changed = true; - i.data.contextChanged = true; // 如果当前节点有变化,下面的模块节点也需要level也可能需要变化 - } - }); + if (isModuleNodeData(data)) { + if (data.contextChanged) { + this.buildSaveModules(root, data, parent); + root.children && root.children.forEach(i => { + if (isModuleNode(i)) { + i.data.changed = true; + i.data.contextChanged = true; // 如果当前节点有变化,下面的模块节点也需要level也可能需要变化 + } + }); + } } else { // 保存临时节点 this.buildExtraNode(data, parent, root); @@ -284,8 +292,7 @@ name: "TestCaseMinder", this.saveModules.push(module); }, buildExtraNode(data, parent, root) { - if (data.type !== 'node' && data.type !== 'tmp' - && parent && parent.type === 'node' && data.changed === true) { + if (data.type !== 'node' && data.type !== 'tmp' && parent && isModuleNodeData(parent.data) && data.changed === true) { // 保存额外信息,只保存模块下的一级子节点 let nodes = this.saveExtraNode[parent.id]; if (!nodes) {