cd-personselector 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.ts ADDED
@@ -0,0 +1,64 @@
1
+ // 用户类型
2
+ export interface User {
3
+ id: number | string
4
+ name: string
5
+ displayName?: string
6
+ phone?: string
7
+ email?: string
8
+ position?: string
9
+ department?: string
10
+ isUser?: boolean
11
+ [key: string]: any
12
+ }
13
+
14
+ // 树节点类型
15
+ export interface TreeNode {
16
+ id: number | string
17
+ name: string
18
+ children?: TreeNode[]
19
+ userCount?: number
20
+ isUser?: boolean
21
+ loaded?: boolean
22
+ [key: string]: any
23
+ }
24
+
25
+ // 组织类型
26
+ export interface Organization {
27
+ id: number | string
28
+ name: string
29
+ displayName?: string
30
+ }
31
+
32
+ // Tab 配置类型
33
+ export interface TabConfig {
34
+ key: string
35
+ name: string
36
+ icon?: string
37
+ tree: TreeNode[]
38
+ }
39
+
40
+ // 组件 Props 类型
41
+ export interface PersonSelectorProps {
42
+ visible: boolean
43
+ tabs?: TabConfig[]
44
+ organizations?: Organization[]
45
+ modelValue?: (number | string)[]
46
+ dialogWidth?: string
47
+ tips?: string
48
+ showSearch?: boolean
49
+ }
50
+
51
+ // 加载用户事件参数
52
+ export interface LoadUsersParams {
53
+ tabKey: string
54
+ nodeId: number | string
55
+ node: any
56
+ callback: (users: User[]) => void
57
+ }
58
+
59
+ // 搜索事件参数
60
+ export interface SearchParams {
61
+ keyword: string
62
+ orgId?: number | string
63
+ callback: (users: User[]) => void
64
+ }