mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 14:16:01 +00:00
perspectives: render simple table
This commit is contained in:
18
packages/datalib/src/PerspectiveDisplay.ts
Normal file
18
packages/datalib/src/PerspectiveDisplay.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { PerspectiveTableNode, PerspectiveTreeNode } from './PerspectiveTreeNode';
|
||||
|
||||
export class PerspectiveDisplayColumn {
|
||||
constructor(public label: string, public field: string) {}
|
||||
}
|
||||
|
||||
export class PerspectiveDisplay {
|
||||
columns: PerspectiveDisplayColumn[] = [];
|
||||
|
||||
constructor(public root: PerspectiveTreeNode, public rows: any[]) {
|
||||
const children = root.childNodes;
|
||||
for (const child of children) {
|
||||
if (child.isChecked) {
|
||||
this.columns.push(new PerspectiveDisplayColumn(child.title, child.codeName));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user