diff --git a/test-track/frontend/src/business/common/minder/TestCaseMinder.vue b/test-track/frontend/src/business/common/minder/TestCaseMinder.vue index 1625fdc07a..d4048e7278 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, + handleMinderIssueDelete, handleSaveError, handleTestCaseAdd, handTestCaeEdit, isCaseNodeData, @@ -590,6 +590,7 @@ export default { id: data.id, resource: data.resource, }; + data.originId = data.id; if (nodeData.id && nodeData.id.length > 20) { nodeData.isEdit = true; // 编辑 } else { @@ -608,6 +609,7 @@ export default { }, throwError(tip) { this.$error(tip) + handleSaveError(window.minder.getRoot()); throw new Error(tip); }, tagEditCheck() { diff --git a/test-track/frontend/src/business/common/minder/minderUtils.js b/test-track/frontend/src/business/common/minder/minderUtils.js index 820cba85f1..1b83d3504f 100644 --- a/test-track/frontend/src/business/common/minder/minderUtils.js +++ b/test-track/frontend/src/business/common/minder/minderUtils.js @@ -531,6 +531,8 @@ export function handleAfterSave(rootNode) { rootNode.data.deleteChild = null; rootNode.data.changed = false; rootNode.data.contextChanged = false; + rootNode.data.originId = null; + rootNode.data.isExtraNode = false; if (isModuleNode(rootNode)) { rootNode.data.type = 'node'; } else if (isCaseNodeData(rootNode.data)) { @@ -543,6 +545,19 @@ export function handleAfterSave(rootNode) { } } +export function handleSaveError(rootNode) { + if (rootNode.data.originId) { + rootNode.data.id = rootNode.data.originId; + } + rootNode.data.originId = null; + rootNode.data.isExtraNode = false; + if (rootNode.children) { + for (let i = 0; i < rootNode.children.length; i++) { + handleSaveError(rootNode.children[i]); + } + } +} + export function getChildNodeId(rootNode, nodeIds) { //递归获取所有子节点ID if (rootNode.data.id) {