Explorar o código

项目管理树展示bug

zhongzewei %!s(int64=6) %!d(string=hai) anos
pai
achega
99647df239
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  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){