From 273d8113b608c9416aeb081a831d2f57db968ffa Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 31 Jan 2023 14:06:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E8=84=91=E5=9B=BE=E5=A4=8D=E5=88=B6=E7=B2=98=E8=B4=B4=E5=90=8E?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=B1=95=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1022077 --user=陈建星 【测试跟踪】github#21418,用例层级和数量多时,脑图模式复制模块和用例,用例内容展示错乱,并且保存时用例数据不对,只能正确保存复制的模块 https://www.tapd.cn/55049933/s/1329273 --bug=1022098 --user=陈建星 【测试跟踪】github#21428,用例编写时,父模块P下存在子模块S1、S2,将父模块P拷贝到S1下作为子模块,会出现系统内所有用例都会在P-S1-P-S1/S2下出现,删除P也会删除所有用例到回收站 https://www.tapd.cn/55049933/s/1329271 --bug=1022077 --user=陈建星 【测试跟踪】github#21418,用例层级和数量多时,脑图模式复制模块和用例,用例内容展示错乱,并且保存时用例数据不对,只能正确保存复制的模块 https://www.tapd.cn/55049933/s/1329274 --- .../src/business/common/minder/TestCaseMinder.vue | 10 +++++++++- .../src/business/common/minder/minderUtils.js | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/test-track/frontend/src/business/common/minder/TestCaseMinder.vue b/test-track/frontend/src/business/common/minder/TestCaseMinder.vue index d4048e7278..47e408e2ea 100644 --- a/test-track/frontend/src/business/common/minder/TestCaseMinder.vue +++ b/test-track/frontend/src/business/common/minder/TestCaseMinder.vue @@ -44,7 +44,7 @@ import { getChildNodeId, handleAfterSave, handleExpandToLevel, - handleMinderIssueDelete, handleSaveError, + handleMinderIssueDelete, handlePasteAfter, handleSaveError, handleTestCaseAdd, handTestCaeEdit, isCaseNodeData, @@ -229,6 +229,10 @@ export default { this.setIsChange(true); } + if ('paste' === even.commandName) { + handlePasteAfter(window.minder.getSelectedNode()); + } + if ('removenode' === even.commandName) { let nodes = window.minder.getSelectedNodes(); if (nodes) { @@ -289,6 +293,10 @@ export default { data: this.saveExtraNode, } } + + // 过滤为空的id + param.ids = param.ids.filter(id => id); + this.result.loading = true; testCaseMinderEdit(param) .then(() => { diff --git a/test-track/frontend/src/business/common/minder/minderUtils.js b/test-track/frontend/src/business/common/minder/minderUtils.js index 1b83d3504f..eca538ef14 100644 --- a/test-track/frontend/src/business/common/minder/minderUtils.js +++ b/test-track/frontend/src/business/common/minder/minderUtils.js @@ -558,6 +558,20 @@ export function handleSaveError(rootNode) { } } +export function handlePasteAfter(rootNode) { + if (rootNode.data.type === 'tmp') { + window.minder.removeNode(rootNode); + return; + } + // 粘贴的节点视为已加载,不查询下面的用例 + rootNode.data.loaded = true; + if (rootNode.children) { + for (let i = 0; i < rootNode.children.length; i++) { + handlePasteAfter(rootNode.children[i]); + } + } +} + export function getChildNodeId(rootNode, nodeIds) { //递归获取所有子节点ID if (rootNode.data.id) {