@blueking/bk-user-selector 0.0.7 → 0.0.9
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 +15 -0
- package/package.json +1 -1
- package/typings/components/multiple-selector.vue.d.ts +47 -168
- package/typings/components/single-selector.vue.d.ts +41 -3
- package/typings/components/user-selector.vue.d.ts +1 -1
- package/typings/types/index.d.ts +21 -0
- package/vue2/index.es.min.js +55 -114
- package/vue2/index.iife.min.js +56 -115
- package/vue2/index.umd.min.js +56 -115
- package/vue2/vue2.css +26 -26
- package/vue3/index.es.min.js +54 -114
- package/vue3/index.iife.min.js +55 -115
- package/vue3/index.umd.min.js +54 -114
- package/vue3/vue3.css +26 -26
package/README.md
CHANGED
|
@@ -71,6 +71,8 @@ import '@blueking/bk-user-selector/vue2/vue2.css';
|
|
|
71
71
|
:exact-search-key="exactSearchKey"
|
|
72
72
|
:multiple="true"
|
|
73
73
|
:draggable="true"
|
|
74
|
+
:user-group="userGroup"
|
|
75
|
+
:user-group-name="userGroupName"
|
|
74
76
|
@change="handleUsersChange"
|
|
75
77
|
/>
|
|
76
78
|
</template>
|
|
@@ -90,6 +92,19 @@ import '@blueking/bk-user-selector/vue2/vue2.css';
|
|
|
90
92
|
const selectedUser = ref('');
|
|
91
93
|
// 多选选中值
|
|
92
94
|
const selectedUsers = ref([]);
|
|
95
|
+
// 用户组
|
|
96
|
+
const userGroup = ref([
|
|
97
|
+
{
|
|
98
|
+
id: '1',
|
|
99
|
+
name: '运维人员',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: '2',
|
|
103
|
+
name: '产品人员',
|
|
104
|
+
},
|
|
105
|
+
]);
|
|
106
|
+
// 用户组名称
|
|
107
|
+
const userGroupName = ref('角色');
|
|
93
108
|
|
|
94
109
|
// 处理单选模式下的值变化
|
|
95
110
|
const handleUserChange = user => {
|
package/package.json
CHANGED
|
@@ -1,171 +1,33 @@
|
|
|
1
|
-
import { FormattedUser } from '../types';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
default: string;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* 是否可拖拽
|
|
19
|
-
*/
|
|
20
|
-
draggable: {
|
|
21
|
-
type: BooleanConstructor;
|
|
22
|
-
default: boolean;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* API 基础 URL
|
|
26
|
-
*/
|
|
27
|
-
apiBaseUrl: {
|
|
28
|
-
type: StringConstructor;
|
|
29
|
-
default: string;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* 租户 ID
|
|
33
|
-
*/
|
|
34
|
-
tenantId: {
|
|
35
|
-
type: StringConstructor;
|
|
36
|
-
default: string;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* 已选用户
|
|
40
|
-
*/
|
|
41
|
-
selectedUsers: {
|
|
42
|
-
type: () => FormattedUser[];
|
|
43
|
-
default: () => never[];
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* 租户信息映射
|
|
47
|
-
*/
|
|
48
|
-
tenants: {
|
|
49
|
-
type: () => Record<string, string>;
|
|
50
|
-
default: () => {};
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* 当前用户ID
|
|
54
|
-
*/
|
|
55
|
-
currentUserId: {
|
|
56
|
-
type: StringConstructor;
|
|
57
|
-
default: string;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* 精确查找key
|
|
61
|
-
*/
|
|
62
|
-
exactSearchKey: {
|
|
63
|
-
type: StringConstructor;
|
|
64
|
-
default: string;
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* 用户组
|
|
68
|
-
*/
|
|
69
|
-
userGroup: {
|
|
70
|
-
type: () => {
|
|
71
|
-
id: string;
|
|
72
|
-
name: string;
|
|
73
|
-
}[];
|
|
74
|
-
default: () => never[];
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* 用户组名称
|
|
78
|
-
*/
|
|
79
|
-
userGroupName: {
|
|
80
|
-
type: StringConstructor;
|
|
81
|
-
default: string;
|
|
82
|
-
};
|
|
83
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
1
|
+
import { FormattedUser, MultipleSelectorProps } from '../types';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<MultipleSelectorProps>, {
|
|
3
|
+
modelValue: () => never[];
|
|
4
|
+
placeholder: string;
|
|
5
|
+
draggable: boolean;
|
|
6
|
+
apiBaseUrl: string;
|
|
7
|
+
tenantId: string;
|
|
8
|
+
selectedUsers: () => never[];
|
|
9
|
+
tenants: () => {};
|
|
10
|
+
currentUserId: string;
|
|
11
|
+
exactSearchKey: string;
|
|
12
|
+
userGroup: () => never[];
|
|
13
|
+
userGroupName: string;
|
|
14
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
84
15
|
"update:selectedUsers": (...args: any[]) => void;
|
|
85
16
|
"add-user": (...args: any[]) => void;
|
|
86
17
|
"remove-user": (...args: any[]) => void;
|
|
87
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
default: string;
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* 是否可拖拽
|
|
104
|
-
*/
|
|
105
|
-
draggable: {
|
|
106
|
-
type: BooleanConstructor;
|
|
107
|
-
default: boolean;
|
|
108
|
-
};
|
|
109
|
-
/**
|
|
110
|
-
* API 基础 URL
|
|
111
|
-
*/
|
|
112
|
-
apiBaseUrl: {
|
|
113
|
-
type: StringConstructor;
|
|
114
|
-
default: string;
|
|
115
|
-
};
|
|
116
|
-
/**
|
|
117
|
-
* 租户 ID
|
|
118
|
-
*/
|
|
119
|
-
tenantId: {
|
|
120
|
-
type: StringConstructor;
|
|
121
|
-
default: string;
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* 已选用户
|
|
125
|
-
*/
|
|
126
|
-
selectedUsers: {
|
|
127
|
-
type: () => FormattedUser[];
|
|
128
|
-
default: () => never[];
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* 租户信息映射
|
|
132
|
-
*/
|
|
133
|
-
tenants: {
|
|
134
|
-
type: () => Record<string, string>;
|
|
135
|
-
default: () => {};
|
|
136
|
-
};
|
|
137
|
-
/**
|
|
138
|
-
* 当前用户ID
|
|
139
|
-
*/
|
|
140
|
-
currentUserId: {
|
|
141
|
-
type: StringConstructor;
|
|
142
|
-
default: string;
|
|
143
|
-
};
|
|
144
|
-
/**
|
|
145
|
-
* 精确查找key
|
|
146
|
-
*/
|
|
147
|
-
exactSearchKey: {
|
|
148
|
-
type: StringConstructor;
|
|
149
|
-
default: string;
|
|
150
|
-
};
|
|
151
|
-
/**
|
|
152
|
-
* 用户组
|
|
153
|
-
*/
|
|
154
|
-
userGroup: {
|
|
155
|
-
type: () => {
|
|
156
|
-
id: string;
|
|
157
|
-
name: string;
|
|
158
|
-
}[];
|
|
159
|
-
default: () => never[];
|
|
160
|
-
};
|
|
161
|
-
/**
|
|
162
|
-
* 用户组名称
|
|
163
|
-
*/
|
|
164
|
-
userGroupName: {
|
|
165
|
-
type: StringConstructor;
|
|
166
|
-
default: string;
|
|
167
|
-
};
|
|
168
|
-
}>> & {
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<MultipleSelectorProps>, {
|
|
19
|
+
modelValue: () => never[];
|
|
20
|
+
placeholder: string;
|
|
21
|
+
draggable: boolean;
|
|
22
|
+
apiBaseUrl: string;
|
|
23
|
+
tenantId: string;
|
|
24
|
+
selectedUsers: () => never[];
|
|
25
|
+
tenants: () => {};
|
|
26
|
+
currentUserId: string;
|
|
27
|
+
exactSearchKey: string;
|
|
28
|
+
userGroup: () => never[];
|
|
29
|
+
userGroupName: string;
|
|
30
|
+
}>>> & {
|
|
169
31
|
"onUpdate:selectedUsers"?: ((...args: any[]) => any) | undefined;
|
|
170
32
|
"onAdd-user"?: ((...args: any[]) => any) | undefined;
|
|
171
33
|
"onRemove-user"?: ((...args: any[]) => any) | undefined;
|
|
@@ -179,10 +41,27 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
179
41
|
}[];
|
|
180
42
|
userGroupName: string;
|
|
181
43
|
draggable: boolean;
|
|
182
|
-
modelValue:
|
|
183
|
-
placeholder: string;
|
|
184
|
-
apiBaseUrl: string;
|
|
44
|
+
modelValue: string[];
|
|
185
45
|
selectedUsers: FormattedUser[];
|
|
46
|
+
apiBaseUrl: string;
|
|
47
|
+
placeholder: string;
|
|
186
48
|
exactSearchKey: string;
|
|
187
49
|
}, {}>;
|
|
188
50
|
export default _default;
|
|
51
|
+
type __VLS_WithDefaults<P, D> = {
|
|
52
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
53
|
+
default: D[K];
|
|
54
|
+
}> : P[K];
|
|
55
|
+
};
|
|
56
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
57
|
+
type __VLS_TypePropsToOption<T> = {
|
|
58
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
59
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
60
|
+
} : {
|
|
61
|
+
type: import('vue').PropType<T[K]>;
|
|
62
|
+
required: true;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
type __VLS_PrettifyLocal<T> = {
|
|
66
|
+
[K in keyof T]: T[K];
|
|
67
|
+
} & {};
|
|
@@ -1,12 +1,47 @@
|
|
|
1
1
|
import { SingleSelectorProps } from '../types';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<SingleSelectorProps>, {
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<SingleSelectorProps>, {
|
|
3
|
+
apiBaseUrl: string;
|
|
4
|
+
tenantId: string;
|
|
5
|
+
placeholder: string;
|
|
6
|
+
modelValue: string;
|
|
7
|
+
currentUserId: string;
|
|
8
|
+
exactSearchKey: string;
|
|
9
|
+
userGroup: () => never[];
|
|
10
|
+
userGroupName: string;
|
|
11
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
12
|
change: (...args: any[]) => void;
|
|
4
13
|
"update:modelValue": (...args: any[]) => void;
|
|
5
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<SingleSelectorProps
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<SingleSelectorProps>, {
|
|
15
|
+
apiBaseUrl: string;
|
|
16
|
+
tenantId: string;
|
|
17
|
+
placeholder: string;
|
|
18
|
+
modelValue: string;
|
|
19
|
+
currentUserId: string;
|
|
20
|
+
exactSearchKey: string;
|
|
21
|
+
userGroup: () => never[];
|
|
22
|
+
userGroupName: string;
|
|
23
|
+
}>>> & {
|
|
6
24
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
7
25
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
8
|
-
}, {
|
|
26
|
+
}, {
|
|
27
|
+
tenantId: string;
|
|
28
|
+
currentUserId: string;
|
|
29
|
+
userGroup: {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
}[];
|
|
33
|
+
userGroupName: string;
|
|
34
|
+
modelValue: string;
|
|
35
|
+
apiBaseUrl: string;
|
|
36
|
+
placeholder: string;
|
|
37
|
+
exactSearchKey: string;
|
|
38
|
+
}, {}>;
|
|
9
39
|
export default _default;
|
|
40
|
+
type __VLS_WithDefaults<P, D> = {
|
|
41
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
42
|
+
default: D[K];
|
|
43
|
+
}> : P[K];
|
|
44
|
+
};
|
|
10
45
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
11
46
|
type __VLS_TypePropsToOption<T> = {
|
|
12
47
|
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
@@ -16,3 +51,6 @@ type __VLS_TypePropsToOption<T> = {
|
|
|
16
51
|
required: true;
|
|
17
52
|
};
|
|
18
53
|
};
|
|
54
|
+
type __VLS_PrettifyLocal<T> = {
|
|
55
|
+
[K in keyof T]: T[K];
|
|
56
|
+
} & {};
|
|
@@ -37,8 +37,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
37
37
|
userGroupName: string;
|
|
38
38
|
draggable: boolean;
|
|
39
39
|
modelValue: string | string[];
|
|
40
|
-
placeholder: string;
|
|
41
40
|
apiBaseUrl: string;
|
|
41
|
+
placeholder: string;
|
|
42
42
|
exactSearchKey: string;
|
|
43
43
|
multiple: boolean;
|
|
44
44
|
}, {}>;
|
package/typings/types/index.d.ts
CHANGED
|
@@ -127,4 +127,25 @@ export interface SingleSelectorProps extends BaseSelectorProps {
|
|
|
127
127
|
*/
|
|
128
128
|
tenants: Record<string, string>;
|
|
129
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* 多选模式属性
|
|
132
|
+
*/
|
|
133
|
+
export interface MultipleSelectorProps extends BaseSelectorProps {
|
|
134
|
+
/**
|
|
135
|
+
* 选中的用户ID列表
|
|
136
|
+
*/
|
|
137
|
+
modelValue: string[];
|
|
138
|
+
/**
|
|
139
|
+
* 是否支持拖拽排序
|
|
140
|
+
*/
|
|
141
|
+
draggable?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* 已选用户列表
|
|
144
|
+
*/
|
|
145
|
+
selectedUsers: FormattedUser[];
|
|
146
|
+
/**
|
|
147
|
+
* 租户信息映射
|
|
148
|
+
*/
|
|
149
|
+
tenants: Record<string, string>;
|
|
150
|
+
}
|
|
130
151
|
export {};
|
package/vue2/index.es.min.js
CHANGED
|
@@ -13638,7 +13638,7 @@ var __webpack_exports__$1 = {};
|
|
|
13638
13638
|
})();
|
|
13639
13639
|
__webpack_exports__$1.bkEllipsis;
|
|
13640
13640
|
__webpack_exports__$1.bkEllipsisInstance;
|
|
13641
|
-
__webpack_exports__$1.bkTooltips;
|
|
13641
|
+
var __webpack_exports__bkTooltips = __webpack_exports__$1.bkTooltips;
|
|
13642
13642
|
var __webpack_exports__clickoutside = __webpack_exports__$1.clickoutside;
|
|
13643
13643
|
__webpack_exports__$1.mousewheel;
|
|
13644
13644
|
__webpack_exports__$1.overflowTitle;
|
|
@@ -16830,9 +16830,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
16830
16830
|
class: "user-group",
|
|
16831
16831
|
key: groupName
|
|
16832
16832
|
}, [
|
|
16833
|
-
|
|
16833
|
+
Object.keys(groupedUsers.value).length > 1 ? (openBlock(), createElementBlock(
|
|
16834
16834
|
"div",
|
|
16835
16835
|
{
|
|
16836
|
+
key: 0,
|
|
16836
16837
|
class: "group-header",
|
|
16837
16838
|
onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
16838
16839
|
}, ["prevent"]))
|
|
@@ -16855,7 +16856,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
16855
16856
|
],
|
|
16856
16857
|
32
|
|
16857
16858
|
/* NEED_HYDRATION */
|
|
16858
|
-
),
|
|
16859
|
+
)) : createCommentVNode("v-if", true),
|
|
16859
16860
|
(openBlock(true), createElementBlock(
|
|
16860
16861
|
Fragment,
|
|
16861
16862
|
null,
|
|
@@ -16900,7 +16901,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
16900
16901
|
};
|
|
16901
16902
|
}
|
|
16902
16903
|
});
|
|
16903
|
-
const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
16904
|
+
const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-13504557"]]);
|
|
16904
16905
|
const _hoisted_1$3 = { class: "tag-content" };
|
|
16905
16906
|
const _hoisted_2$2 = { class: "user-name" };
|
|
16906
16907
|
const _hoisted_3$2 = {
|
|
@@ -16970,83 +16971,17 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
16970
16971
|
},
|
|
16971
16972
|
__name: "multiple-selector",
|
|
16972
16973
|
props: {
|
|
16973
|
-
|
|
16974
|
-
|
|
16975
|
-
|
|
16976
|
-
|
|
16977
|
-
|
|
16978
|
-
|
|
16979
|
-
},
|
|
16980
|
-
|
|
16981
|
-
|
|
16982
|
-
|
|
16983
|
-
|
|
16984
|
-
type: String,
|
|
16985
|
-
default: "请输入人员名称搜索"
|
|
16986
|
-
},
|
|
16987
|
-
/**
|
|
16988
|
-
* 是否可拖拽
|
|
16989
|
-
*/
|
|
16990
|
-
draggable: {
|
|
16991
|
-
type: Boolean,
|
|
16992
|
-
default: false
|
|
16993
|
-
},
|
|
16994
|
-
/**
|
|
16995
|
-
* API 基础 URL
|
|
16996
|
-
*/
|
|
16997
|
-
apiBaseUrl: {
|
|
16998
|
-
type: String,
|
|
16999
|
-
default: ""
|
|
17000
|
-
},
|
|
17001
|
-
/**
|
|
17002
|
-
* 租户 ID
|
|
17003
|
-
*/
|
|
17004
|
-
tenantId: {
|
|
17005
|
-
type: String,
|
|
17006
|
-
default: ""
|
|
17007
|
-
},
|
|
17008
|
-
/**
|
|
17009
|
-
* 已选用户
|
|
17010
|
-
*/
|
|
17011
|
-
selectedUsers: {
|
|
17012
|
-
type: Array,
|
|
17013
|
-
default: () => []
|
|
17014
|
-
},
|
|
17015
|
-
/**
|
|
17016
|
-
* 租户信息映射
|
|
17017
|
-
*/
|
|
17018
|
-
tenants: {
|
|
17019
|
-
type: Object,
|
|
17020
|
-
default: () => ({})
|
|
17021
|
-
},
|
|
17022
|
-
/**
|
|
17023
|
-
* 当前用户ID
|
|
17024
|
-
*/
|
|
17025
|
-
currentUserId: {
|
|
17026
|
-
type: String,
|
|
17027
|
-
default: ""
|
|
17028
|
-
},
|
|
17029
|
-
/**
|
|
17030
|
-
* 精确查找key
|
|
17031
|
-
*/
|
|
17032
|
-
exactSearchKey: {
|
|
17033
|
-
type: String,
|
|
17034
|
-
default: "bk_username"
|
|
17035
|
-
},
|
|
17036
|
-
/**
|
|
17037
|
-
* 用户组
|
|
17038
|
-
*/
|
|
17039
|
-
userGroup: {
|
|
17040
|
-
type: Array,
|
|
17041
|
-
default: () => []
|
|
17042
|
-
},
|
|
17043
|
-
/**
|
|
17044
|
-
* 用户组名称
|
|
17045
|
-
*/
|
|
17046
|
-
userGroupName: {
|
|
17047
|
-
type: String,
|
|
17048
|
-
default: "用户群组"
|
|
17049
|
-
}
|
|
16974
|
+
modelValue: { default: () => [] },
|
|
16975
|
+
draggable: { type: Boolean, default: false },
|
|
16976
|
+
selectedUsers: { default: () => [] },
|
|
16977
|
+
tenants: { default: () => ({}) },
|
|
16978
|
+
apiBaseUrl: { default: "" },
|
|
16979
|
+
tenantId: { default: "" },
|
|
16980
|
+
placeholder: { default: "请输入人员名称搜索" },
|
|
16981
|
+
currentUserId: { default: "" },
|
|
16982
|
+
exactSearchKey: { default: "bk_username" },
|
|
16983
|
+
userGroup: { default: () => [] },
|
|
16984
|
+
userGroupName: { default: "用户群组" }
|
|
17050
16985
|
},
|
|
17051
16986
|
emits: ["update:selectedUsers", "add-user", "remove-user"],
|
|
17052
16987
|
setup(__props, { emit: __emit }) {
|
|
@@ -17309,7 +17244,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
17309
17244
|
(openBlock(true), createElementBlock(
|
|
17310
17245
|
Fragment,
|
|
17311
17246
|
null,
|
|
17312
|
-
renderList(
|
|
17247
|
+
renderList(_ctx.selectedUsers, (user, index) => {
|
|
17313
17248
|
return openBlock(), createElementBlock("div", {
|
|
17314
17249
|
class: "tag-wrapper",
|
|
17315
17250
|
key: user.id,
|
|
@@ -17317,15 +17252,15 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
17317
17252
|
}, [
|
|
17318
17253
|
createVNode(UserTag, {
|
|
17319
17254
|
active: index === activeTagIndex.value,
|
|
17320
|
-
"current-tenant-id":
|
|
17321
|
-
draggable:
|
|
17322
|
-
tenants:
|
|
17255
|
+
"current-tenant-id": _ctx.tenantId,
|
|
17256
|
+
draggable: _ctx.draggable,
|
|
17257
|
+
tenants: _ctx.tenants,
|
|
17323
17258
|
user,
|
|
17324
17259
|
onClick: ($event) => handleTagClick(index),
|
|
17325
17260
|
onClose: ($event) => removeUser(user)
|
|
17326
17261
|
}, null, 8, ["active", "current-tenant-id", "draggable", "tenants", "user", "onClick", "onClose"]),
|
|
17327
17262
|
createCommentVNode(" 在当前激活标签后插入输入框 "),
|
|
17328
|
-
index === activeTagIndex.value && activeTagIndex.value !==
|
|
17263
|
+
index === activeTagIndex.value && activeTagIndex.value !== _ctx.selectedUsers.length - 1 ? withDirectives((openBlock(), createElementBlock(
|
|
17329
17264
|
"input",
|
|
17330
17265
|
{
|
|
17331
17266
|
key: 0,
|
|
@@ -17351,13 +17286,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
17351
17286
|
/* KEYED_FRAGMENT */
|
|
17352
17287
|
)),
|
|
17353
17288
|
createCommentVNode(" 最后一个输入框 "),
|
|
17354
|
-
activeTagIndex.value === -1 || activeTagIndex.value ===
|
|
17289
|
+
activeTagIndex.value === -1 || activeTagIndex.value === _ctx.selectedUsers.length - 1 ? withDirectives((openBlock(), createElementBlock("input", {
|
|
17355
17290
|
key: 0,
|
|
17356
17291
|
ref_key: "lastInputRef",
|
|
17357
17292
|
ref: lastInputRef,
|
|
17358
17293
|
class: "search-input last",
|
|
17359
17294
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(searchQuery) ? searchQuery.value = $event : null),
|
|
17360
|
-
placeholder: !
|
|
17295
|
+
placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
|
|
17361
17296
|
onFocus: handleInputFocus,
|
|
17362
17297
|
onInput: handleInput,
|
|
17363
17298
|
onKeydown: handleKeyDown,
|
|
@@ -17367,8 +17302,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
17367
17302
|
]) : createCommentVNode("v-if", true),
|
|
17368
17303
|
createCommentVNode(' "我"标签 '),
|
|
17369
17304
|
createVNode(MeTag, {
|
|
17370
|
-
"current-user-id":
|
|
17371
|
-
"is-disabled": !!
|
|
17305
|
+
"current-user-id": _ctx.currentUserId,
|
|
17306
|
+
"is-disabled": !!_ctx.currentUserId && _ctx.selectedUsers.some((user) => user.id === _ctx.currentUserId),
|
|
17372
17307
|
onClick: addCurrentUser
|
|
17373
17308
|
}, null, 8, ["current-user-id", "is-disabled"])
|
|
17374
17309
|
],
|
|
@@ -17397,10 +17332,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
17397
17332
|
null,
|
|
17398
17333
|
renderList(visibleUsers.value, (user) => {
|
|
17399
17334
|
return openBlock(), createBlock(UserTag, {
|
|
17400
|
-
"current-tenant-id":
|
|
17335
|
+
"current-tenant-id": _ctx.tenantId,
|
|
17401
17336
|
key: user.id,
|
|
17402
17337
|
"show-tenant": true,
|
|
17403
|
-
tenants:
|
|
17338
|
+
tenants: _ctx.tenants,
|
|
17404
17339
|
user,
|
|
17405
17340
|
onClick: handleFocus,
|
|
17406
17341
|
onClose: ($event) => removeUser(user)
|
|
@@ -17410,7 +17345,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
17410
17345
|
/* KEYED_FRAGMENT */
|
|
17411
17346
|
)),
|
|
17412
17347
|
createCommentVNode(" 显示折叠标签数量 "),
|
|
17413
|
-
hiddenCount.value > 0 ? (openBlock(), createBlock(unref(__webpack_exports__default), {
|
|
17348
|
+
hiddenCount.value > 0 ? withDirectives((openBlock(), createBlock(unref(__webpack_exports__default), {
|
|
17414
17349
|
key: 0,
|
|
17415
17350
|
onClick: withModifiers(handleFocus, ["stop"])
|
|
17416
17351
|
}, {
|
|
@@ -17423,22 +17358,27 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
17423
17358
|
]),
|
|
17424
17359
|
_: 1
|
|
17425
17360
|
/* STABLE */
|
|
17426
|
-
}))
|
|
17361
|
+
})), [
|
|
17362
|
+
[unref(__webpack_exports__bkTooltips), {
|
|
17363
|
+
content: _ctx.selectedUsers.slice(visibleUsers.value.length).map((user) => user.display_name).join(","),
|
|
17364
|
+
placement: "top"
|
|
17365
|
+
}]
|
|
17366
|
+
]) : createCommentVNode("v-if", true),
|
|
17427
17367
|
createCommentVNode(" 搜索输入框 "),
|
|
17428
17368
|
withDirectives(createElementVNode("input", {
|
|
17429
17369
|
ref_key: "collapsedInputRef",
|
|
17430
17370
|
ref: collapsedInputRef,
|
|
17431
17371
|
class: "search-input collapsed",
|
|
17432
17372
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(searchQuery) ? searchQuery.value = $event : null),
|
|
17433
|
-
placeholder: !
|
|
17373
|
+
placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
|
|
17434
17374
|
onFocus: handleFocus
|
|
17435
17375
|
}, null, 40, _hoisted_3$1), [
|
|
17436
17376
|
[vModelText, unref(searchQuery)]
|
|
17437
17377
|
]),
|
|
17438
17378
|
createCommentVNode(' 未聚焦状态下的"我"标签 '),
|
|
17439
17379
|
createVNode(MeTag, {
|
|
17440
|
-
"current-user-id":
|
|
17441
|
-
"is-disabled": !!
|
|
17380
|
+
"current-user-id": _ctx.currentUserId,
|
|
17381
|
+
"is-disabled": !!_ctx.currentUserId && _ctx.selectedUsers.some((user) => user[props2.exactSearchKey] === _ctx.currentUserId),
|
|
17442
17382
|
onClick: addCurrentUser
|
|
17443
17383
|
}, null, 8, ["current-user-id", "is-disabled"])
|
|
17444
17384
|
],
|
|
@@ -17456,10 +17396,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
17456
17396
|
loading: unref(searchLoading),
|
|
17457
17397
|
options: options.value,
|
|
17458
17398
|
"search-query": unref(searchQuery),
|
|
17459
|
-
"tenant-id":
|
|
17460
|
-
tenants:
|
|
17461
|
-
"user-group":
|
|
17462
|
-
"user-group-name":
|
|
17399
|
+
"tenant-id": _ctx.tenantId,
|
|
17400
|
+
tenants: _ctx.tenants,
|
|
17401
|
+
"user-group": _ctx.userGroup,
|
|
17402
|
+
"user-group-name": _ctx.userGroupName,
|
|
17463
17403
|
onSelectUser: addUser
|
|
17464
17404
|
}, null, 8, ["container-width", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
17465
17405
|
])), [
|
|
@@ -17468,8 +17408,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
17468
17408
|
};
|
|
17469
17409
|
}
|
|
17470
17410
|
});
|
|
17471
|
-
const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
17472
|
-
const _withScopeId = (n2) => (pushScopeId("data-v-
|
|
17411
|
+
const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-1a376d26"]]);
|
|
17412
|
+
const _withScopeId = (n2) => (pushScopeId("data-v-3926de45"), n2 = n2(), popScopeId(), n2);
|
|
17473
17413
|
const _hoisted_1$1 = { class: "input-container" };
|
|
17474
17414
|
const _hoisted_2 = {
|
|
17475
17415
|
key: 0,
|
|
@@ -17489,15 +17429,15 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
17489
17429
|
},
|
|
17490
17430
|
__name: "single-selector",
|
|
17491
17431
|
props: {
|
|
17492
|
-
modelValue: {},
|
|
17432
|
+
modelValue: { default: "" },
|
|
17493
17433
|
tenants: {},
|
|
17494
|
-
apiBaseUrl: {},
|
|
17495
|
-
tenantId: {},
|
|
17496
|
-
placeholder: {},
|
|
17497
|
-
currentUserId: {},
|
|
17498
|
-
exactSearchKey: {},
|
|
17499
|
-
userGroup: {},
|
|
17500
|
-
userGroupName: {}
|
|
17434
|
+
apiBaseUrl: { default: "" },
|
|
17435
|
+
tenantId: { default: "" },
|
|
17436
|
+
placeholder: { default: "请输入人员名称搜索" },
|
|
17437
|
+
currentUserId: { default: "" },
|
|
17438
|
+
exactSearchKey: { default: "bk_username" },
|
|
17439
|
+
userGroup: { default: () => [] },
|
|
17440
|
+
userGroupName: { default: "用户群组" }
|
|
17501
17441
|
},
|
|
17502
17442
|
emits: ["update:modelValue", "change"],
|
|
17503
17443
|
setup(__props, { emit: __emit }) {
|
|
@@ -17636,10 +17576,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
17636
17576
|
]),
|
|
17637
17577
|
createCommentVNode(' "我"标签 '),
|
|
17638
17578
|
createVNode(MeTag, {
|
|
17639
|
-
"is-disabled": !!_ctx.currentUserId && !!selectedUserInfo.value && selectedUserInfo.value[_ctx.exactSearchKey || "bk_username"] === _ctx.currentUserId,
|
|
17640
17579
|
"current-user-id": _ctx.currentUserId,
|
|
17580
|
+
"is-disabled": !!_ctx.currentUserId && !!selectedUserInfo.value && selectedUserInfo.value[_ctx.exactSearchKey] === _ctx.currentUserId,
|
|
17641
17581
|
onClick: addCurrentUser
|
|
17642
|
-
}, null, 8, ["
|
|
17582
|
+
}, null, 8, ["current-user-id", "is-disabled"])
|
|
17643
17583
|
]),
|
|
17644
17584
|
createCommentVNode(" 使用新的公共下拉选项组件 "),
|
|
17645
17585
|
createVNode(SelectionPopover, {
|
|
@@ -17660,7 +17600,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
17660
17600
|
};
|
|
17661
17601
|
}
|
|
17662
17602
|
});
|
|
17663
|
-
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
17603
|
+
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-3926de45"]]);
|
|
17664
17604
|
const _hoisted_1 = { class: "bk-user-selector" };
|
|
17665
17605
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17666
17606
|
...{
|
|
@@ -17784,6 +17724,7 @@ const vue2 = {
|
|
|
17784
17724
|
userSelectorInstance = this;
|
|
17785
17725
|
return h$1(BkUserSelector, {
|
|
17786
17726
|
...props2,
|
|
17727
|
+
modelValue: this.modelValue || props2.modelValue,
|
|
17787
17728
|
"onUpdate:modelValue"() {
|
|
17788
17729
|
emit("update:modelValue", ...arguments);
|
|
17789
17730
|
emit("change", ...arguments);
|