|
@@ -11,11 +11,11 @@ $(document).ready(function() {
|
|
|
calculateFolder: function(node) {
|
|
|
node.tp_cache = {};
|
|
|
for (const c of node.children) {
|
|
|
+ if (!c.tp_cache) continue;
|
|
|
for (const prop in c.tp_cache) {
|
|
|
node.tp_cache[prop] = ZhCalc.add(node.tp_cache[prop], c.tp_cache[prop]);
|
|
|
}
|
|
|
}
|
|
|
- console.log(node.name, node.tp_cache);
|
|
|
},
|
|
|
calculateSubProject: function(node) {
|
|
|
node.tp_cache.gather_tp = ZhCalc.sum([node.tp_cache.contract_tp, node.tp_cache.qc_tp, node.tp_cache.pc_tp]);
|
|
@@ -34,7 +34,11 @@ $(document).ready(function() {
|
|
|
}
|
|
|
this.calculateFolder(node);
|
|
|
} else {
|
|
|
- this.calculateSubProject(node);
|
|
|
+ if (node.is_folder) {
|
|
|
+ this.calculateFolder(node)
|
|
|
+ } else {
|
|
|
+ this.calculateSubProject(node);
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
calculateAll: function() {
|