@blueking/bk-user-selector 0.0.11 → 0.0.13
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 +17 -16
- package/package.json +1 -1
- package/typings/components/multiple-selector.vue.d.ts +3 -0
- package/typings/components/selection-popover.vue.d.ts +15 -0
- package/typings/components/single-selector.vue.d.ts +3 -0
- package/typings/components/user-selector.vue.d.ts +3 -0
- package/typings/types/index.d.ts +4 -0
- package/vue2/index.es.min.js +233 -200
- package/vue2/index.iife.min.js +234 -201
- package/vue2/index.umd.min.js +234 -201
- package/vue2/vue2.css +26 -26
- package/vue3/index.es.min.js +233 -200
- package/vue3/index.iife.min.js +234 -201
- package/vue3/index.umd.min.js +234 -201
- package/vue3/vue3.css +26 -26
package/vue3/index.es.min.js
CHANGED
|
@@ -3092,6 +3092,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3092
3092
|
userGroupName: {
|
|
3093
3093
|
type: String,
|
|
3094
3094
|
default: "用户群组"
|
|
3095
|
+
},
|
|
3096
|
+
/**
|
|
3097
|
+
* 无匹配人员时的提示文本
|
|
3098
|
+
*/
|
|
3099
|
+
emptyText: {
|
|
3100
|
+
type: String,
|
|
3101
|
+
default: "无匹配人员"
|
|
3095
3102
|
}
|
|
3096
3103
|
},
|
|
3097
3104
|
emits: ["select-user"],
|
|
@@ -3141,7 +3148,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3141
3148
|
createElementVNode(
|
|
3142
3149
|
"span",
|
|
3143
3150
|
null,
|
|
3144
|
-
toDisplayString(__props.searchQuery.length > 1 ?
|
|
3151
|
+
toDisplayString(__props.searchQuery.length > 1 ? __props.emptyText : "请至少输入2个字符搜索"),
|
|
3145
3152
|
1
|
|
3146
3153
|
/* TEXT */
|
|
3147
3154
|
)
|
|
@@ -3192,7 +3199,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3192
3199
|
createElementVNode(
|
|
3193
3200
|
"span",
|
|
3194
3201
|
null,
|
|
3195
|
-
toDisplayString(user.name),
|
|
3202
|
+
toDisplayString(user.login_name) + "(" + toDisplayString(user.name) + ")",
|
|
3196
3203
|
1
|
|
3197
3204
|
/* TEXT */
|
|
3198
3205
|
),
|
|
@@ -3224,7 +3231,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3224
3231
|
};
|
|
3225
3232
|
}
|
|
3226
3233
|
});
|
|
3227
|
-
const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
3234
|
+
const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-8cd452d0"]]);
|
|
3228
3235
|
const _hoisted_1$3 = { class: "tag-content" };
|
|
3229
3236
|
const _hoisted_2$2 = { class: "user-name" };
|
|
3230
3237
|
const _hoisted_3$2 = {
|
|
@@ -3304,7 +3311,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3304
3311
|
currentUserId: { default: "" },
|
|
3305
3312
|
exactSearchKey: { default: "bk_username" },
|
|
3306
3313
|
userGroup: { default: () => [] },
|
|
3307
|
-
userGroupName: { default: "用户群组" }
|
|
3314
|
+
userGroupName: { default: "用户群组" },
|
|
3315
|
+
emptyText: { default: "无匹配人员" }
|
|
3308
3316
|
},
|
|
3309
3317
|
emits: ["update:selectedUsers", "add-user", "remove-user"],
|
|
3310
3318
|
setup(__props, { emit: __emit }) {
|
|
@@ -3381,7 +3389,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3381
3389
|
}
|
|
3382
3390
|
});
|
|
3383
3391
|
};
|
|
3384
|
-
const handleClickOutside = () => {
|
|
3392
|
+
const handleClickOutside = ({ event }) => {
|
|
3393
|
+
event.stopPropagation();
|
|
3394
|
+
const target = event.target;
|
|
3395
|
+
const container = containerRef.value;
|
|
3396
|
+
if ((container == null ? void 0 : container.contains(target)) || container === target) {
|
|
3397
|
+
return;
|
|
3398
|
+
}
|
|
3385
3399
|
isFocused.value = false;
|
|
3386
3400
|
showDropdown.value = false;
|
|
3387
3401
|
activeTagIndex.value = -1;
|
|
@@ -3446,7 +3460,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3446
3460
|
const pastedText = ((_a = event.clipboardData) == null ? void 0 : _a.getData("text")) || "";
|
|
3447
3461
|
if (pastedText.trim()) {
|
|
3448
3462
|
try {
|
|
3449
|
-
const
|
|
3463
|
+
const usersList = pastedText.trim().split(/[,,;\n\s]+/).filter(Boolean);
|
|
3464
|
+
const users = usersList.map((user) => user.trim().replace(/\s*\(.*?\)\s*/, "")).filter((user) => user);
|
|
3450
3465
|
const result = await lookupUsers(props.apiBaseUrl, props.tenantId, props.exactSearchKey, users);
|
|
3451
3466
|
const formattedUsers = formatUsers(result);
|
|
3452
3467
|
if (formattedUsers.length > 0) {
|
|
@@ -3490,7 +3505,14 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3490
3505
|
emit("add-user", user);
|
|
3491
3506
|
}
|
|
3492
3507
|
searchQuery.value = "";
|
|
3493
|
-
|
|
3508
|
+
setTimeout(() => {
|
|
3509
|
+
showDropdown.value = false;
|
|
3510
|
+
}, 220);
|
|
3511
|
+
nextTick(() => {
|
|
3512
|
+
if (lastInputRef.value) {
|
|
3513
|
+
lastInputRef.value.focus();
|
|
3514
|
+
}
|
|
3515
|
+
});
|
|
3494
3516
|
};
|
|
3495
3517
|
const removeUser = (user) => {
|
|
3496
3518
|
if (!(user == null ? void 0 : user.id)) return;
|
|
@@ -3539,200 +3561,206 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3539
3561
|
});
|
|
3540
3562
|
});
|
|
3541
3563
|
return (_ctx, _cache) => {
|
|
3542
|
-
return
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3564
|
+
return openBlock(), createElementBlock(
|
|
3565
|
+
"div",
|
|
3566
|
+
{
|
|
3567
|
+
ref_key: "containerRef",
|
|
3568
|
+
ref: containerRef,
|
|
3569
|
+
class: "multiple-selector"
|
|
3570
|
+
},
|
|
3571
|
+
[
|
|
3572
|
+
createCommentVNode(" 聚焦状态 - 可编辑模式 "),
|
|
3573
|
+
isFocused.value ? (openBlock(), createElementBlock(
|
|
3574
|
+
"div",
|
|
3575
|
+
{
|
|
3576
|
+
key: 0,
|
|
3577
|
+
ref_key: "tagsContainerRef",
|
|
3578
|
+
ref: tagsContainerRef,
|
|
3579
|
+
class: "tags-container focused",
|
|
3580
|
+
onClick: withModifiers(handleContainerClick, ["stop"])
|
|
3581
|
+
},
|
|
3582
|
+
[
|
|
3583
|
+
createCommentVNode(" 用户标签列表 "),
|
|
3584
|
+
createElementVNode(
|
|
3585
|
+
"div",
|
|
3586
|
+
{
|
|
3587
|
+
ref_key: "sortableContainerRef",
|
|
3588
|
+
ref: sortableContainerRef,
|
|
3589
|
+
class: "tag-list"
|
|
3590
|
+
},
|
|
3591
|
+
[
|
|
3592
|
+
(openBlock(true), createElementBlock(
|
|
3593
|
+
Fragment,
|
|
3594
|
+
null,
|
|
3595
|
+
renderList(_ctx.selectedUsers, (user, index) => {
|
|
3596
|
+
return openBlock(), createElementBlock("div", {
|
|
3597
|
+
class: "tag-wrapper",
|
|
3598
|
+
key: user.id,
|
|
3599
|
+
onClick: withModifiers(($event) => handleTagClick(index), ["stop"])
|
|
3600
|
+
}, [
|
|
3601
|
+
createVNode(UserTag, {
|
|
3602
|
+
active: index === activeTagIndex.value,
|
|
3603
|
+
"current-tenant-id": _ctx.tenantId,
|
|
3604
|
+
draggable: _ctx.draggable,
|
|
3605
|
+
tenants: _ctx.tenants,
|
|
3606
|
+
user,
|
|
3607
|
+
onClick: ($event) => handleTagClick(index),
|
|
3608
|
+
onClose: ($event) => removeUser(user)
|
|
3609
|
+
}, null, 8, ["active", "current-tenant-id", "draggable", "tenants", "user", "onClick", "onClose"]),
|
|
3610
|
+
createCommentVNode(" 在当前激活标签后插入输入框 "),
|
|
3611
|
+
index === activeTagIndex.value && activeTagIndex.value !== _ctx.selectedUsers.length - 1 ? withDirectives((openBlock(), createElementBlock(
|
|
3612
|
+
"input",
|
|
3613
|
+
{
|
|
3614
|
+
key: 0,
|
|
3615
|
+
ref_for: true,
|
|
3616
|
+
ref_key: "inlineInputRef",
|
|
3617
|
+
ref: inlineInputRef,
|
|
3618
|
+
class: "search-input inline",
|
|
3619
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(searchQuery) ? searchQuery.value = $event : null),
|
|
3620
|
+
onFocus: handleInputFocus,
|
|
3621
|
+
onInput: handleInput,
|
|
3622
|
+
onKeydown: handleKeyDown,
|
|
3623
|
+
onPaste: handlePaste
|
|
3624
|
+
},
|
|
3625
|
+
null,
|
|
3626
|
+
544
|
|
3627
|
+
/* NEED_HYDRATION, NEED_PATCH */
|
|
3628
|
+
)), [
|
|
3629
|
+
[vModelText, unref(searchQuery)]
|
|
3630
|
+
]) : createCommentVNode("v-if", true)
|
|
3631
|
+
], 8, _hoisted_1$2);
|
|
3632
|
+
}),
|
|
3633
|
+
128
|
|
3634
|
+
/* KEYED_FRAGMENT */
|
|
3635
|
+
)),
|
|
3636
|
+
createCommentVNode(" 最后一个输入框 "),
|
|
3637
|
+
activeTagIndex.value === -1 || activeTagIndex.value === _ctx.selectedUsers.length - 1 ? withDirectives((openBlock(), createElementBlock("input", {
|
|
3638
|
+
key: 0,
|
|
3639
|
+
ref_key: "lastInputRef",
|
|
3640
|
+
ref: lastInputRef,
|
|
3641
|
+
class: "search-input last",
|
|
3642
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(searchQuery) ? searchQuery.value = $event : null),
|
|
3643
|
+
placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
|
|
3644
|
+
onFocus: handleInputFocus,
|
|
3645
|
+
onInput: handleInput,
|
|
3646
|
+
onKeydown: handleKeyDown,
|
|
3647
|
+
onPaste: handlePaste
|
|
3648
|
+
}, null, 40, _hoisted_2$1)), [
|
|
3649
|
+
[vModelText, unref(searchQuery)]
|
|
3650
|
+
]) : createCommentVNode("v-if", true),
|
|
3651
|
+
createCommentVNode(' "我"标签 '),
|
|
3652
|
+
createVNode(MeTag, {
|
|
3653
|
+
"current-user-id": _ctx.currentUserId,
|
|
3654
|
+
"is-disabled": !!_ctx.currentUserId && _ctx.selectedUsers.some((user) => user.id === _ctx.currentUserId),
|
|
3655
|
+
onClick: addCurrentUser
|
|
3656
|
+
}, null, 8, ["current-user-id", "is-disabled"])
|
|
3657
|
+
],
|
|
3658
|
+
512
|
|
3659
|
+
/* NEED_PATCH */
|
|
3660
|
+
)
|
|
3661
|
+
],
|
|
3662
|
+
512
|
|
3663
|
+
/* NEED_PATCH */
|
|
3664
|
+
)) : (openBlock(), createElementBlock(
|
|
3665
|
+
Fragment,
|
|
3666
|
+
{ key: 1 },
|
|
3667
|
+
[
|
|
3668
|
+
createCommentVNode(" 未聚焦状态 - 只读展示模式 "),
|
|
3669
|
+
createElementVNode(
|
|
3670
|
+
"div",
|
|
3671
|
+
{
|
|
3672
|
+
ref_key: "collapsedContainerRef",
|
|
3673
|
+
ref: collapsedContainerRef,
|
|
3674
|
+
class: "tags-container collapsed",
|
|
3675
|
+
onClick: withModifiers(handleFocus, ["stop"])
|
|
3676
|
+
},
|
|
3677
|
+
[
|
|
3678
|
+
(openBlock(true), createElementBlock(
|
|
3679
|
+
Fragment,
|
|
3680
|
+
null,
|
|
3681
|
+
renderList(visibleUsers.value, (user) => {
|
|
3682
|
+
return openBlock(), createBlock(UserTag, {
|
|
3578
3683
|
"current-tenant-id": _ctx.tenantId,
|
|
3579
|
-
|
|
3684
|
+
key: user.id,
|
|
3685
|
+
"show-tenant": true,
|
|
3580
3686
|
tenants: _ctx.tenants,
|
|
3581
3687
|
user,
|
|
3582
|
-
onClick:
|
|
3688
|
+
onClick: handleFocus,
|
|
3583
3689
|
onClose: ($event) => removeUser(user)
|
|
3584
|
-
}, null, 8, ["
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
onFocus: handleInputFocus,
|
|
3620
|
-
onInput: handleInput,
|
|
3621
|
-
onKeydown: handleKeyDown,
|
|
3622
|
-
onPaste: handlePaste
|
|
3623
|
-
}, null, 40, _hoisted_2$1)), [
|
|
3624
|
-
[vModelText, unref(searchQuery)]
|
|
3625
|
-
]) : createCommentVNode("v-if", true),
|
|
3626
|
-
createCommentVNode(' "我"标签 '),
|
|
3627
|
-
createVNode(MeTag, {
|
|
3628
|
-
"current-user-id": _ctx.currentUserId,
|
|
3629
|
-
"is-disabled": !!_ctx.currentUserId && _ctx.selectedUsers.some((user) => user.id === _ctx.currentUserId),
|
|
3630
|
-
onClick: addCurrentUser
|
|
3631
|
-
}, null, 8, ["current-user-id", "is-disabled"])
|
|
3632
|
-
],
|
|
3633
|
-
512
|
|
3634
|
-
/* NEED_PATCH */
|
|
3635
|
-
)
|
|
3636
|
-
],
|
|
3637
|
-
512
|
|
3638
|
-
/* NEED_PATCH */
|
|
3639
|
-
)) : (openBlock(), createElementBlock(
|
|
3640
|
-
Fragment,
|
|
3641
|
-
{ key: 1 },
|
|
3642
|
-
[
|
|
3643
|
-
createCommentVNode(" 未聚焦状态 - 只读展示模式 "),
|
|
3644
|
-
createElementVNode(
|
|
3645
|
-
"div",
|
|
3646
|
-
{
|
|
3647
|
-
ref_key: "collapsedContainerRef",
|
|
3648
|
-
ref: collapsedContainerRef,
|
|
3649
|
-
class: "tags-container collapsed",
|
|
3650
|
-
onClick: withModifiers(handleFocus, ["stop"])
|
|
3651
|
-
},
|
|
3652
|
-
[
|
|
3653
|
-
(openBlock(true), createElementBlock(
|
|
3654
|
-
Fragment,
|
|
3655
|
-
null,
|
|
3656
|
-
renderList(visibleUsers.value, (user) => {
|
|
3657
|
-
return openBlock(), createBlock(UserTag, {
|
|
3658
|
-
"current-tenant-id": _ctx.tenantId,
|
|
3659
|
-
key: user.id,
|
|
3660
|
-
"show-tenant": true,
|
|
3661
|
-
tenants: _ctx.tenants,
|
|
3662
|
-
user,
|
|
3663
|
-
onClick: handleFocus,
|
|
3664
|
-
onClose: ($event) => removeUser(user)
|
|
3665
|
-
}, null, 8, ["current-tenant-id", "tenants", "user", "onClose"]);
|
|
3666
|
-
}),
|
|
3667
|
-
128
|
|
3668
|
-
/* KEYED_FRAGMENT */
|
|
3669
|
-
)),
|
|
3670
|
-
createCommentVNode(" 显示折叠标签数量 "),
|
|
3671
|
-
hiddenCount.value > 0 ? withDirectives((openBlock(), createBlock(unref(Tag), {
|
|
3672
|
-
key: 0,
|
|
3673
|
-
onClick: withModifiers(handleFocus, ["stop"])
|
|
3674
|
-
}, {
|
|
3675
|
-
default: withCtx(() => [
|
|
3676
|
-
createTextVNode(
|
|
3677
|
-
" +" + toDisplayString(hiddenCount.value),
|
|
3678
|
-
1
|
|
3679
|
-
/* TEXT */
|
|
3680
|
-
)
|
|
3690
|
+
}, null, 8, ["current-tenant-id", "tenants", "user", "onClose"]);
|
|
3691
|
+
}),
|
|
3692
|
+
128
|
|
3693
|
+
/* KEYED_FRAGMENT */
|
|
3694
|
+
)),
|
|
3695
|
+
createCommentVNode(" 显示折叠标签数量 "),
|
|
3696
|
+
hiddenCount.value > 0 ? withDirectives((openBlock(), createBlock(unref(Tag), {
|
|
3697
|
+
key: 0,
|
|
3698
|
+
onClick: withModifiers(handleFocus, ["stop"])
|
|
3699
|
+
}, {
|
|
3700
|
+
default: withCtx(() => [
|
|
3701
|
+
createTextVNode(
|
|
3702
|
+
" +" + toDisplayString(hiddenCount.value),
|
|
3703
|
+
1
|
|
3704
|
+
/* TEXT */
|
|
3705
|
+
)
|
|
3706
|
+
]),
|
|
3707
|
+
_: 1
|
|
3708
|
+
/* STABLE */
|
|
3709
|
+
})), [
|
|
3710
|
+
[unref(bkTooltips), {
|
|
3711
|
+
content: _ctx.selectedUsers.slice(visibleUsers.value.length).map((user) => user.display_name).join(","),
|
|
3712
|
+
placement: "top"
|
|
3713
|
+
}]
|
|
3714
|
+
]) : createCommentVNode("v-if", true),
|
|
3715
|
+
createCommentVNode(" 搜索输入框 "),
|
|
3716
|
+
withDirectives(createElementVNode("input", {
|
|
3717
|
+
ref_key: "collapsedInputRef",
|
|
3718
|
+
ref: collapsedInputRef,
|
|
3719
|
+
class: "search-input collapsed",
|
|
3720
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(searchQuery) ? searchQuery.value = $event : null),
|
|
3721
|
+
placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
|
|
3722
|
+
onFocus: handleFocus
|
|
3723
|
+
}, null, 40, _hoisted_3$1), [
|
|
3724
|
+
[vModelText, unref(searchQuery)]
|
|
3681
3725
|
]),
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
createCommentVNode(" 下拉选项列表 "),
|
|
3716
|
-
createVNode(SelectionPopover, {
|
|
3717
|
-
"container-width": containerRef.value ? containerRef.value.offsetWidth : "auto",
|
|
3718
|
-
"is-show": showDropdown.value,
|
|
3719
|
-
loading: unref(searchLoading),
|
|
3720
|
-
options: options.value,
|
|
3721
|
-
"search-query": unref(searchQuery),
|
|
3722
|
-
"tenant-id": _ctx.tenantId,
|
|
3723
|
-
tenants: _ctx.tenants,
|
|
3724
|
-
"user-group": _ctx.userGroup,
|
|
3725
|
-
"user-group-name": _ctx.userGroupName,
|
|
3726
|
-
onSelectUser: addUser
|
|
3727
|
-
}, null, 8, ["container-width", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
3728
|
-
])), [
|
|
3729
|
-
[unref(clickoutside), handleClickOutside]
|
|
3730
|
-
]);
|
|
3726
|
+
createCommentVNode(' 未聚焦状态下的"我"标签 '),
|
|
3727
|
+
createVNode(MeTag, {
|
|
3728
|
+
"current-user-id": _ctx.currentUserId,
|
|
3729
|
+
"is-disabled": !!_ctx.currentUserId && _ctx.selectedUsers.some((user) => user[props.exactSearchKey] === _ctx.currentUserId),
|
|
3730
|
+
onClick: addCurrentUser
|
|
3731
|
+
}, null, 8, ["current-user-id", "is-disabled"])
|
|
3732
|
+
],
|
|
3733
|
+
512
|
|
3734
|
+
/* NEED_PATCH */
|
|
3735
|
+
)
|
|
3736
|
+
],
|
|
3737
|
+
2112
|
|
3738
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
3739
|
+
)),
|
|
3740
|
+
createCommentVNode(" 下拉选项列表 "),
|
|
3741
|
+
createVNode(SelectionPopover, {
|
|
3742
|
+
"container-width": containerRef.value ? containerRef.value.offsetWidth : "auto",
|
|
3743
|
+
"empty-text": _ctx.emptyText,
|
|
3744
|
+
"is-show": showDropdown.value,
|
|
3745
|
+
loading: unref(searchLoading),
|
|
3746
|
+
options: options.value,
|
|
3747
|
+
"search-query": unref(searchQuery),
|
|
3748
|
+
"tenant-id": _ctx.tenantId,
|
|
3749
|
+
tenants: _ctx.tenants,
|
|
3750
|
+
"user-group": _ctx.userGroup,
|
|
3751
|
+
"user-group-name": _ctx.userGroupName,
|
|
3752
|
+
onClickoutside: handleClickOutside,
|
|
3753
|
+
onSelectUser: addUser
|
|
3754
|
+
}, null, 8, ["container-width", "empty-text", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
3755
|
+
],
|
|
3756
|
+
512
|
|
3757
|
+
/* NEED_PATCH */
|
|
3758
|
+
);
|
|
3731
3759
|
};
|
|
3732
3760
|
}
|
|
3733
3761
|
});
|
|
3734
|
-
const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
3735
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
3762
|
+
const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-6ac8344d"]]);
|
|
3763
|
+
const _withScopeId = (n) => (pushScopeId("data-v-ad0d9e2e"), n = n(), popScopeId(), n);
|
|
3736
3764
|
const _hoisted_1$1 = { class: "input-container" };
|
|
3737
3765
|
const _hoisted_2 = {
|
|
3738
3766
|
key: 0,
|
|
@@ -3760,7 +3788,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3760
3788
|
currentUserId: { default: "" },
|
|
3761
3789
|
exactSearchKey: { default: "bk_username" },
|
|
3762
3790
|
userGroup: { default: () => [] },
|
|
3763
|
-
userGroupName: { default: "用户群组" }
|
|
3791
|
+
userGroupName: { default: "用户群组" },
|
|
3792
|
+
emptyText: { default: "无匹配人员" }
|
|
3764
3793
|
},
|
|
3765
3794
|
emits: ["update:modelValue", "change"],
|
|
3766
3795
|
setup(__props, { emit: __emit }) {
|
|
@@ -3903,6 +3932,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3903
3932
|
createCommentVNode(" 使用新的公共下拉选项组件 "),
|
|
3904
3933
|
createVNode(SelectionPopover, {
|
|
3905
3934
|
"container-width": containerRef.value ? containerRef.value.offsetWidth : "auto",
|
|
3935
|
+
"empty-text": _ctx.emptyText,
|
|
3906
3936
|
"is-show": showDropdown.value,
|
|
3907
3937
|
loading: isLoading.value,
|
|
3908
3938
|
options: options.value,
|
|
@@ -3912,14 +3942,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3912
3942
|
"user-group": _ctx.userGroup,
|
|
3913
3943
|
"user-group-name": _ctx.userGroupName,
|
|
3914
3944
|
onSelectUser: addUser
|
|
3915
|
-
}, null, 8, ["container-width", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
3945
|
+
}, null, 8, ["container-width", "empty-text", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
3916
3946
|
])), [
|
|
3917
3947
|
[unref(clickoutside), handleClickOutside]
|
|
3918
3948
|
]);
|
|
3919
3949
|
};
|
|
3920
3950
|
}
|
|
3921
3951
|
});
|
|
3922
|
-
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
3952
|
+
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ad0d9e2e"]]);
|
|
3923
3953
|
const _hoisted_1 = {
|
|
3924
3954
|
ref: "containerRef",
|
|
3925
3955
|
class: "bk-user-selector"
|
|
@@ -3939,7 +3969,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3939
3969
|
currentUserId: { default: "" },
|
|
3940
3970
|
exactSearchKey: { default: "bk_username" },
|
|
3941
3971
|
userGroup: { default: () => [] },
|
|
3942
|
-
userGroupName: { default: "用户群组" }
|
|
3972
|
+
userGroupName: { default: "用户群组" },
|
|
3973
|
+
emptyText: { default: "无匹配人员" }
|
|
3943
3974
|
},
|
|
3944
3975
|
emits: ["update:modelValue", "change"],
|
|
3945
3976
|
setup(__props, { emit: __emit }) {
|
|
@@ -3997,6 +4028,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3997
4028
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedUser.value = $event),
|
|
3998
4029
|
"api-base-url": _ctx.apiBaseUrl,
|
|
3999
4030
|
"current-user-id": _ctx.currentUserId,
|
|
4031
|
+
"empty-text": _ctx.emptyText,
|
|
4000
4032
|
"exact-search-key": _ctx.exactSearchKey,
|
|
4001
4033
|
placeholder: _ctx.placeholder,
|
|
4002
4034
|
"tenant-id": _ctx.tenantId,
|
|
@@ -4004,7 +4036,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4004
4036
|
"user-group": _ctx.userGroup,
|
|
4005
4037
|
"user-group-name": _ctx.userGroupName,
|
|
4006
4038
|
onChange: handleUpdateUser
|
|
4007
|
-
}, null, 8, ["modelValue", "api-base-url", "current-user-id", "exact-search-key", "placeholder", "tenant-id", "tenants", "user-group", "user-group-name"])) : (openBlock(), createElementBlock(
|
|
4039
|
+
}, null, 8, ["modelValue", "api-base-url", "current-user-id", "empty-text", "exact-search-key", "placeholder", "tenant-id", "tenants", "user-group", "user-group-name"])) : (openBlock(), createElementBlock(
|
|
4008
4040
|
Fragment,
|
|
4009
4041
|
{ key: 1 },
|
|
4010
4042
|
[
|
|
@@ -4015,6 +4047,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4015
4047
|
"api-base-url": _ctx.apiBaseUrl,
|
|
4016
4048
|
"current-user-id": _ctx.currentUserId,
|
|
4017
4049
|
draggable: _ctx.draggable,
|
|
4050
|
+
"empty-text": _ctx.emptyText,
|
|
4018
4051
|
"exact-search-key": _ctx.exactSearchKey,
|
|
4019
4052
|
placeholder: _ctx.placeholder,
|
|
4020
4053
|
"selected-users": selectedUsers.value,
|
|
@@ -4023,7 +4056,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4023
4056
|
"user-group": _ctx.userGroup,
|
|
4024
4057
|
"user-group-name": _ctx.userGroupName,
|
|
4025
4058
|
"onUpdate:selectedUsers": handleUpdateSelectedUsers
|
|
4026
|
-
}, null, 8, ["modelValue", "api-base-url", "current-user-id", "draggable", "exact-search-key", "placeholder", "selected-users", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
4059
|
+
}, null, 8, ["modelValue", "api-base-url", "current-user-id", "draggable", "empty-text", "exact-search-key", "placeholder", "selected-users", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
4027
4060
|
],
|
|
4028
4061
|
2112
|
|
4029
4062
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
@@ -4035,7 +4068,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4035
4068
|
};
|
|
4036
4069
|
}
|
|
4037
4070
|
});
|
|
4038
|
-
const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4071
|
+
const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6fd92757"]]);
|
|
4039
4072
|
export {
|
|
4040
4073
|
BkUserSelector,
|
|
4041
4074
|
BkUserSelector as default
|