@blueking/bk-user-selector 0.0.10 → 0.0.12
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 +1 -0
- package/package.json +1 -1
- package/typings/api/user.d.ts +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 +32 -31
- 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 +32 -31
package/vue3/index.es.min.js
CHANGED
|
@@ -48,7 +48,8 @@ const searchUsers = async (apiBaseUrl = "", tenantId = "", keyword = "") => {
|
|
|
48
48
|
return [];
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
const lookupUsers = async (apiBaseUrl = "", tenantId = "", exactSearchKey = "bk_username",
|
|
51
|
+
const lookupUsers = async (apiBaseUrl = "", tenantId = "", exactSearchKey = "bk_username", usersList = []) => {
|
|
52
|
+
const users = usersList.filter((user) => user).map((user) => user.trim());
|
|
52
53
|
if (users.length === 0 || !apiBaseUrl || !tenantId) {
|
|
53
54
|
console.warn("批量查找用户需要提供有效的apiBaseUrl、租户ID和至少一个用户名");
|
|
54
55
|
return [];
|
|
@@ -3091,6 +3092,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3091
3092
|
userGroupName: {
|
|
3092
3093
|
type: String,
|
|
3093
3094
|
default: "用户群组"
|
|
3095
|
+
},
|
|
3096
|
+
/**
|
|
3097
|
+
* 无匹配人员时的提示文本
|
|
3098
|
+
*/
|
|
3099
|
+
emptyText: {
|
|
3100
|
+
type: String,
|
|
3101
|
+
default: "无匹配人员"
|
|
3094
3102
|
}
|
|
3095
3103
|
},
|
|
3096
3104
|
emits: ["select-user"],
|
|
@@ -3140,7 +3148,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3140
3148
|
createElementVNode(
|
|
3141
3149
|
"span",
|
|
3142
3150
|
null,
|
|
3143
|
-
toDisplayString(__props.searchQuery.length > 1 ?
|
|
3151
|
+
toDisplayString(__props.searchQuery.length > 1 ? __props.emptyText : "请至少输入2个字符搜索"),
|
|
3144
3152
|
1
|
|
3145
3153
|
/* TEXT */
|
|
3146
3154
|
)
|
|
@@ -3223,7 +3231,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3223
3231
|
};
|
|
3224
3232
|
}
|
|
3225
3233
|
});
|
|
3226
|
-
const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
3234
|
+
const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-05b232a4"]]);
|
|
3227
3235
|
const _hoisted_1$3 = { class: "tag-content" };
|
|
3228
3236
|
const _hoisted_2$2 = { class: "user-name" };
|
|
3229
3237
|
const _hoisted_3$2 = {
|
|
@@ -3283,7 +3291,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3283
3291
|
};
|
|
3284
3292
|
}
|
|
3285
3293
|
});
|
|
3286
|
-
const UserTag = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
3294
|
+
const UserTag = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-87c12feb"]]);
|
|
3287
3295
|
const _hoisted_1$2 = ["onClick"];
|
|
3288
3296
|
const _hoisted_2$1 = ["placeholder"];
|
|
3289
3297
|
const _hoisted_3$1 = ["placeholder"];
|
|
@@ -3303,7 +3311,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3303
3311
|
currentUserId: { default: "" },
|
|
3304
3312
|
exactSearchKey: { default: "bk_username" },
|
|
3305
3313
|
userGroup: { default: () => [] },
|
|
3306
|
-
userGroupName: { default: "用户群组" }
|
|
3314
|
+
userGroupName: { default: "用户群组" },
|
|
3315
|
+
emptyText: { default: "无匹配人员" }
|
|
3307
3316
|
},
|
|
3308
3317
|
emits: ["update:selectedUsers", "add-user", "remove-user"],
|
|
3309
3318
|
setup(__props, { emit: __emit }) {
|
|
@@ -3380,7 +3389,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3380
3389
|
}
|
|
3381
3390
|
});
|
|
3382
3391
|
};
|
|
3383
|
-
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
|
+
}
|
|
3384
3399
|
isFocused.value = false;
|
|
3385
3400
|
showDropdown.value = false;
|
|
3386
3401
|
activeTagIndex.value = -1;
|
|
@@ -3489,7 +3504,14 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3489
3504
|
emit("add-user", user);
|
|
3490
3505
|
}
|
|
3491
3506
|
searchQuery.value = "";
|
|
3492
|
-
|
|
3507
|
+
setTimeout(() => {
|
|
3508
|
+
showDropdown.value = false;
|
|
3509
|
+
}, 220);
|
|
3510
|
+
nextTick(() => {
|
|
3511
|
+
if (lastInputRef.value) {
|
|
3512
|
+
lastInputRef.value.focus();
|
|
3513
|
+
}
|
|
3514
|
+
});
|
|
3493
3515
|
};
|
|
3494
3516
|
const removeUser = (user) => {
|
|
3495
3517
|
if (!(user == null ? void 0 : user.id)) return;
|
|
@@ -3538,200 +3560,206 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3538
3560
|
});
|
|
3539
3561
|
});
|
|
3540
3562
|
return (_ctx, _cache) => {
|
|
3541
|
-
return
|
|
3542
|
-
|
|
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
|
-
|
|
3563
|
+
return openBlock(), createElementBlock(
|
|
3564
|
+
"div",
|
|
3565
|
+
{
|
|
3566
|
+
ref_key: "containerRef",
|
|
3567
|
+
ref: containerRef,
|
|
3568
|
+
class: "multiple-selector"
|
|
3569
|
+
},
|
|
3570
|
+
[
|
|
3571
|
+
createCommentVNode(" 聚焦状态 - 可编辑模式 "),
|
|
3572
|
+
isFocused.value ? (openBlock(), createElementBlock(
|
|
3573
|
+
"div",
|
|
3574
|
+
{
|
|
3575
|
+
key: 0,
|
|
3576
|
+
ref_key: "tagsContainerRef",
|
|
3577
|
+
ref: tagsContainerRef,
|
|
3578
|
+
class: "tags-container focused",
|
|
3579
|
+
onClick: withModifiers(handleContainerClick, ["stop"])
|
|
3580
|
+
},
|
|
3581
|
+
[
|
|
3582
|
+
createCommentVNode(" 用户标签列表 "),
|
|
3583
|
+
createElementVNode(
|
|
3584
|
+
"div",
|
|
3585
|
+
{
|
|
3586
|
+
ref_key: "sortableContainerRef",
|
|
3587
|
+
ref: sortableContainerRef,
|
|
3588
|
+
class: "tag-list"
|
|
3589
|
+
},
|
|
3590
|
+
[
|
|
3591
|
+
(openBlock(true), createElementBlock(
|
|
3592
|
+
Fragment,
|
|
3593
|
+
null,
|
|
3594
|
+
renderList(_ctx.selectedUsers, (user, index) => {
|
|
3595
|
+
return openBlock(), createElementBlock("div", {
|
|
3596
|
+
class: "tag-wrapper",
|
|
3597
|
+
key: user.id,
|
|
3598
|
+
onClick: withModifiers(($event) => handleTagClick(index), ["stop"])
|
|
3599
|
+
}, [
|
|
3600
|
+
createVNode(UserTag, {
|
|
3601
|
+
active: index === activeTagIndex.value,
|
|
3602
|
+
"current-tenant-id": _ctx.tenantId,
|
|
3603
|
+
draggable: _ctx.draggable,
|
|
3604
|
+
tenants: _ctx.tenants,
|
|
3605
|
+
user,
|
|
3606
|
+
onClick: ($event) => handleTagClick(index),
|
|
3607
|
+
onClose: ($event) => removeUser(user)
|
|
3608
|
+
}, null, 8, ["active", "current-tenant-id", "draggable", "tenants", "user", "onClick", "onClose"]),
|
|
3609
|
+
createCommentVNode(" 在当前激活标签后插入输入框 "),
|
|
3610
|
+
index === activeTagIndex.value && activeTagIndex.value !== _ctx.selectedUsers.length - 1 ? withDirectives((openBlock(), createElementBlock(
|
|
3611
|
+
"input",
|
|
3612
|
+
{
|
|
3613
|
+
key: 0,
|
|
3614
|
+
ref_for: true,
|
|
3615
|
+
ref_key: "inlineInputRef",
|
|
3616
|
+
ref: inlineInputRef,
|
|
3617
|
+
class: "search-input inline",
|
|
3618
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(searchQuery) ? searchQuery.value = $event : null),
|
|
3619
|
+
onFocus: handleInputFocus,
|
|
3620
|
+
onInput: handleInput,
|
|
3621
|
+
onKeydown: handleKeyDown,
|
|
3622
|
+
onPaste: handlePaste
|
|
3623
|
+
},
|
|
3624
|
+
null,
|
|
3625
|
+
544
|
|
3626
|
+
/* NEED_HYDRATION, NEED_PATCH */
|
|
3627
|
+
)), [
|
|
3628
|
+
[vModelText, unref(searchQuery)]
|
|
3629
|
+
]) : createCommentVNode("v-if", true)
|
|
3630
|
+
], 8, _hoisted_1$2);
|
|
3631
|
+
}),
|
|
3632
|
+
128
|
|
3633
|
+
/* KEYED_FRAGMENT */
|
|
3634
|
+
)),
|
|
3635
|
+
createCommentVNode(" 最后一个输入框 "),
|
|
3636
|
+
activeTagIndex.value === -1 || activeTagIndex.value === _ctx.selectedUsers.length - 1 ? withDirectives((openBlock(), createElementBlock("input", {
|
|
3637
|
+
key: 0,
|
|
3638
|
+
ref_key: "lastInputRef",
|
|
3639
|
+
ref: lastInputRef,
|
|
3640
|
+
class: "search-input last",
|
|
3641
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(searchQuery) ? searchQuery.value = $event : null),
|
|
3642
|
+
placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
|
|
3643
|
+
onFocus: handleInputFocus,
|
|
3644
|
+
onInput: handleInput,
|
|
3645
|
+
onKeydown: handleKeyDown,
|
|
3646
|
+
onPaste: handlePaste
|
|
3647
|
+
}, null, 40, _hoisted_2$1)), [
|
|
3648
|
+
[vModelText, unref(searchQuery)]
|
|
3649
|
+
]) : createCommentVNode("v-if", true),
|
|
3650
|
+
createCommentVNode(' "我"标签 '),
|
|
3651
|
+
createVNode(MeTag, {
|
|
3652
|
+
"current-user-id": _ctx.currentUserId,
|
|
3653
|
+
"is-disabled": !!_ctx.currentUserId && _ctx.selectedUsers.some((user) => user.id === _ctx.currentUserId),
|
|
3654
|
+
onClick: addCurrentUser
|
|
3655
|
+
}, null, 8, ["current-user-id", "is-disabled"])
|
|
3656
|
+
],
|
|
3657
|
+
512
|
|
3658
|
+
/* NEED_PATCH */
|
|
3659
|
+
)
|
|
3660
|
+
],
|
|
3661
|
+
512
|
|
3662
|
+
/* NEED_PATCH */
|
|
3663
|
+
)) : (openBlock(), createElementBlock(
|
|
3664
|
+
Fragment,
|
|
3665
|
+
{ key: 1 },
|
|
3666
|
+
[
|
|
3667
|
+
createCommentVNode(" 未聚焦状态 - 只读展示模式 "),
|
|
3668
|
+
createElementVNode(
|
|
3669
|
+
"div",
|
|
3670
|
+
{
|
|
3671
|
+
ref_key: "collapsedContainerRef",
|
|
3672
|
+
ref: collapsedContainerRef,
|
|
3673
|
+
class: "tags-container collapsed",
|
|
3674
|
+
onClick: withModifiers(handleFocus, ["stop"])
|
|
3675
|
+
},
|
|
3676
|
+
[
|
|
3677
|
+
(openBlock(true), createElementBlock(
|
|
3678
|
+
Fragment,
|
|
3679
|
+
null,
|
|
3680
|
+
renderList(visibleUsers.value, (user) => {
|
|
3681
|
+
return openBlock(), createBlock(UserTag, {
|
|
3577
3682
|
"current-tenant-id": _ctx.tenantId,
|
|
3578
|
-
|
|
3683
|
+
key: user.id,
|
|
3684
|
+
"show-tenant": true,
|
|
3579
3685
|
tenants: _ctx.tenants,
|
|
3580
3686
|
user,
|
|
3581
|
-
onClick:
|
|
3687
|
+
onClick: handleFocus,
|
|
3582
3688
|
onClose: ($event) => removeUser(user)
|
|
3583
|
-
}, null, 8, ["
|
|
3584
|
-
|
|
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
|
-
onFocus: handleInputFocus,
|
|
3619
|
-
onInput: handleInput,
|
|
3620
|
-
onKeydown: handleKeyDown,
|
|
3621
|
-
onPaste: handlePaste
|
|
3622
|
-
}, null, 40, _hoisted_2$1)), [
|
|
3623
|
-
[vModelText, unref(searchQuery)]
|
|
3624
|
-
]) : createCommentVNode("v-if", true),
|
|
3625
|
-
createCommentVNode(' "我"标签 '),
|
|
3626
|
-
createVNode(MeTag, {
|
|
3627
|
-
"current-user-id": _ctx.currentUserId,
|
|
3628
|
-
"is-disabled": !!_ctx.currentUserId && _ctx.selectedUsers.some((user) => user.id === _ctx.currentUserId),
|
|
3629
|
-
onClick: addCurrentUser
|
|
3630
|
-
}, null, 8, ["current-user-id", "is-disabled"])
|
|
3631
|
-
],
|
|
3632
|
-
512
|
|
3633
|
-
/* NEED_PATCH */
|
|
3634
|
-
)
|
|
3635
|
-
],
|
|
3636
|
-
512
|
|
3637
|
-
/* NEED_PATCH */
|
|
3638
|
-
)) : (openBlock(), createElementBlock(
|
|
3639
|
-
Fragment,
|
|
3640
|
-
{ key: 1 },
|
|
3641
|
-
[
|
|
3642
|
-
createCommentVNode(" 未聚焦状态 - 只读展示模式 "),
|
|
3643
|
-
createElementVNode(
|
|
3644
|
-
"div",
|
|
3645
|
-
{
|
|
3646
|
-
ref_key: "collapsedContainerRef",
|
|
3647
|
-
ref: collapsedContainerRef,
|
|
3648
|
-
class: "tags-container collapsed",
|
|
3649
|
-
onClick: withModifiers(handleFocus, ["stop"])
|
|
3650
|
-
},
|
|
3651
|
-
[
|
|
3652
|
-
(openBlock(true), createElementBlock(
|
|
3653
|
-
Fragment,
|
|
3654
|
-
null,
|
|
3655
|
-
renderList(visibleUsers.value, (user) => {
|
|
3656
|
-
return openBlock(), createBlock(UserTag, {
|
|
3657
|
-
"current-tenant-id": _ctx.tenantId,
|
|
3658
|
-
key: user.id,
|
|
3659
|
-
"show-tenant": true,
|
|
3660
|
-
tenants: _ctx.tenants,
|
|
3661
|
-
user,
|
|
3662
|
-
onClick: handleFocus,
|
|
3663
|
-
onClose: ($event) => removeUser(user)
|
|
3664
|
-
}, null, 8, ["current-tenant-id", "tenants", "user", "onClose"]);
|
|
3665
|
-
}),
|
|
3666
|
-
128
|
|
3667
|
-
/* KEYED_FRAGMENT */
|
|
3668
|
-
)),
|
|
3669
|
-
createCommentVNode(" 显示折叠标签数量 "),
|
|
3670
|
-
hiddenCount.value > 0 ? withDirectives((openBlock(), createBlock(unref(Tag), {
|
|
3671
|
-
key: 0,
|
|
3672
|
-
onClick: withModifiers(handleFocus, ["stop"])
|
|
3673
|
-
}, {
|
|
3674
|
-
default: withCtx(() => [
|
|
3675
|
-
createTextVNode(
|
|
3676
|
-
" +" + toDisplayString(hiddenCount.value),
|
|
3677
|
-
1
|
|
3678
|
-
/* TEXT */
|
|
3679
|
-
)
|
|
3689
|
+
}, null, 8, ["current-tenant-id", "tenants", "user", "onClose"]);
|
|
3690
|
+
}),
|
|
3691
|
+
128
|
|
3692
|
+
/* KEYED_FRAGMENT */
|
|
3693
|
+
)),
|
|
3694
|
+
createCommentVNode(" 显示折叠标签数量 "),
|
|
3695
|
+
hiddenCount.value > 0 ? withDirectives((openBlock(), createBlock(unref(Tag), {
|
|
3696
|
+
key: 0,
|
|
3697
|
+
onClick: withModifiers(handleFocus, ["stop"])
|
|
3698
|
+
}, {
|
|
3699
|
+
default: withCtx(() => [
|
|
3700
|
+
createTextVNode(
|
|
3701
|
+
" +" + toDisplayString(hiddenCount.value),
|
|
3702
|
+
1
|
|
3703
|
+
/* TEXT */
|
|
3704
|
+
)
|
|
3705
|
+
]),
|
|
3706
|
+
_: 1
|
|
3707
|
+
/* STABLE */
|
|
3708
|
+
})), [
|
|
3709
|
+
[unref(bkTooltips), {
|
|
3710
|
+
content: _ctx.selectedUsers.slice(visibleUsers.value.length).map((user) => user.display_name).join(","),
|
|
3711
|
+
placement: "top"
|
|
3712
|
+
}]
|
|
3713
|
+
]) : createCommentVNode("v-if", true),
|
|
3714
|
+
createCommentVNode(" 搜索输入框 "),
|
|
3715
|
+
withDirectives(createElementVNode("input", {
|
|
3716
|
+
ref_key: "collapsedInputRef",
|
|
3717
|
+
ref: collapsedInputRef,
|
|
3718
|
+
class: "search-input collapsed",
|
|
3719
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(searchQuery) ? searchQuery.value = $event : null),
|
|
3720
|
+
placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
|
|
3721
|
+
onFocus: handleFocus
|
|
3722
|
+
}, null, 40, _hoisted_3$1), [
|
|
3723
|
+
[vModelText, unref(searchQuery)]
|
|
3680
3724
|
]),
|
|
3681
|
-
|
|
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
|
-
createCommentVNode(" 下拉选项列表 "),
|
|
3715
|
-
createVNode(SelectionPopover, {
|
|
3716
|
-
"container-width": containerRef.value ? containerRef.value.offsetWidth : "auto",
|
|
3717
|
-
"is-show": showDropdown.value,
|
|
3718
|
-
loading: unref(searchLoading),
|
|
3719
|
-
options: options.value,
|
|
3720
|
-
"search-query": unref(searchQuery),
|
|
3721
|
-
"tenant-id": _ctx.tenantId,
|
|
3722
|
-
tenants: _ctx.tenants,
|
|
3723
|
-
"user-group": _ctx.userGroup,
|
|
3724
|
-
"user-group-name": _ctx.userGroupName,
|
|
3725
|
-
onSelectUser: addUser
|
|
3726
|
-
}, null, 8, ["container-width", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
3727
|
-
])), [
|
|
3728
|
-
[unref(clickoutside), handleClickOutside]
|
|
3729
|
-
]);
|
|
3725
|
+
createCommentVNode(' 未聚焦状态下的"我"标签 '),
|
|
3726
|
+
createVNode(MeTag, {
|
|
3727
|
+
"current-user-id": _ctx.currentUserId,
|
|
3728
|
+
"is-disabled": !!_ctx.currentUserId && _ctx.selectedUsers.some((user) => user[props.exactSearchKey] === _ctx.currentUserId),
|
|
3729
|
+
onClick: addCurrentUser
|
|
3730
|
+
}, null, 8, ["current-user-id", "is-disabled"])
|
|
3731
|
+
],
|
|
3732
|
+
512
|
|
3733
|
+
/* NEED_PATCH */
|
|
3734
|
+
)
|
|
3735
|
+
],
|
|
3736
|
+
2112
|
|
3737
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
3738
|
+
)),
|
|
3739
|
+
createCommentVNode(" 下拉选项列表 "),
|
|
3740
|
+
createVNode(SelectionPopover, {
|
|
3741
|
+
"container-width": containerRef.value ? containerRef.value.offsetWidth : "auto",
|
|
3742
|
+
"empty-text": _ctx.emptyText,
|
|
3743
|
+
"is-show": showDropdown.value,
|
|
3744
|
+
loading: unref(searchLoading),
|
|
3745
|
+
options: options.value,
|
|
3746
|
+
"search-query": unref(searchQuery),
|
|
3747
|
+
"tenant-id": _ctx.tenantId,
|
|
3748
|
+
tenants: _ctx.tenants,
|
|
3749
|
+
"user-group": _ctx.userGroup,
|
|
3750
|
+
"user-group-name": _ctx.userGroupName,
|
|
3751
|
+
onClickoutside: handleClickOutside,
|
|
3752
|
+
onSelectUser: addUser
|
|
3753
|
+
}, null, 8, ["container-width", "empty-text", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
3754
|
+
],
|
|
3755
|
+
512
|
|
3756
|
+
/* NEED_PATCH */
|
|
3757
|
+
);
|
|
3730
3758
|
};
|
|
3731
3759
|
}
|
|
3732
3760
|
});
|
|
3733
|
-
const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
3734
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
3761
|
+
const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-a884849e"]]);
|
|
3762
|
+
const _withScopeId = (n) => (pushScopeId("data-v-ad0d9e2e"), n = n(), popScopeId(), n);
|
|
3735
3763
|
const _hoisted_1$1 = { class: "input-container" };
|
|
3736
3764
|
const _hoisted_2 = {
|
|
3737
3765
|
key: 0,
|
|
@@ -3759,7 +3787,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3759
3787
|
currentUserId: { default: "" },
|
|
3760
3788
|
exactSearchKey: { default: "bk_username" },
|
|
3761
3789
|
userGroup: { default: () => [] },
|
|
3762
|
-
userGroupName: { default: "用户群组" }
|
|
3790
|
+
userGroupName: { default: "用户群组" },
|
|
3791
|
+
emptyText: { default: "无匹配人员" }
|
|
3763
3792
|
},
|
|
3764
3793
|
emits: ["update:modelValue", "change"],
|
|
3765
3794
|
setup(__props, { emit: __emit }) {
|
|
@@ -3902,6 +3931,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3902
3931
|
createCommentVNode(" 使用新的公共下拉选项组件 "),
|
|
3903
3932
|
createVNode(SelectionPopover, {
|
|
3904
3933
|
"container-width": containerRef.value ? containerRef.value.offsetWidth : "auto",
|
|
3934
|
+
"empty-text": _ctx.emptyText,
|
|
3905
3935
|
"is-show": showDropdown.value,
|
|
3906
3936
|
loading: isLoading.value,
|
|
3907
3937
|
options: options.value,
|
|
@@ -3911,14 +3941,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3911
3941
|
"user-group": _ctx.userGroup,
|
|
3912
3942
|
"user-group-name": _ctx.userGroupName,
|
|
3913
3943
|
onSelectUser: addUser
|
|
3914
|
-
}, null, 8, ["container-width", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
3944
|
+
}, null, 8, ["container-width", "empty-text", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
3915
3945
|
])), [
|
|
3916
3946
|
[unref(clickoutside), handleClickOutside]
|
|
3917
3947
|
]);
|
|
3918
3948
|
};
|
|
3919
3949
|
}
|
|
3920
3950
|
});
|
|
3921
|
-
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
3951
|
+
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ad0d9e2e"]]);
|
|
3922
3952
|
const _hoisted_1 = {
|
|
3923
3953
|
ref: "containerRef",
|
|
3924
3954
|
class: "bk-user-selector"
|
|
@@ -3938,7 +3968,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3938
3968
|
currentUserId: { default: "" },
|
|
3939
3969
|
exactSearchKey: { default: "bk_username" },
|
|
3940
3970
|
userGroup: { default: () => [] },
|
|
3941
|
-
userGroupName: { default: "用户群组" }
|
|
3971
|
+
userGroupName: { default: "用户群组" },
|
|
3972
|
+
emptyText: { default: "无匹配人员" }
|
|
3942
3973
|
},
|
|
3943
3974
|
emits: ["update:modelValue", "change"],
|
|
3944
3975
|
setup(__props, { emit: __emit }) {
|
|
@@ -3996,6 +4027,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3996
4027
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedUser.value = $event),
|
|
3997
4028
|
"api-base-url": _ctx.apiBaseUrl,
|
|
3998
4029
|
"current-user-id": _ctx.currentUserId,
|
|
4030
|
+
"empty-text": _ctx.emptyText,
|
|
3999
4031
|
"exact-search-key": _ctx.exactSearchKey,
|
|
4000
4032
|
placeholder: _ctx.placeholder,
|
|
4001
4033
|
"tenant-id": _ctx.tenantId,
|
|
@@ -4003,7 +4035,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4003
4035
|
"user-group": _ctx.userGroup,
|
|
4004
4036
|
"user-group-name": _ctx.userGroupName,
|
|
4005
4037
|
onChange: handleUpdateUser
|
|
4006
|
-
}, null, 8, ["modelValue", "api-base-url", "current-user-id", "exact-search-key", "placeholder", "tenant-id", "tenants", "user-group", "user-group-name"])) : (openBlock(), createElementBlock(
|
|
4038
|
+
}, 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(
|
|
4007
4039
|
Fragment,
|
|
4008
4040
|
{ key: 1 },
|
|
4009
4041
|
[
|
|
@@ -4014,6 +4046,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4014
4046
|
"api-base-url": _ctx.apiBaseUrl,
|
|
4015
4047
|
"current-user-id": _ctx.currentUserId,
|
|
4016
4048
|
draggable: _ctx.draggable,
|
|
4049
|
+
"empty-text": _ctx.emptyText,
|
|
4017
4050
|
"exact-search-key": _ctx.exactSearchKey,
|
|
4018
4051
|
placeholder: _ctx.placeholder,
|
|
4019
4052
|
"selected-users": selectedUsers.value,
|
|
@@ -4022,7 +4055,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4022
4055
|
"user-group": _ctx.userGroup,
|
|
4023
4056
|
"user-group-name": _ctx.userGroupName,
|
|
4024
4057
|
"onUpdate:selectedUsers": handleUpdateSelectedUsers
|
|
4025
|
-
}, null, 8, ["modelValue", "api-base-url", "current-user-id", "draggable", "exact-search-key", "placeholder", "selected-users", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
4058
|
+
}, 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"])
|
|
4026
4059
|
],
|
|
4027
4060
|
2112
|
|
4028
4061
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
@@ -4034,7 +4067,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4034
4067
|
};
|
|
4035
4068
|
}
|
|
4036
4069
|
});
|
|
4037
|
-
const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4070
|
+
const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6fd92757"]]);
|
|
4038
4071
|
export {
|
|
4039
4072
|
BkUserSelector,
|
|
4040
4073
|
BkUserSelector as default
|