|
@@ -27,6 +27,18 @@ export class NodeContext {
|
|
|
return this.tree.data.indexOf(this.ref);
|
|
return this.tree.data.indexOf(this.ref);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 获取树结构展开显示的行号
|
|
|
|
|
+ visualRow(): number {
|
|
|
|
|
+ let row = 0;
|
|
|
|
|
+ for (const n of this.tree.data) {
|
|
|
|
|
+ if (this.ref === n) return row;
|
|
|
|
|
+ if (n.getCtx().visible()) {
|
|
|
|
|
+ row += 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return row;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 节点在相同父节点下的行号
|
|
// 节点在相同父节点下的行号
|
|
|
rowInParent(): number {
|
|
rowInParent(): number {
|
|
|
return this.brothers().indexOf(this.ref);
|
|
return this.brothers().indexOf(this.ref);
|