|
@@ -8,7 +8,9 @@ var dbController = {
|
|
btn.attr('doing', 'true');
|
|
btn.attr('doing', 'true');
|
|
if(controller.tree.items.length === 0){
|
|
if(controller.tree.items.length === 0){
|
|
controller.tree.maxNodeID(0);
|
|
controller.tree.maxNodeID(0);
|
|
- let newNodeId = controller.tree.newNodeID();
|
|
|
|
|
|
+ // let newNodeId = controller.tree.newNodeID();
|
|
|
|
+ let newNodeId = uuid.v1();
|
|
|
|
+ console.log(newNodeId);
|
|
let sectionInfo = {first: null, second: null, third: null};
|
|
let sectionInfo = {first: null, second: null, third: null};
|
|
billsAjax.createBills(userAccount, billsLibId, newNodeId, -1 , -1, null, sectionInfo, function(){
|
|
billsAjax.createBills(userAccount, billsLibId, newNodeId, -1 , -1, null, sectionInfo, function(){
|
|
controller.insert();
|
|
controller.insert();
|
|
@@ -24,7 +26,9 @@ var dbController = {
|
|
let node = controller.tree.selected;
|
|
let node = controller.tree.selected;
|
|
if(node){
|
|
if(node){
|
|
var updateId = node.getID(), createpid = node.getParentID(), createnid = node.getNextSiblingID();
|
|
var updateId = node.getID(), createpid = node.getParentID(), createnid = node.getNextSiblingID();
|
|
- let newNodeId = controller.tree.newNodeID();
|
|
|
|
|
|
+ //let newNodeId = controller.tree.newNodeID();
|
|
|
|
+ let newNodeId = uuid.v1();
|
|
|
|
+ console.log(newNodeId);
|
|
let updatePreData = {ID: updateId, NextSiblingID: newNodeId};
|
|
let updatePreData = {ID: updateId, NextSiblingID: newNodeId};
|
|
let sectionInfo = tools.getSectionInfo(node);
|
|
let sectionInfo = tools.getSectionInfo(node);
|
|
billsAjax.createBills(userAccount, billsLibId, newNodeId, createpid, createnid, updatePreData, sectionInfo, function(){
|
|
billsAjax.createBills(userAccount, billsLibId, newNodeId, createpid, createnid, updatePreData, sectionInfo, function(){
|
|
@@ -40,7 +44,9 @@ var dbController = {
|
|
else {
|
|
else {
|
|
let updateNode = controller.tree.roots[controller.tree.roots.length - 1];
|
|
let updateNode = controller.tree.roots[controller.tree.roots.length - 1];
|
|
let updateId = updateNode.getID();
|
|
let updateId = updateNode.getID();
|
|
- let newNodeId = controller.tree.newNodeID();
|
|
|
|
|
|
+ //let newNodeId = controller.tree.newNodeID();
|
|
|
|
+ let newNodeId = uuid.v1();
|
|
|
|
+ console.log(newNodeId);
|
|
let updatePreData = {ID: updateId, NextSiblingID: newNodeId};
|
|
let updatePreData = {ID: updateId, NextSiblingID: newNodeId};
|
|
let sectionInfo = tools.getSectionInfo(node);
|
|
let sectionInfo = tools.getSectionInfo(node);
|
|
billsAjax.createBills(userAccount, billsLibId, newNodeId, -1, -1, updatePreData, sectionInfo, function(){
|
|
billsAjax.createBills(userAccount, billsLibId, newNodeId, -1, -1, updatePreData, sectionInfo, function(){
|