|  | @@ -225,10 +225,10 @@ $(document).ready(() => {
 | 
	
		
			
				|  |  |          },
 | 
	
		
			
				|  |  |          getDefaultSelectInfo: function (sheet) {
 | 
	
		
			
				|  |  |              const tree = sheet.zh_tree;
 | 
	
		
			
				|  |  | -            if (!tree) return;
 | 
	
		
			
				|  |  | +            if (!tree) return [];
 | 
	
		
			
				|  |  |              const sel = sheet.getSelections()[0];
 | 
	
		
			
				|  |  |              const node = sheet.zh_tree.nodes[sel.row];
 | 
	
		
			
				|  |  | -            if (!node) return;
 | 
	
		
			
				|  |  | +            if (!node) return [];
 | 
	
		
			
				|  |  |              let count = 1;
 | 
	
		
			
				|  |  |              if (sel.rowCount > 1) {
 | 
	
		
			
				|  |  |                  for (let r = 1; r < sel.rowCount; r++) {
 | 
	
	
		
			
				|  | @@ -236,7 +236,7 @@ $(document).ready(() => {
 | 
	
		
			
				|  |  |                      if (rNode.level > node.level) continue;
 | 
	
		
			
				|  |  |                      if ((rNode.level < node.level) || (rNode.level === node.level && rNode.pid !== node.pid)) {
 | 
	
		
			
				|  |  |                          toastr.warning('请选择同一节点下的节点,进行该操作');
 | 
	
		
			
				|  |  | -                        return;
 | 
	
		
			
				|  |  | +                        return [];
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                      count += 1;
 | 
	
		
			
				|  |  |                  }
 | 
	
	
		
			
				|  | @@ -399,29 +399,34 @@ $(document).ready(() => {
 | 
	
		
			
				|  |  |                          return;
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -            // } else if (type === 'up-level') {
 | 
	
		
			
				|  |  | -            //     const parent = tree.getParent(node);
 | 
	
		
			
				|  |  | -            //     const children = parent ? parent.children : tree.children;
 | 
	
		
			
				|  |  | -            //     const index = children.indexOf(node);
 | 
	
		
			
				|  |  | -            //     for (let i = index; i < children.length; i++) {
 | 
	
		
			
				|  |  | -            //         const child = children[index];
 | 
	
		
			
				|  |  | -            //         if (tree.checkNodeUsed(child, pos)) {
 | 
	
		
			
				|  |  | -            //             if (i >= index + count) {
 | 
	
		
			
				|  |  | -            //                 toastr.warning('其后节点已计量,选中的节点不可升级');
 | 
	
		
			
				|  |  | -            //             } else {
 | 
	
		
			
				|  |  | -            //                 toastr.warning('选中的节点已计量,不可升级');
 | 
	
		
			
				|  |  | -            //             }
 | 
	
		
			
				|  |  | -            //             return;
 | 
	
		
			
				|  |  | -            //         }
 | 
	
		
			
				|  |  | -            //     }
 | 
	
		
			
				|  |  | -            } else if (type === 'down-level') {
 | 
	
		
			
				|  |  | +            } else if (type === 'up-level') {
 | 
	
		
			
				|  |  |                  const parent = tree.getParent(node);
 | 
	
		
			
				|  |  |                  const children = parent ? parent.children : tree.children;
 | 
	
		
			
				|  |  |                  const index = children.indexOf(node);
 | 
	
		
			
				|  |  | -                if (index > 0 && children[index-1].used) {
 | 
	
		
			
				|  |  | -                    toastr.warning('其前节点已计量,选中的节点不可降级');
 | 
	
		
			
				|  |  | +                const lastSelect = children[index + count - 1];
 | 
	
		
			
				|  |  | +                if (tree.checkNodeUsed(lastSelect, pos) && (!lastSelect.children || lastSelect.children.length === 0)) {
 | 
	
		
			
				|  |  | +                    toastr.warning('选中的节点已计量,不可升级');
 | 
	
		
			
				|  |  |                      return;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | +                // for (let i = index; i < children.length; i++) {
 | 
	
		
			
				|  |  | +                //     const child = children[index];
 | 
	
		
			
				|  |  | +                //     if (tree.checkNodeUsed(child, pos)) {
 | 
	
		
			
				|  |  | +                //         if (i >= index + count) {
 | 
	
		
			
				|  |  | +                //             toastr.warning('其后节点已计量,选中的节点不可升级');
 | 
	
		
			
				|  |  | +                //         } else {
 | 
	
		
			
				|  |  | +                //             toastr.warning('选中的节点已计量,不可升级');
 | 
	
		
			
				|  |  | +                //         }
 | 
	
		
			
				|  |  | +                //         return;
 | 
	
		
			
				|  |  | +                //     }
 | 
	
		
			
				|  |  | +                // }
 | 
	
		
			
				|  |  | +            } else if (type === 'down-level') {
 | 
	
		
			
				|  |  | +                const parent = tree.getParent(node);
 | 
	
		
			
				|  |  | +                const children = parent ? parent.children : tree.children;
 | 
	
		
			
				|  |  | +                const index = children.indexOf(node);
 | 
	
		
			
				|  |  | +                // if (index > 0 && children[index-1].used) {
 | 
	
		
			
				|  |  | +                //     toastr.warning('其前节点已计量,选中的节点不可降级');
 | 
	
		
			
				|  |  | +                //     return;
 | 
	
		
			
				|  |  | +                // }
 | 
	
		
			
				|  |  |                  for (let i = index; i < count; i++) {
 | 
	
		
			
				|  |  |                      const child = children[i+index];
 | 
	
		
			
				|  |  |                      if (tree.checkNodeUsed(child, pos)) {
 |