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) {