|
@@ -60,14 +60,18 @@ class ImportBaseTree {
|
|
|
* @private
|
|
|
*/
|
|
|
_loadTemplateTree(data) {
|
|
|
+ let loadCodeNodes = true;
|
|
|
for (const node of data) {
|
|
|
node.ledger_id = node.template_id;
|
|
|
node.ledger_pid = node.pid;
|
|
|
node.id = this.ctx.app.uuid.v4();
|
|
|
delete node.pid;
|
|
|
- if (node.code) {
|
|
|
+ if (node.code && loadCodeNodes) {
|
|
|
this.codeNodes[node.code] = node;
|
|
|
}
|
|
|
+ if (node.code === '3') {
|
|
|
+ loadCodeNodes = false;
|
|
|
+ }
|
|
|
this.items.push(node);
|
|
|
if (node.ledger_pid === -1) {
|
|
|
this.roots.push(node);
|
|
@@ -228,6 +232,9 @@ class ImportBaseTree {
|
|
|
const numB = _.toNumber(codeB[codeB.length -1]);
|
|
|
return numA - numB;
|
|
|
});
|
|
|
+ for (const [i, c] of firstPart.children.entries()) {
|
|
|
+ c.order = i + 1;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
calculateLeafWithPos () {
|