Browse Source

导入工程量清单至项目节相关

MaiXinRong 5 years ago
parent
commit
ebb51fc6f9
2 changed files with 7 additions and 4 deletions
  1. 0 2
      app/base/base_tree_service.js
  2. 7 2
      app/extend/helper.js

+ 0 - 2
app/base/base_tree_service.js

@@ -592,8 +592,6 @@ class TreeService extends Service {
                 const operate = await this._deleteNodeData(mid, s);
             }
             // 选中节点--父节点 只有一个子节点时,应升级is_leaf
-            console.log(childCount);
-            console.log(count);
             if (parent && childCount === count) {
                 const updateParent = {id: parent.id };
                 updateParent[this.setting.isLeaf] = true;

+ 7 - 2
app/extend/helper.js

@@ -698,7 +698,12 @@ module.exports = {
      * @returns {*}
      */
     replaceReturn(str) {
-        return (str && typeof str === 'string') ? str.replace(/[\r\n]/g, '') : str;
+        // return str
+        //     ? (typeof str === 'string') ? str.replace(/[\r\n]/g, '') : str + ''
+        //     : str;
+        return (str && typeof str === 'string')
+            ? str.replace(/[\r\n]/g, '')
+            : !_.isNil(str) ? str + '' : str;
     },
 
     /**
@@ -847,7 +852,7 @@ module.exports = {
         return result;
     },
 
-    logger(error) {
+    log(error) {
         if (error.stack) {
             this.ctx.logger.error(error);
         } else {