fix(测试跟踪): 脑图将用例拖入未加载用例的模块,会产生数据丢失

--bug=1028740 --user=陈建星 【测试跟踪】github#26157,功能用例-》脑图-》修改脑图,移动字节点到其他节点时,展示错误 https://www.tapd.cn/55049933/s/1403966
This commit is contained in:
jianxing 2023-08-15 16:53:49 +08:00 committed by 刘瑞斌
parent 1d6e4ef4a8
commit d707d090bc
2 changed files with 8 additions and 3 deletions

View File

@ -62,7 +62,7 @@ import {
isModuleNodeData, isModuleNodeData,
listenBeforeExecCommand, listenBeforeExecCommand,
listenDblclick, listenDblclick,
listenNodeSelected, listenNodeSelected, loadNode,
loadSelectNodes, loadSelectNodes,
priorityDisableCheck, priorityDisableCheck,
tagEditCheck, tagEditCheck,
@ -276,6 +276,11 @@ export default {
// //
setTimeout(() => setPriorityView(true, 'P'), 100); setTimeout(() => setPriorityView(true, 'P'), 100);
} }
if ('movetoparent' === even.commandName) {
//
loadNode(even.commandArgs[1], this.getParam(), getTestCasesForMinder, null, getMinderExtraNode);
}
}); });
addIssueHotBox(this); addIssueHotBox(this);

View File

@ -411,7 +411,7 @@ function _appendExtraNodes(parent, data) {
} }
/** /**
* 去掉已有节点 * 清理子节点中的tmp节点
* @param parent * @param parent
*/ */
function clearChildren(node) { function clearChildren(node) {
@ -419,7 +419,7 @@ function clearChildren(node) {
if (children) { if (children) {
for (let i = 0; i < children.length; i++) { for (let i = 0; i < children.length; i++) {
let item = children[i]; let item = children[i];
if (item.data.type !== 'node') { if (item.data.type === 'tmp') {
window.minder.removeNode(item); window.minder.removeNode(item);
i--; i--;
} }