瀏覽代碼

项目管理树展示bug

zhongzewei 6 年之前
父節點
當前提交
99647df239
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      web/building_saas/pm/js/pm_tree.js

+ 4 - 1
web/building_saas/pm/js/pm_tree.js

@@ -272,7 +272,10 @@ const pmTree = {
                     }
                     that.maxNodeId(node.id());
                     if(parent.childIndex(node) === -1){
-                        if(pre && parent.childIndex(pre) !== -1){
+                        if (!pre) {
+                            parent.children.unshift(node);
+                        }
+                        else if(pre && parent.childIndex(pre) !== -1){
                             parent.children.splice(parent.childIndex(pre) + 1, 0, node);
                         }
                         else if(next && parent.childIndex(next) !== -1){