fix(测试跟踪): 脑图复制粘贴后数据展示错误

--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
This commit is contained in:
chenjianxing 2023-01-31 14:06:55 +08:00 committed by jianxing
parent 8d173a5513
commit 5cdd721f56
2 changed files with 23 additions and 1 deletions

View File

@ -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(() => {

View File

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