@blueking/bk-user-selector 0.0.38-beta.1 → 0.0.38
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/package.json +2 -2
- package/typings/api/user.d.ts +8 -8
- package/typings/components/multiple-selector.vue.d.ts +4 -4
- package/typings/components/selection-popover.vue.d.ts +3 -3
- package/typings/components/single-selector.vue.d.ts +3 -3
- package/typings/components/user-selector.vue.d.ts +4 -4
- package/typings/components/user-tag.vue.d.ts +20 -20
- package/typings/hooks/use-jsonp.d.ts +5 -5
- package/typings/hooks/useUserSearch.d.ts +1 -1
- package/typings/types/index.d.ts +100 -100
- package/typings/utils/common.d.ts +1 -1
- package/vue2/index.es.min.js +196 -54
- package/vue2/index.iife.min.js +196 -54
- package/vue2/index.umd.min.js +196 -54
- package/vue2/vue2.css +39 -39
- package/vue3/index.es.min.js +50 -49
- package/vue3/index.iife.min.js +196 -54
- package/vue3/index.umd.min.js +51 -50
- package/vue3/vue3.css +39 -39
package/package.json
CHANGED
package/typings/api/user.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type User, type Tenant, type FormattedUser } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* 获取本租户所有数据来源的租户信息
|
|
4
4
|
* @param apiBaseUrl - API基础URL
|
|
@@ -15,9 +15,9 @@ export declare const getTenants: (apiBaseUrl: string, tenantId: string) => Promi
|
|
|
15
15
|
*/
|
|
16
16
|
export declare const searchUsers: (params: {
|
|
17
17
|
apiBaseUrl: string;
|
|
18
|
-
enableMultiTenantMode?: boolean;
|
|
19
|
-
keyword: string;
|
|
20
18
|
tenantId: string;
|
|
19
|
+
keyword: string;
|
|
20
|
+
enableMultiTenantMode?: boolean;
|
|
21
21
|
}) => Promise<User[]>;
|
|
22
22
|
/**
|
|
23
23
|
* 批量精准查找用户
|
|
@@ -29,10 +29,10 @@ export declare const searchUsers: (params: {
|
|
|
29
29
|
*/
|
|
30
30
|
export declare const lookupUsers: (params: {
|
|
31
31
|
apiBaseUrl: string;
|
|
32
|
-
enableMultiTenantMode?: boolean;
|
|
33
|
-
exactSearchKey: string;
|
|
34
32
|
tenantId: string;
|
|
33
|
+
exactSearchKey: string;
|
|
35
34
|
usersList: string[];
|
|
35
|
+
enableMultiTenantMode?: boolean;
|
|
36
36
|
}) => Promise<User[]>;
|
|
37
37
|
/**
|
|
38
38
|
* 将API返回的用户数据格式化为组件所需格式
|
|
@@ -47,9 +47,9 @@ export declare const formatUsers: (users: User[], enableMultiTenantMode?: boolea
|
|
|
47
47
|
* @returns 用户列表
|
|
48
48
|
*/
|
|
49
49
|
export declare const getUserList: (url: string, params: {
|
|
50
|
-
|
|
50
|
+
userIds?: string[];
|
|
51
51
|
keyword?: string;
|
|
52
|
-
page?: number;
|
|
53
52
|
pageSize?: number;
|
|
54
|
-
|
|
53
|
+
page?: number;
|
|
54
|
+
appCode?: string;
|
|
55
55
|
}) => Promise<User[]>;
|
|
@@ -22,21 +22,21 @@ declare const _default: import("vue").DefineComponent<MultipleSelectorProps, {},
|
|
|
22
22
|
currentUserId: string;
|
|
23
23
|
tenants: Record<string, string>;
|
|
24
24
|
userGroup: {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
25
27
|
hidden
|
|
26
28
|
/**
|
|
27
29
|
* 多选模式用户选择器组件
|
|
28
30
|
*/
|
|
29
31
|
?: boolean;
|
|
30
|
-
id: string;
|
|
31
|
-
name: string;
|
|
32
32
|
}[];
|
|
33
33
|
userGroupName: string;
|
|
34
34
|
emptyText: string;
|
|
35
35
|
draggable: boolean;
|
|
36
36
|
modelValue: string[];
|
|
37
37
|
selectedUsers: FormattedUser[];
|
|
38
|
-
allowCreate: boolean;
|
|
39
|
-
excludeUserIds: string[];
|
|
40
38
|
placeholder: string;
|
|
39
|
+
excludeUserIds: string[];
|
|
40
|
+
allowCreate: boolean;
|
|
41
41
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
42
|
export default _default;
|
|
@@ -76,9 +76,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
76
76
|
*/
|
|
77
77
|
userGroup: {
|
|
78
78
|
type: () => {
|
|
79
|
-
hidden?: boolean;
|
|
80
79
|
id: string;
|
|
81
80
|
name: string;
|
|
81
|
+
hidden?: boolean;
|
|
82
82
|
}[];
|
|
83
83
|
default: () => never[];
|
|
84
84
|
};
|
|
@@ -167,9 +167,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
167
167
|
*/
|
|
168
168
|
userGroup: {
|
|
169
169
|
type: () => {
|
|
170
|
-
hidden?: boolean;
|
|
171
170
|
id: string;
|
|
172
171
|
name: string;
|
|
172
|
+
hidden?: boolean;
|
|
173
173
|
}[];
|
|
174
174
|
default: () => never[];
|
|
175
175
|
};
|
|
@@ -206,9 +206,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
206
206
|
options: FormattedUser[];
|
|
207
207
|
searchQuery: string;
|
|
208
208
|
userGroup: {
|
|
209
|
-
hidden?: boolean;
|
|
210
209
|
id: string;
|
|
211
210
|
name: string;
|
|
211
|
+
hidden?: boolean;
|
|
212
212
|
}[];
|
|
213
213
|
userGroupName: string;
|
|
214
214
|
emptyText: string;
|
|
@@ -15,18 +15,18 @@ declare const _default: import("vue").DefineComponent<SingleSelectorProps, {}, {
|
|
|
15
15
|
exactSearchKey: string;
|
|
16
16
|
currentUserId: string;
|
|
17
17
|
userGroup: {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
18
20
|
hidden
|
|
19
21
|
/**
|
|
20
22
|
* 单选模式用户选择器组件
|
|
21
23
|
*/
|
|
22
24
|
?: boolean;
|
|
23
|
-
id: string;
|
|
24
|
-
name: string;
|
|
25
25
|
}[];
|
|
26
26
|
userGroupName: string;
|
|
27
27
|
emptyText: string;
|
|
28
28
|
modelValue: string;
|
|
29
|
-
excludeUserIds: string[];
|
|
30
29
|
placeholder: string;
|
|
30
|
+
excludeUserIds: string[];
|
|
31
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
32
32
|
export default _default;
|
|
@@ -21,22 +21,22 @@ declare const _default: import("vue").DefineComponent<UserSelectorProps, {}, {},
|
|
|
21
21
|
currentUserId: string;
|
|
22
22
|
disabled: boolean;
|
|
23
23
|
userGroup: {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
24
26
|
hidden
|
|
25
27
|
/**
|
|
26
28
|
* 蓝鲸用户选择器组件
|
|
27
29
|
* @module components/UserSelector
|
|
28
30
|
*/
|
|
29
31
|
?: boolean;
|
|
30
|
-
id: string;
|
|
31
|
-
name: string;
|
|
32
32
|
}[];
|
|
33
33
|
userGroupName: string;
|
|
34
34
|
emptyText: string;
|
|
35
35
|
draggable: boolean;
|
|
36
36
|
modelValue: string | string[];
|
|
37
|
-
allowCreate: boolean;
|
|
38
|
-
excludeUserIds: string[];
|
|
39
37
|
placeholder: string;
|
|
38
|
+
excludeUserIds: string[];
|
|
39
|
+
allowCreate: boolean;
|
|
40
40
|
multiple: boolean;
|
|
41
41
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
42
|
export default _default;
|
|
@@ -2,9 +2,13 @@ import { createVNode, VNode } from 'vue';
|
|
|
2
2
|
import { FormattedUser } from '../types';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* 用户信息
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
user: FormattedUser;
|
|
8
|
+
/**
|
|
9
|
+
* 租户数据映射
|
|
10
|
+
*/
|
|
11
|
+
tenants: Record<string, string>;
|
|
8
12
|
/**
|
|
9
13
|
* 当前租户ID
|
|
10
14
|
*/
|
|
@@ -14,29 +18,29 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
14
18
|
*/
|
|
15
19
|
draggable?: boolean;
|
|
16
20
|
/**
|
|
17
|
-
*
|
|
21
|
+
* 是否激活状态
|
|
18
22
|
*/
|
|
19
|
-
|
|
23
|
+
active?: boolean;
|
|
20
24
|
/**
|
|
21
25
|
* 是否显示租户信息
|
|
22
26
|
*/
|
|
23
27
|
showTenant?: boolean;
|
|
24
28
|
/**
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
tenants: Record<string, string>;
|
|
28
|
-
/**
|
|
29
|
-
* 用户信息
|
|
29
|
+
* 渲染标签
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
renderTag?: (h: typeof createVNode, userInfo: FormattedUser) => VNode;
|
|
32
32
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
33
33
|
click: (...args: any[]) => void;
|
|
34
34
|
close: (...args: any[]) => void;
|
|
35
35
|
}, string, import("vue").PublicProps, Readonly<{
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* 用户信息
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
user: FormattedUser;
|
|
40
|
+
/**
|
|
41
|
+
* 租户数据映射
|
|
42
|
+
*/
|
|
43
|
+
tenants: Record<string, string>;
|
|
40
44
|
/**
|
|
41
45
|
* 当前租户ID
|
|
42
46
|
*/
|
|
@@ -46,21 +50,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
46
50
|
*/
|
|
47
51
|
draggable?: boolean;
|
|
48
52
|
/**
|
|
49
|
-
*
|
|
53
|
+
* 是否激活状态
|
|
50
54
|
*/
|
|
51
|
-
|
|
55
|
+
active?: boolean;
|
|
52
56
|
/**
|
|
53
57
|
* 是否显示租户信息
|
|
54
58
|
*/
|
|
55
59
|
showTenant?: boolean;
|
|
56
60
|
/**
|
|
57
|
-
*
|
|
58
|
-
*/
|
|
59
|
-
tenants: Record<string, string>;
|
|
60
|
-
/**
|
|
61
|
-
* 用户信息
|
|
61
|
+
* 渲染标签
|
|
62
62
|
*/
|
|
63
|
-
|
|
63
|
+
renderTag?: (h: typeof createVNode, userInfo: FormattedUser) => VNode;
|
|
64
64
|
}> & Readonly<{
|
|
65
65
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
66
66
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { type MaybeRef, type ShallowRef } from 'vue';
|
|
2
2
|
export interface JSONPOptions {
|
|
3
|
-
/** 请求参数 */
|
|
4
|
-
params?: Record<string, string | undefined>;
|
|
5
3
|
/** 超时时间(毫秒),默认为 2 * 60 * 1000 */
|
|
6
4
|
timeout?: number;
|
|
5
|
+
/** 请求参数 */
|
|
6
|
+
params?: Record<string, string | undefined>;
|
|
7
7
|
/** 是否携带凭证(cookie),默认为 true */
|
|
8
8
|
withCredentials?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export interface JSONPResult<T> {
|
|
11
11
|
/** 响应数据 */
|
|
12
|
-
data: ShallowRef<
|
|
13
|
-
/** 错误信息 */
|
|
14
|
-
error: ShallowRef<Error | null>;
|
|
12
|
+
data: ShallowRef<T | null>;
|
|
15
13
|
/** 加载状态 */
|
|
16
14
|
loading: ShallowRef<boolean>;
|
|
15
|
+
/** 错误信息 */
|
|
16
|
+
error: ShallowRef<Error | null>;
|
|
17
17
|
/** 手动触发请求的函数 */
|
|
18
18
|
refetch: () => void;
|
|
19
19
|
}
|
package/typings/types/index.d.ts
CHANGED
|
@@ -1,63 +1,62 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type createVNode } from 'vue';
|
|
2
2
|
import type { VNode } from 'vue';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* 用户对象接口
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
6
|
+
export interface User {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* 用户名
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
bk_username: string;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* 显示名称
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
display_name: string;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* 所属租户ID
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
owner_tenant_id: string;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* 数据源类型
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
data_source_type: string;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* 全名
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
full_name: string;
|
|
27
|
+
/**
|
|
28
|
+
* 登录名, 对应内网企微英文名
|
|
29
|
+
*/
|
|
30
|
+
login_name: string;
|
|
31
|
+
/**
|
|
32
|
+
* 用户名 旧版
|
|
33
|
+
*/
|
|
34
|
+
username: string;
|
|
27
35
|
}
|
|
28
36
|
/**
|
|
29
|
-
*
|
|
37
|
+
* 格式化后的用户信息
|
|
30
38
|
*/
|
|
31
|
-
export interface
|
|
32
|
-
/**
|
|
33
|
-
* 是否支持拖拽排序
|
|
34
|
-
*/
|
|
35
|
-
draggable?: boolean;
|
|
39
|
+
export interface FormattedUser {
|
|
36
40
|
/**
|
|
37
|
-
*
|
|
41
|
+
* 用户ID
|
|
38
42
|
*/
|
|
39
|
-
|
|
43
|
+
id: string;
|
|
40
44
|
/**
|
|
41
|
-
*
|
|
45
|
+
* 用户名称
|
|
42
46
|
*/
|
|
43
|
-
|
|
47
|
+
name: string;
|
|
44
48
|
/**
|
|
45
|
-
*
|
|
49
|
+
* 租户ID
|
|
46
50
|
*/
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* 单选模式属性
|
|
51
|
-
*/
|
|
52
|
-
export interface SingleSelectorProps extends BaseSelectorProps {
|
|
51
|
+
tenantId: string;
|
|
53
52
|
/**
|
|
54
|
-
*
|
|
53
|
+
* 是否隐藏
|
|
55
54
|
*/
|
|
56
|
-
|
|
55
|
+
hidden?: boolean;
|
|
57
56
|
/**
|
|
58
|
-
*
|
|
57
|
+
* 其他属性
|
|
59
58
|
*/
|
|
60
|
-
|
|
59
|
+
[key: string]: boolean | string | undefined;
|
|
61
60
|
}
|
|
62
61
|
/**
|
|
63
62
|
* 租户信息
|
|
@@ -73,118 +72,119 @@ export interface Tenant {
|
|
|
73
72
|
name: string;
|
|
74
73
|
}
|
|
75
74
|
/**
|
|
76
|
-
*
|
|
75
|
+
* 基础选择器属性
|
|
77
76
|
*/
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* 用户名
|
|
81
|
-
*/
|
|
82
|
-
bk_username: string;
|
|
77
|
+
interface BaseSelectorProps {
|
|
83
78
|
/**
|
|
84
|
-
*
|
|
79
|
+
* 接口基础URL
|
|
85
80
|
*/
|
|
86
|
-
|
|
81
|
+
apiBaseUrl: string;
|
|
87
82
|
/**
|
|
88
|
-
*
|
|
83
|
+
* 租户ID
|
|
89
84
|
*/
|
|
90
|
-
|
|
85
|
+
tenantId: string;
|
|
91
86
|
/**
|
|
92
|
-
*
|
|
87
|
+
* 占位文字
|
|
93
88
|
*/
|
|
94
|
-
|
|
89
|
+
placeholder?: string;
|
|
95
90
|
/**
|
|
96
|
-
*
|
|
91
|
+
* 本人ID
|
|
97
92
|
*/
|
|
98
|
-
|
|
93
|
+
currentUserId?: string;
|
|
99
94
|
/**
|
|
100
|
-
*
|
|
95
|
+
* 精确查找key
|
|
101
96
|
*/
|
|
102
|
-
|
|
97
|
+
exactSearchKey?: string;
|
|
103
98
|
/**
|
|
104
|
-
*
|
|
99
|
+
* 用户组配置
|
|
105
100
|
*/
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
export interface UserSelectorProps extends BaseSelectorProps {
|
|
101
|
+
userGroup?: {
|
|
102
|
+
id: string;
|
|
103
|
+
name: string;
|
|
104
|
+
hidden?: boolean;
|
|
105
|
+
}[];
|
|
112
106
|
/**
|
|
113
|
-
*
|
|
107
|
+
* 用户组名称
|
|
114
108
|
*/
|
|
115
|
-
|
|
109
|
+
userGroupName?: string;
|
|
116
110
|
/**
|
|
117
|
-
*
|
|
111
|
+
* 无匹配人员时的提示文本
|
|
118
112
|
*/
|
|
119
|
-
|
|
113
|
+
emptyText?: string;
|
|
120
114
|
/**
|
|
121
|
-
*
|
|
115
|
+
* 是否禁用
|
|
122
116
|
*/
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* 基础选择器属性
|
|
127
|
-
*/
|
|
128
|
-
interface BaseSelectorProps {
|
|
117
|
+
disabled?: boolean;
|
|
129
118
|
/**
|
|
130
|
-
*
|
|
119
|
+
* 渲染列表项
|
|
131
120
|
*/
|
|
132
|
-
|
|
121
|
+
renderListItem?: (h: typeof createVNode, userInfo: FormattedUser) => VNode;
|
|
133
122
|
/**
|
|
134
|
-
*
|
|
123
|
+
* 渲染标签
|
|
135
124
|
*/
|
|
136
|
-
|
|
125
|
+
renderTag?: (h: typeof createVNode, userInfo: FormattedUser) => VNode;
|
|
137
126
|
/**
|
|
138
|
-
*
|
|
127
|
+
* 排除的用户ID列表
|
|
139
128
|
*/
|
|
140
|
-
|
|
129
|
+
excludeUserIds?: string[];
|
|
141
130
|
/**
|
|
142
|
-
*
|
|
131
|
+
* 是否启用多租户模式
|
|
143
132
|
*/
|
|
144
|
-
|
|
133
|
+
enableMultiTenantMode?: boolean;
|
|
145
134
|
/**
|
|
146
|
-
*
|
|
135
|
+
* 是否允许创建用户
|
|
147
136
|
*/
|
|
148
|
-
|
|
137
|
+
allowCreate?: boolean;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* 用户选择器属性
|
|
141
|
+
*/
|
|
142
|
+
export interface UserSelectorProps extends BaseSelectorProps {
|
|
149
143
|
/**
|
|
150
|
-
*
|
|
144
|
+
* 默认选中的用户(单选时为字符串,多选时为数组)
|
|
151
145
|
*/
|
|
152
|
-
|
|
146
|
+
modelValue?: string | string[];
|
|
153
147
|
/**
|
|
154
|
-
*
|
|
148
|
+
* 是否支持拖拽排序
|
|
155
149
|
*/
|
|
156
|
-
|
|
150
|
+
draggable?: boolean;
|
|
157
151
|
/**
|
|
158
|
-
*
|
|
152
|
+
* 是否多选
|
|
159
153
|
*/
|
|
160
|
-
|
|
154
|
+
multiple?: boolean;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* 单选模式属性
|
|
158
|
+
*/
|
|
159
|
+
export interface SingleSelectorProps extends BaseSelectorProps {
|
|
161
160
|
/**
|
|
162
|
-
*
|
|
161
|
+
* 选中的用户ID
|
|
163
162
|
*/
|
|
164
|
-
|
|
163
|
+
modelValue?: string;
|
|
165
164
|
/**
|
|
166
|
-
*
|
|
165
|
+
* 租户信息映射
|
|
167
166
|
*/
|
|
168
|
-
|
|
167
|
+
tenants: Record<string, string>;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* 多选模式属性
|
|
171
|
+
*/
|
|
172
|
+
export interface MultipleSelectorProps extends BaseSelectorProps {
|
|
169
173
|
/**
|
|
170
|
-
*
|
|
174
|
+
* 选中的用户ID列表
|
|
171
175
|
*/
|
|
172
|
-
|
|
176
|
+
modelValue: string[];
|
|
173
177
|
/**
|
|
174
|
-
*
|
|
178
|
+
* 是否支持拖拽排序
|
|
175
179
|
*/
|
|
176
|
-
|
|
180
|
+
draggable?: boolean;
|
|
177
181
|
/**
|
|
178
|
-
*
|
|
182
|
+
* 已选用户列表
|
|
179
183
|
*/
|
|
180
|
-
|
|
184
|
+
selectedUsers: FormattedUser[];
|
|
181
185
|
/**
|
|
182
|
-
*
|
|
186
|
+
* 租户信息映射
|
|
183
187
|
*/
|
|
184
|
-
|
|
185
|
-
hidden?: boolean;
|
|
186
|
-
id: string;
|
|
187
|
-
name: string;
|
|
188
|
-
}[];
|
|
188
|
+
tenants: Record<string, string>;
|
|
189
189
|
}
|
|
190
190
|
export {};
|