浏览代码

ration tuning night

TonyKang 8 年之前
父节点
当前提交
ab70480a87
共有 2 个文件被更改,包括 18 次插入0 次删除
  1. 15 0
      modules/rationRepository/models/rationChapterTree.js
  2. 3 0
      web/rationLibEditor/js/dinge.js

+ 15 - 0
modules/rationRepository/models/rationChapterTree.js

@@ -63,6 +63,21 @@ rationChapterTreeDAO.prototype.tempRationChapterTreeInsert = function(repository
     })
 }
 
+rationChapterTreeDAO.prototype.updateNodes = function(nodes,callback){
+    var functions = [];
+    for (var i=0; i < nodes.length; i++) {
+        functions.push((function(doc) {
+            return function(cb) {
+                doc.save(cb);
+            };
+        })(nodes[i]));
+    }
+    async.parallel(functions, function(err, results) {
+        //console.log(err);
+        //console.log(results);
+    });
+};
+
 rationChapterTreeDAO.prototype.sectionUpsert = function(repositoryName,section,callback){
     var db = dbm.getCfgConnection(repositoryName);
     var rationChapterTreeModel = db.model("rationChapterTrees",rationChapterTreeSchema, "rationChapterTrees");

+ 3 - 0
web/rationLibEditor/js/dinge.js

@@ -116,6 +116,9 @@ function addNewNode(rawNode, callback) {
         }
     })
 };
+function updateNodes(nodes){
+    //
+};
 //保存新增的节点
 function saveNewSection(n){
     var sec={};