Browse Source

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

laiguoran 1 year ago
parent
commit
c313a00995
2 changed files with 5 additions and 4 deletions
  1. 2 2
      app/public/js/path_tree.js
  2. 3 2
      app/public/js/spreadjs_rela/spreadjs_zh.js

+ 2 - 2
app/public/js/path_tree.js

@@ -557,9 +557,9 @@ const createNewPathTree = function (type, setting) {
             const self = this;
             let posterity;
             if (node.full_path !== '') {
-                const reg = new RegExp('^' + node.full_path + '-');
+                const reg = new RegExp('^' + node[self.setting.fullPath] + '-');
                 posterity = this.datas.filter(function (x) {
-                    return reg.test(x.full_path);
+                    return reg.test(x[self.setting.fullPath]);
                 });
             } else {
                 posterity = this._recursiveGetPosterity(node);

+ 3 - 2
app/public/js/spreadjs_rela/spreadjs_zh.js

@@ -1498,17 +1498,18 @@ const SpreadJsObj = {
 
                 const tree = hitinfo.sheet.zh_tree;
                 if (!tree) { return; }
+                const setting = tree.setting;
 
                 const node = tree.nodes[hitinfo.row];
                 if (!node) { return; }
 
-                let centerX = hitinfo.cellRect.x + offset + (node.level - 1) * indent + (node.level) * levelIndent + indent / 2 + xOffset;
+                let centerX = hitinfo.cellRect.x + offset + (node[setting.level] - 1) * indent + (node[setting.level]) * levelIndent + indent / 2 + xOffset;
                 let centerY = (hitinfo.cellRect.y + offset + (hitinfo.cellRect.y + offset + hitinfo.cellRect.height)) / 2;
 
                 // 点击展开节点时,如果已加载子项,则展开,反之这加载子项,展开
                 if (Math.abs(hitinfo.x - centerX) < halfBoxLength && Math.abs(hitinfo.y - centerY) < halfBoxLength) {
                     const children = tree.getChildren(node);
-                    if (!node.expanded && !node.is_leaf && children.length === 0 && tree.loadChildren) {
+                    if (!node.expanded && !node[setting.isLeaf] && children.length === 0 && tree.loadChildren) {
                         tree.loadChildren(node, function () {
                             node.expanded = true;
                             const children = tree.getChildren(node);