Przeglądaj źródła

项目管理树检查

vian 6 lat temu
rodzic
commit
30ae3aa1d8
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      web/building_saas/pm/js/pm_tree.js

+ 5 - 0
web/building_saas/pm/js/pm_tree.js

@@ -250,6 +250,10 @@ const pmTree = {
                     node.parent.children.splice(iIndex, 1);
                 }
                 sortTreeItems(this);
+                this.sourceData = this.items.reduce((acc, cur) => {
+                    acc.push(cur.data);
+                    return acc;
+                }, []);
             };
 
             Tree.prototype.loadData = function (arrData) {
@@ -319,6 +323,7 @@ const pmTree = {
             };
 
             Tree.prototype.addNodeData = function (data, parent, nextSibling, nodeState = null) {
+                this.sourceData.push(data);
                 var node = null;
                 var pNode = parent ? parent : this._root;
                 if (!nextSibling || (nextSibling.parent === pNode && pNode.childIndex(nextSibling) > -1)) {