Browse Source

项目管理树展示bug

zhongzewei 6 năm trước cách đây
mục cha
commit
99647df239
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  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){