forked from OtterMind/Chat2DB
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtree.ts
More file actions
63 lines (58 loc) · 1.48 KB
/
Copy pathtree.ts
File metadata and controls
63 lines (58 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { TreeNodeType, DatabaseTypeCode } from '@/constants';
export interface IExtraParams {
dataSourceId: number;
databaseType: DatabaseTypeCode;
dataSourceName: string;
databaseName?: string;
schemaName?: string;
tableName?: string;
functionName?: string;
procedureName?: string;
triggerName?: string;
}
export interface ITreeNode {
uuid: string;
key: string | number;
name: string;
// 用展示的name
// displayName: string;
treeNodeType: TreeNodeType; // 节点的类型 表、列、文件等等
pretendNodeType?: TreeNodeType; // 伪装的节点类型,当树不连续时,需要用到
isLeaf?: boolean; // 是否为叶子节点
children?: ITreeNode[] | null;
columnType?: string; // 列的类型
extraParams?: IExtraParams;
pinned?: boolean; // 是否置顶
comment?: string; // 表列的注释
loadData?: (params:{refresh: boolean}) => void; // 加载数据的方法
// 父元素
parentNode?: ITreeNode;
level?: number; // 层级
// 是否展开
expanded?: boolean;
parentId?: string;
// 分页
page?: number;
pageSize?: number;
total?: number;
}
// 视图 函数 触发器 过程 通用的返回结果
export interface IRoutines {
name: string; // 名称
comment: string; // 描述
pinned: boolean; // 是否置顶
}
export interface ITable {
/**
* 表描述
*/
comment?: string | null;
/**
* 表名称
*/
name: string | null;
/**
* 是否已经被固定
*/
pinned?: boolean;
}