fix: 新增完模块再改成用例保存报错

This commit is contained in:
chenjianxing 2022-04-24 16:23:58 +08:00 committed by 刘瑞斌
parent be8784d3b5
commit 121a04da51
2 changed files with 6 additions and 1 deletions

View File

@ -336,7 +336,7 @@ name: "TestCaseMinder",
this.throwError(this.$t('test_track.case.minder_all_module_tip'));
}
if (parent.isExtraNode) {
if (parent.isExtraNode && !isModuleNodeData(parent)) {
this.throwError(this.$t('test_track.case.minder_tem_node_tip', [parent.text]));
}

View File

@ -452,6 +452,11 @@ export function handleAfterSave(rootNode) {
rootNode.data.deleteChild = null;
rootNode.data.changed = false;
rootNode.data.contextChanged = false;
if (isModuleNode(rootNode)) {
rootNode.data.type = 'node';
} else if (isCaseNodeData(rootNode.data)) {
rootNode.data.type = 'case';
}
if (rootNode.children) {
for (let i = 0; i < rootNode.children.length; i++) {
handleAfterSave(rootNode.children[i]);