chenshilong 6 éve
szülő
commit
1f51207c44

+ 2 - 1
web/building_saas/main/js/views/block_lib.js

@@ -364,6 +364,7 @@ var blockLibObj = {
         return new TreeCell();
     },
     newNode: async function (nodeType, nodeName, categoryID, source){     // 1 分类(只用前两个参数)  2 块文件
+        if (nodeName == '') return;
         let tree = blockLibObj.mainTree;
         let ID = uuid.v1();
         let pID = (nodeType == 2) ? categoryID : -1;
@@ -640,7 +641,7 @@ $(document).ready(function(){    // 这里不需要处理异步:因为不需
 
     $('#btn_block_newFolder_add').on('click', function (){
         let name = $('#input_block_newFolder').val();
-        if (name != '') blockLibObj.newNode(1, name);
+        blockLibObj.newNode(1, name);
     });
 
     $('#btn_block_reName').on('click', function (){

+ 3 - 3
web/building_saas/main/js/views/project_view.js

@@ -3067,10 +3067,10 @@ $(function () {
             async function createRecursion(node){
                 if (!node) return;
 
-                if (calcTools.isLeafBill(node)) createBlock(node);
+                if (calcTools.isLeafBill(node)) await createBlock(node);
 
-                if (node.firstChild()) createRecursion(node.firstChild());
-                if (node.nextSibling) createRecursion(node.nextSibling);
+                if (node.firstChild()) await createRecursion(node.firstChild());
+                if (node.nextSibling) await createRecursion(node.nextSibling);
             };
 
             if (calcTools.isLeafBill(aNode))