fix(测试跟踪): 脑图提示错误信息后,再次保存会导致用例丢失
--bug=1021999 --user=陈建星 【测试跟踪】github#21368,用例在脑图模式下,将已经带有case的模块B1拖动到新建的非模块脑图分支B2下保存,会导致B1下的用例丢失 https://www.tapd.cn/55049933/s/1328907
This commit is contained in:
parent
35d4160a03
commit
a0eef18f95
|
@ -44,7 +44,7 @@ import {
|
||||||
getChildNodeId,
|
getChildNodeId,
|
||||||
handleAfterSave,
|
handleAfterSave,
|
||||||
handleExpandToLevel,
|
handleExpandToLevel,
|
||||||
handleMinderIssueDelete,
|
handleMinderIssueDelete, handleSaveError,
|
||||||
handleTestCaseAdd,
|
handleTestCaseAdd,
|
||||||
handTestCaeEdit,
|
handTestCaeEdit,
|
||||||
isCaseNodeData,
|
isCaseNodeData,
|
||||||
|
@ -590,6 +590,7 @@ export default {
|
||||||
id: data.id,
|
id: data.id,
|
||||||
resource: data.resource,
|
resource: data.resource,
|
||||||
};
|
};
|
||||||
|
data.originId = data.id;
|
||||||
if (nodeData.id && nodeData.id.length > 20) {
|
if (nodeData.id && nodeData.id.length > 20) {
|
||||||
nodeData.isEdit = true; // 编辑
|
nodeData.isEdit = true; // 编辑
|
||||||
} else {
|
} else {
|
||||||
|
@ -608,6 +609,7 @@ export default {
|
||||||
},
|
},
|
||||||
throwError(tip) {
|
throwError(tip) {
|
||||||
this.$error(tip)
|
this.$error(tip)
|
||||||
|
handleSaveError(window.minder.getRoot());
|
||||||
throw new Error(tip);
|
throw new Error(tip);
|
||||||
},
|
},
|
||||||
tagEditCheck() {
|
tagEditCheck() {
|
||||||
|
|
|
@ -531,6 +531,8 @@ export function handleAfterSave(rootNode) {
|
||||||
rootNode.data.deleteChild = null;
|
rootNode.data.deleteChild = null;
|
||||||
rootNode.data.changed = false;
|
rootNode.data.changed = false;
|
||||||
rootNode.data.contextChanged = false;
|
rootNode.data.contextChanged = false;
|
||||||
|
rootNode.data.originId = null;
|
||||||
|
rootNode.data.isExtraNode = false;
|
||||||
if (isModuleNode(rootNode)) {
|
if (isModuleNode(rootNode)) {
|
||||||
rootNode.data.type = 'node';
|
rootNode.data.type = 'node';
|
||||||
} else if (isCaseNodeData(rootNode.data)) {
|
} 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) {
|
export function getChildNodeId(rootNode, nodeIds) {
|
||||||
//递归获取所有子节点ID
|
//递归获取所有子节点ID
|
||||||
if (rootNode.data.id) {
|
if (rootNode.data.id) {
|
||||||
|
|
Loading…
Reference in New Issue