@blueking/bk-user-selector 0.0.29-beta.1 → 0.0.29-beta.10
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/README.md +19 -18
- package/package.json +1 -1
- package/typings/api/user.d.ts +1 -1
- package/typings/components/selection-popover.vue.d.ts +23 -1
- package/typings/hooks/use-jsonp.d.ts +2 -0
- package/typings/hooks/useTenantData.d.ts +2 -1
- package/typings/hooks/useUserSearch.d.ts +1 -1
- package/vue2/index.es.min.js +296 -293
- package/vue2/index.iife.min.js +337 -301
- package/vue2/index.umd.min.js +296 -293
- package/vue2/vue2.css +25 -25
- package/vue3/index.es.min.js +296 -293
- package/vue3/index.iife.min.js +296 -293
- package/vue3/index.umd.min.js +296 -293
- package/vue3/vue3.css +25 -25
package/README.md
CHANGED
|
@@ -124,24 +124,25 @@ export default {
|
|
|
124
124
|
|
|
125
125
|
### 属性
|
|
126
126
|
|
|
127
|
-
| 参数
|
|
128
|
-
|
|
|
129
|
-
| modelValue / v-model
|
|
130
|
-
| apiBaseUrl
|
|
131
|
-
| tenantId
|
|
132
|
-
| label
|
|
133
|
-
| placeholder
|
|
134
|
-
| multiple
|
|
135
|
-
| draggable
|
|
136
|
-
| exactSearchKey
|
|
137
|
-
| currentUserId
|
|
138
|
-
| userGroup
|
|
139
|
-
| userGroupName
|
|
140
|
-
| emptyText
|
|
141
|
-
| disabled
|
|
142
|
-
| renderTag
|
|
143
|
-
| renderListItem
|
|
144
|
-
| excludeUserIds
|
|
127
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
128
|
+
| --------------------- | ----------------------------------------------------------------------- | ------------------------------ | ------------------ |
|
|
129
|
+
| modelValue / v-model | 绑定值,单选为字符串,多选为数组 | String / Array | '' / [] |
|
|
130
|
+
| apiBaseUrl | API 基础 URL | String | '' |
|
|
131
|
+
| tenantId | 租户 ID | String | '' |
|
|
132
|
+
| label | 文本标签 | String | 人员选择 |
|
|
133
|
+
| placeholder | 占位文本 | String | 请输入人员名称搜索 |
|
|
134
|
+
| multiple | 是否多选 | Boolean | false |
|
|
135
|
+
| draggable | 是否可拖拽(仅多选模式有效) | Boolean | false |
|
|
136
|
+
| exactSearchKey | 精确查找key,可选值为 bk_username、login_name、full_name, 多个以逗号分隔 | String | bk_username |
|
|
137
|
+
| currentUserId | 当前用户ID(用于快速选择"我") | String | '' |
|
|
138
|
+
| userGroup | 用户组列表,用于在下拉列表中显示用户组 | Array | [] |
|
|
139
|
+
| userGroupName | 用户组名称,用于在下拉列表中显示用户组名称 | String | 用户群组 |
|
|
140
|
+
| emptyText | 无匹配人员时的提示文本 | String | 无匹配人员 |
|
|
141
|
+
| disabled | 是否禁用 | Boolean | false |
|
|
142
|
+
| renderTag | 渲染标签 | Function(h, userInfo) => VNode | - |
|
|
143
|
+
| renderListItem | 渲染列表项 | Function(h, userInfo) => VNode | - |
|
|
144
|
+
| excludeUserIds | 排除的用户ID列表 | Array | [] |
|
|
145
|
+
| enableMultiTenantMode | 是否启用多租户模式,关闭后则使用原有用户管理接口查询 | Boolean | true |
|
|
145
146
|
|
|
146
147
|
### 事件
|
|
147
148
|
|
package/package.json
CHANGED
package/typings/api/user.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare const lookupUsers: (params: {
|
|
|
39
39
|
* @param users - API返回的用户列表
|
|
40
40
|
* @returns 格式化后的用户列表
|
|
41
41
|
*/
|
|
42
|
-
export declare const formatUsers: (users: User[]) => FormattedUser[];
|
|
42
|
+
export declare const formatUsers: (users: User[], enableMultiTenantMode?: boolean) => FormattedUser[];
|
|
43
43
|
/**
|
|
44
44
|
* 获取用户列表 兼容旧版本的人员选择器
|
|
45
45
|
* @param url 请求的 URL
|
|
@@ -3,7 +3,18 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { createVNode, VNode } from 'vue';
|
|
5
5
|
import { FormattedUser } from '../types';
|
|
6
|
-
declare
|
|
6
|
+
declare var __VLS_20: {};
|
|
7
|
+
declare var __VLS_inheritedAttrs: {};
|
|
8
|
+
declare const __VLS_refs: {};
|
|
9
|
+
declare const __VLS_templateResult: {
|
|
10
|
+
slots: {
|
|
11
|
+
default?(_: typeof __VLS_20): any;
|
|
12
|
+
};
|
|
13
|
+
refs: __VLS_PickRefsExpose<typeof __VLS_refs>;
|
|
14
|
+
attrs: Partial<typeof __VLS_inheritedAttrs>;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_Slots = typeof __VLS_templateResult['slots'];
|
|
17
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
7
18
|
/**
|
|
8
19
|
* 是否显示下拉菜单
|
|
9
20
|
*/
|
|
@@ -202,4 +213,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
202
213
|
userGroupName: string;
|
|
203
214
|
emptyText: string;
|
|
204
215
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
216
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_Slots>;
|
|
205
217
|
export default _default;
|
|
218
|
+
type __VLS_PickRefsExpose<T> = T extends object ? {
|
|
219
|
+
[K in keyof T]: (T[K] extends any[] ? Parameters<T[K][0]['expose']>[0][] : T[K] extends {
|
|
220
|
+
expose?: (exposed: infer E) => void;
|
|
221
|
+
} ? E : T[K]) | null;
|
|
222
|
+
} : never;
|
|
223
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
224
|
+
new (): {
|
|
225
|
+
$slots: S;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
@@ -7,9 +7,10 @@ import { type Ref } from 'vue';
|
|
|
7
7
|
* 使用租户数据的Hook
|
|
8
8
|
* @param apiBaseUrl - API基础URL
|
|
9
9
|
* @param tenantId - 租户ID
|
|
10
|
+
* @param enableMultiTenantMode - 是否启用多租户模式
|
|
10
11
|
* @returns 租户数据和加载状态
|
|
11
12
|
*/
|
|
12
|
-
export declare const useTenantData: (apiBaseUrl: string, tenantId: string) => {
|
|
13
|
+
export declare const useTenantData: (apiBaseUrl: string, tenantId: string, enableMultiTenantMode?: boolean) => {
|
|
13
14
|
tenants: Ref<Record<string, string>, Record<string, string>>;
|
|
14
15
|
loading: Ref<boolean, boolean>;
|
|
15
16
|
fetchTenants: () => Promise<void>;
|
|
@@ -10,7 +10,7 @@ import { type FormattedUser } from '../types';
|
|
|
10
10
|
* @param tenantId - 租户ID
|
|
11
11
|
* @returns 用户搜索相关状态和方法
|
|
12
12
|
*/
|
|
13
|
-
export declare const useUserSearch: (apiBaseUrl: string, tenantId: string) => {
|
|
13
|
+
export declare const useUserSearch: (apiBaseUrl: string, tenantId: string, enableMultiTenantMode?: boolean) => {
|
|
14
14
|
searchResults: Ref<FormattedUser[], FormattedUser[]>;
|
|
15
15
|
loading: Ref<boolean, boolean>;
|
|
16
16
|
searchQuery: Ref<string, string>;
|