@blueking/bk-user-selector 0.0.4 → 0.0.6
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 +4 -4
- package/package.json +1 -1
- package/typings/api/user.d.ts +2 -2
- package/typings/components/multiple-selector.vue.d.ts +4 -4
- package/typings/components/user-selector.vue.d.ts +4 -4
- package/typings/types/index.d.ts +7 -3
- package/vue2/index.es.min.js +35 -31
- package/vue2/index.iife.min.js +36 -32
- package/vue2/index.umd.min.js +36 -32
- package/vue2/vue2.css +35 -35
- package/vue3/index.es.min.js +35 -31
- package/vue3/index.iife.min.js +36 -32
- package/vue3/index.umd.min.js +36 -32
- package/vue3/vue3.css +35 -35
package/vue2/vue2.css
CHANGED
|
@@ -1338,11 +1338,11 @@ optgroup {
|
|
|
1338
1338
|
border-radius: 2px;
|
|
1339
1339
|
}.bk-user-selector-popover.bk-popover.bk-pop2-content {
|
|
1340
1340
|
padding: 0;
|
|
1341
|
-
}.multiple-selector[data-v-
|
|
1341
|
+
}.multiple-selector[data-v-50540b99] {
|
|
1342
1342
|
position: relative;
|
|
1343
1343
|
width: 100%;
|
|
1344
1344
|
}
|
|
1345
|
-
.multiple-selector .tags-container[data-v-
|
|
1345
|
+
.multiple-selector .tags-container[data-v-50540b99] {
|
|
1346
1346
|
min-height: 32px;
|
|
1347
1347
|
border: 1px solid #dcdee5;
|
|
1348
1348
|
border-radius: 2px;
|
|
@@ -1350,69 +1350,69 @@ optgroup {
|
|
|
1350
1350
|
transition: all 0.2s ease;
|
|
1351
1351
|
background-color: #fff;
|
|
1352
1352
|
}
|
|
1353
|
-
.multiple-selector .tags-container.focused[data-v-
|
|
1353
|
+
.multiple-selector .tags-container.focused[data-v-50540b99] {
|
|
1354
1354
|
border-color: #3a84ff;
|
|
1355
1355
|
box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);
|
|
1356
1356
|
}
|
|
1357
|
-
.multiple-selector .tags-container.collapsed[data-v-
|
|
1357
|
+
.multiple-selector .tags-container.collapsed[data-v-50540b99] {
|
|
1358
1358
|
display: flex;
|
|
1359
1359
|
flex-wrap: wrap;
|
|
1360
1360
|
align-items: center;
|
|
1361
1361
|
}
|
|
1362
|
-
.multiple-selector .tag-list[data-v-
|
|
1362
|
+
.multiple-selector .tag-list[data-v-50540b99] {
|
|
1363
1363
|
display: flex;
|
|
1364
1364
|
flex-wrap: wrap;
|
|
1365
1365
|
align-items: center;
|
|
1366
1366
|
}
|
|
1367
|
-
.multiple-selector .tag-wrapper[data-v-
|
|
1367
|
+
.multiple-selector .tag-wrapper[data-v-50540b99] {
|
|
1368
1368
|
display: inline-flex;
|
|
1369
1369
|
align-items: center;
|
|
1370
1370
|
max-width: 100%;
|
|
1371
1371
|
}
|
|
1372
|
-
.multiple-selector .search-input[data-v-
|
|
1372
|
+
.multiple-selector .search-input[data-v-50540b99] {
|
|
1373
1373
|
outline: none;
|
|
1374
1374
|
border: none;
|
|
1375
1375
|
height: 28px;
|
|
1376
1376
|
min-width: 10px;
|
|
1377
1377
|
background: transparent;
|
|
1378
1378
|
}
|
|
1379
|
-
.multiple-selector .search-input[data-v-
|
|
1379
|
+
.multiple-selector .search-input[data-v-50540b99]::placeholder {
|
|
1380
1380
|
color: #c4c6cc;
|
|
1381
1381
|
}
|
|
1382
|
-
.multiple-selector .search-input.inline[data-v-
|
|
1382
|
+
.multiple-selector .search-input.inline[data-v-50540b99] {
|
|
1383
1383
|
min-width: 10px;
|
|
1384
1384
|
}
|
|
1385
|
-
.multiple-selector .search-input.last[data-v-
|
|
1385
|
+
.multiple-selector .search-input.last[data-v-50540b99], .multiple-selector .search-input.collapsed[data-v-50540b99] {
|
|
1386
1386
|
flex: 1;
|
|
1387
1387
|
min-width: 60px;
|
|
1388
1388
|
}
|
|
1389
|
-
.dropdown-content[data-v-
|
|
1389
|
+
.dropdown-content[data-v-50540b99] {
|
|
1390
1390
|
min-height: 40px;
|
|
1391
1391
|
max-height: 300px;
|
|
1392
1392
|
overflow-y: auto;
|
|
1393
1393
|
padding: 5px 0;
|
|
1394
1394
|
}
|
|
1395
|
-
.dropdown-content .no-data[data-v-
|
|
1395
|
+
.dropdown-content .no-data[data-v-50540b99] {
|
|
1396
1396
|
padding: 10px;
|
|
1397
1397
|
text-align: center;
|
|
1398
1398
|
color: #979ba5;
|
|
1399
1399
|
}
|
|
1400
|
-
.dropdown-content .user-option[data-v-
|
|
1400
|
+
.dropdown-content .user-option[data-v-50540b99] {
|
|
1401
1401
|
padding: 8px 12px;
|
|
1402
1402
|
cursor: pointer;
|
|
1403
1403
|
display: flex;
|
|
1404
1404
|
align-items: center;
|
|
1405
1405
|
height: 32px;
|
|
1406
1406
|
}
|
|
1407
|
-
.dropdown-content .user-option[data-v-
|
|
1407
|
+
.dropdown-content .user-option[data-v-50540b99]:hover {
|
|
1408
1408
|
background-color: #f5f7fa;
|
|
1409
1409
|
}
|
|
1410
|
-
.dropdown-content .user-option .tenant-name[data-v-
|
|
1410
|
+
.dropdown-content .user-option .tenant-name[data-v-50540b99] {
|
|
1411
1411
|
color: #f59500;
|
|
1412
1412
|
margin-left: 4px;
|
|
1413
1413
|
padding: 0 4px;
|
|
1414
1414
|
}
|
|
1415
|
-
.me-tag[data-v-
|
|
1415
|
+
.me-tag[data-v-50540b99] {
|
|
1416
1416
|
display: inline-flex;
|
|
1417
1417
|
align-items: center;
|
|
1418
1418
|
justify-content: center;
|
|
@@ -1430,19 +1430,19 @@ optgroup {
|
|
|
1430
1430
|
transform: translateY(-50%);
|
|
1431
1431
|
z-index: 1;
|
|
1432
1432
|
}
|
|
1433
|
-
.me-tag[data-v-
|
|
1433
|
+
.me-tag[data-v-50540b99]:hover {
|
|
1434
1434
|
background-color: #cddffe;
|
|
1435
1435
|
color: #3a84ff;
|
|
1436
1436
|
}
|
|
1437
|
-
.me-tag.disabled[data-v-
|
|
1437
|
+
.me-tag.disabled[data-v-50540b99] {
|
|
1438
1438
|
background-color: #f0f1f5;
|
|
1439
1439
|
color: #c4c6cc;
|
|
1440
1440
|
cursor: not-allowed;
|
|
1441
|
-
}.single-selector[data-v-
|
|
1441
|
+
}.single-selector[data-v-308925e9] {
|
|
1442
1442
|
position: relative;
|
|
1443
1443
|
width: 100%;
|
|
1444
1444
|
}
|
|
1445
|
-
.input-container[data-v-
|
|
1445
|
+
.input-container[data-v-308925e9] {
|
|
1446
1446
|
position: relative;
|
|
1447
1447
|
display: flex;
|
|
1448
1448
|
align-items: center;
|
|
@@ -1452,21 +1452,21 @@ optgroup {
|
|
|
1452
1452
|
padding: 0 8px;
|
|
1453
1453
|
background-color: #fff;
|
|
1454
1454
|
}
|
|
1455
|
-
.input-container[data-v-
|
|
1455
|
+
.input-container[data-v-308925e9]:focus-within {
|
|
1456
1456
|
border-color: #3a84ff;
|
|
1457
1457
|
box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);
|
|
1458
1458
|
}
|
|
1459
|
-
.search-input[data-v-
|
|
1459
|
+
.search-input[data-v-308925e9] {
|
|
1460
1460
|
flex: 1;
|
|
1461
1461
|
outline: none;
|
|
1462
1462
|
border: none;
|
|
1463
1463
|
height: 30px;
|
|
1464
1464
|
background: transparent;
|
|
1465
1465
|
}
|
|
1466
|
-
.search-input[data-v-
|
|
1466
|
+
.search-input[data-v-308925e9]::placeholder {
|
|
1467
1467
|
color: #c4c6cc;
|
|
1468
1468
|
}
|
|
1469
|
-
.selected-user[data-v-
|
|
1469
|
+
.selected-user[data-v-308925e9] {
|
|
1470
1470
|
display: inline-flex;
|
|
1471
1471
|
align-items: center;
|
|
1472
1472
|
background-color: #f0f1f5;
|
|
@@ -1476,42 +1476,42 @@ optgroup {
|
|
|
1476
1476
|
height: 24px;
|
|
1477
1477
|
max-width: calc(100% - 32px);
|
|
1478
1478
|
}
|
|
1479
|
-
.selected-user .tenant-name[data-v-
|
|
1479
|
+
.selected-user .tenant-name[data-v-308925e9] {
|
|
1480
1480
|
color: #f59500;
|
|
1481
1481
|
margin-left: 4px;
|
|
1482
1482
|
}
|
|
1483
|
-
.selected-user .close-icon[data-v-
|
|
1483
|
+
.selected-user .close-icon[data-v-308925e9] {
|
|
1484
1484
|
margin-left: 4px;
|
|
1485
1485
|
cursor: pointer;
|
|
1486
1486
|
font-style: normal;
|
|
1487
1487
|
}
|
|
1488
|
-
.dropdown-content[data-v-
|
|
1488
|
+
.dropdown-content[data-v-308925e9] {
|
|
1489
1489
|
min-height: 40px;
|
|
1490
1490
|
max-height: 300px;
|
|
1491
1491
|
overflow-y: auto;
|
|
1492
1492
|
padding: 5px 0;
|
|
1493
1493
|
}
|
|
1494
|
-
.dropdown-content .no-data[data-v-
|
|
1494
|
+
.dropdown-content .no-data[data-v-308925e9] {
|
|
1495
1495
|
padding: 10px;
|
|
1496
1496
|
text-align: center;
|
|
1497
1497
|
color: #979ba5;
|
|
1498
1498
|
}
|
|
1499
|
-
.dropdown-content .user-option[data-v-
|
|
1499
|
+
.dropdown-content .user-option[data-v-308925e9] {
|
|
1500
1500
|
padding: 8px 12px;
|
|
1501
1501
|
cursor: pointer;
|
|
1502
1502
|
display: flex;
|
|
1503
1503
|
align-items: center;
|
|
1504
1504
|
height: 32px;
|
|
1505
1505
|
}
|
|
1506
|
-
.dropdown-content .user-option[data-v-
|
|
1506
|
+
.dropdown-content .user-option[data-v-308925e9]:hover {
|
|
1507
1507
|
background-color: #f5f7fa;
|
|
1508
1508
|
}
|
|
1509
|
-
.dropdown-content .user-option .tenant-name[data-v-
|
|
1509
|
+
.dropdown-content .user-option .tenant-name[data-v-308925e9] {
|
|
1510
1510
|
color: #f59500;
|
|
1511
1511
|
margin-left: 4px;
|
|
1512
1512
|
padding: 0 4px;
|
|
1513
1513
|
}
|
|
1514
|
-
.me-tag[data-v-
|
|
1514
|
+
.me-tag[data-v-308925e9] {
|
|
1515
1515
|
display: inline-flex;
|
|
1516
1516
|
align-items: center;
|
|
1517
1517
|
justify-content: center;
|
|
@@ -1529,15 +1529,15 @@ optgroup {
|
|
|
1529
1529
|
transform: translateY(-50%);
|
|
1530
1530
|
z-index: 1;
|
|
1531
1531
|
}
|
|
1532
|
-
.me-tag[data-v-
|
|
1532
|
+
.me-tag[data-v-308925e9]:hover {
|
|
1533
1533
|
background-color: #cddffe;
|
|
1534
1534
|
color: #3a84ff;
|
|
1535
1535
|
}
|
|
1536
|
-
.me-tag.disabled[data-v-
|
|
1536
|
+
.me-tag.disabled[data-v-308925e9] {
|
|
1537
1537
|
background-color: #f0f1f5;
|
|
1538
1538
|
color: #c4c6cc;
|
|
1539
1539
|
cursor: not-allowed;
|
|
1540
|
-
}.bk-user-selector[data-v-
|
|
1540
|
+
}.bk-user-selector[data-v-fe084750] {
|
|
1541
1541
|
width: 100%;
|
|
1542
1542
|
position: relative;
|
|
1543
1543
|
font-size: 12px;
|
package/vue3/index.es.min.js
CHANGED
|
@@ -48,13 +48,13 @@ const searchUsers = async (apiBaseUrl = "", tenantId = "", keyword = "") => {
|
|
|
48
48
|
return [];
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
const lookupUsers = async (apiBaseUrl = "", tenantId = "",
|
|
51
|
+
const lookupUsers = async (apiBaseUrl = "", tenantId = "", exactSearchKey = "bk_username", users = []) => {
|
|
52
52
|
if (users.length === 0 || !apiBaseUrl || !tenantId) {
|
|
53
53
|
console.warn("批量查找用户需要提供有效的apiBaseUrl、租户ID和至少一个用户名");
|
|
54
54
|
return [];
|
|
55
55
|
}
|
|
56
56
|
try {
|
|
57
|
-
const url = `${apiBaseUrl}/api/v3/open-web/tenant/users/-/lookup/?lookups=${users.join(",")}&lookup_fields=${
|
|
57
|
+
const url = `${apiBaseUrl}/api/v3/open-web/tenant/users/-/lookup/?lookups=${users.join(",")}&lookup_fields=${exactSearchKey}`;
|
|
58
58
|
const response = await fetch(url, {
|
|
59
59
|
method: "GET",
|
|
60
60
|
headers: {
|
|
@@ -77,7 +77,8 @@ const formatUsers = (users) => {
|
|
|
77
77
|
return users.map((user) => ({
|
|
78
78
|
id: user.bk_username,
|
|
79
79
|
name: user.display_name,
|
|
80
|
-
tenantId: user.owner_tenant_id
|
|
80
|
+
tenantId: user.owner_tenant_id,
|
|
81
|
+
...user
|
|
81
82
|
}));
|
|
82
83
|
};
|
|
83
84
|
const useTenantData = (apiBaseUrl, tenantId) => {
|
|
@@ -3103,7 +3104,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3103
3104
|
/**
|
|
3104
3105
|
* 精确查找key
|
|
3105
3106
|
*/
|
|
3106
|
-
|
|
3107
|
+
exactSearchKey: {
|
|
3107
3108
|
type: String,
|
|
3108
3109
|
default: "bk_username"
|
|
3109
3110
|
}
|
|
@@ -3221,7 +3222,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3221
3222
|
const addCurrentUser = async () => {
|
|
3222
3223
|
if (!props.currentUserId || props.selectedUsers.some((user) => user.id === props.currentUserId)) return;
|
|
3223
3224
|
try {
|
|
3224
|
-
const result = await lookupUsers(props.apiBaseUrl, props.tenantId, props.
|
|
3225
|
+
const result = await lookupUsers(props.apiBaseUrl, props.tenantId, props.exactSearchKey, [props.currentUserId]);
|
|
3225
3226
|
const formattedUsers = formatUsers(result);
|
|
3226
3227
|
if (formattedUsers.length > 0) {
|
|
3227
3228
|
if (!props.selectedUsers.some((item) => item.id === formattedUsers[0].id)) {
|
|
@@ -3242,7 +3243,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3242
3243
|
if (pastedText.trim()) {
|
|
3243
3244
|
try {
|
|
3244
3245
|
const users = pastedText.trim().split(/[,,;\n\s]+/).filter(Boolean);
|
|
3245
|
-
const result = await lookupUsers(props.apiBaseUrl, props.tenantId, props.
|
|
3246
|
+
const result = await lookupUsers(props.apiBaseUrl, props.tenantId, props.exactSearchKey, users);
|
|
3246
3247
|
const formattedUsers = formatUsers(result);
|
|
3247
3248
|
if (formattedUsers.length > 0) {
|
|
3248
3249
|
const updatedUsers = [...props.selectedUsers, ...formattedUsers];
|
|
@@ -3419,16 +3420,17 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3419
3420
|
[vModelText, unref(searchQuery)]
|
|
3420
3421
|
]) : createCommentVNode("v-if", true),
|
|
3421
3422
|
createCommentVNode(' "我"标签 '),
|
|
3422
|
-
|
|
3423
|
+
__props.currentUserId ? (openBlock(), createElementBlock(
|
|
3423
3424
|
"div",
|
|
3424
3425
|
{
|
|
3426
|
+
key: 1,
|
|
3425
3427
|
class: normalizeClass(["me-tag", { disabled: __props.currentUserId && __props.selectedUsers.some((user) => user.id === __props.currentUserId) }]),
|
|
3426
3428
|
onClick: _cache[2] || (_cache[2] = withModifiers(($event) => addCurrentUser(), ["stop"]))
|
|
3427
3429
|
},
|
|
3428
3430
|
" 我 ",
|
|
3429
3431
|
2
|
|
3430
3432
|
/* CLASS */
|
|
3431
|
-
)
|
|
3433
|
+
)) : createCommentVNode("v-if", true)
|
|
3432
3434
|
],
|
|
3433
3435
|
512
|
|
3434
3436
|
/* NEED_PATCH */
|
|
@@ -3494,16 +3496,17 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3494
3496
|
[vModelText, unref(searchQuery)]
|
|
3495
3497
|
]),
|
|
3496
3498
|
createCommentVNode(' 未聚焦状态下的"我"标签 '),
|
|
3497
|
-
|
|
3499
|
+
__props.currentUserId ? (openBlock(), createElementBlock(
|
|
3498
3500
|
"div",
|
|
3499
3501
|
{
|
|
3500
|
-
|
|
3502
|
+
key: 1,
|
|
3503
|
+
class: normalizeClass(["me-tag", { disabled: __props.currentUserId && __props.selectedUsers.some((user) => user[props.exactSearchKey] === __props.currentUserId) }]),
|
|
3501
3504
|
onClick: _cache[4] || (_cache[4] = withModifiers(($event) => addCurrentUser(), ["stop"]))
|
|
3502
3505
|
},
|
|
3503
3506
|
" 我 ",
|
|
3504
3507
|
2
|
|
3505
3508
|
/* CLASS */
|
|
3506
|
-
)
|
|
3509
|
+
)) : createCommentVNode("v-if", true)
|
|
3507
3510
|
],
|
|
3508
3511
|
512
|
|
3509
3512
|
/* NEED_PATCH */
|
|
@@ -3580,8 +3583,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3580
3583
|
};
|
|
3581
3584
|
}
|
|
3582
3585
|
});
|
|
3583
|
-
const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
3584
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
3586
|
+
const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-50540b99"]]);
|
|
3587
|
+
const _withScopeId = (n) => (pushScopeId("data-v-308925e9"), n = n(), popScopeId(), n);
|
|
3585
3588
|
const _hoisted_1$1 = { class: "input-container" };
|
|
3586
3589
|
const _hoisted_2 = {
|
|
3587
3590
|
key: 0,
|
|
@@ -3616,7 +3619,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3616
3619
|
tenantId: {},
|
|
3617
3620
|
tenants: {},
|
|
3618
3621
|
currentUserId: {},
|
|
3619
|
-
|
|
3622
|
+
exactSearchKey: {}
|
|
3620
3623
|
},
|
|
3621
3624
|
emits: ["update:modelValue", "change"],
|
|
3622
3625
|
setup(__props, { emit: __emit }) {
|
|
@@ -3636,7 +3639,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3636
3639
|
if (typeof props.modelValue === "string" && props.modelValue) {
|
|
3637
3640
|
try {
|
|
3638
3641
|
isLoading.value = true;
|
|
3639
|
-
const result = await lookupUsers(props.apiBaseUrl || "", props.tenantId || "", props.
|
|
3642
|
+
const result = await lookupUsers(props.apiBaseUrl || "", props.tenantId || "", props.exactSearchKey, [
|
|
3640
3643
|
props.modelValue
|
|
3641
3644
|
]);
|
|
3642
3645
|
options.value = formatUsers(result);
|
|
@@ -3650,7 +3653,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3650
3653
|
const addCurrentUser = async () => {
|
|
3651
3654
|
if (!props.currentUserId || selectedUser.value === props.currentUserId) return;
|
|
3652
3655
|
try {
|
|
3653
|
-
const result = await lookupUsers(props.apiBaseUrl, props.tenantId, props.
|
|
3656
|
+
const result = await lookupUsers(props.apiBaseUrl, props.tenantId, props.exactSearchKey, [props.currentUserId]);
|
|
3654
3657
|
const formattedResults = formatUsers(result);
|
|
3655
3658
|
if (formattedResults.length > 0) {
|
|
3656
3659
|
options.value = formattedResults;
|
|
@@ -3705,6 +3708,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3705
3708
|
emit("change", selectedUserInfo2 || null);
|
|
3706
3709
|
});
|
|
3707
3710
|
return (_ctx, _cache) => {
|
|
3711
|
+
var _a;
|
|
3708
3712
|
return withDirectives((openBlock(), createElementBlock("div", {
|
|
3709
3713
|
ref_key: "containerRef",
|
|
3710
3714
|
ref: containerRef,
|
|
@@ -3725,7 +3729,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3725
3729
|
1
|
|
3726
3730
|
/* TEXT */
|
|
3727
3731
|
),
|
|
3728
|
-
selectedUserInfo.value.tenantId !==
|
|
3732
|
+
selectedUserInfo.value.tenantId !== _ctx.tenantId && selectedUserInfo.value.tenantId && _ctx.tenants[selectedUserInfo.value.tenantId] ? (openBlock(), createElementBlock(
|
|
3729
3733
|
"span",
|
|
3730
3734
|
_hoisted_2,
|
|
3731
3735
|
"@" + toDisplayString(_ctx.tenants[selectedUserInfo.value.tenantId]),
|
|
@@ -3739,18 +3743,18 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3739
3743
|
ref: inputRef,
|
|
3740
3744
|
class: "search-input",
|
|
3741
3745
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchQuery.value = $event),
|
|
3742
|
-
placeholder: selectedUserInfo.value ? "" :
|
|
3746
|
+
placeholder: selectedUserInfo.value ? "" : _ctx.placeholder,
|
|
3743
3747
|
onFocus: handleInputFocus,
|
|
3744
3748
|
onInput: handleInput
|
|
3745
3749
|
}, null, 40, _hoisted_4), [
|
|
3746
3750
|
[vModelText, searchQuery.value]
|
|
3747
3751
|
]),
|
|
3748
3752
|
createCommentVNode(' "我"标签 '),
|
|
3749
|
-
|
|
3753
|
+
_ctx.currentUserId ? (openBlock(), createElementBlock(
|
|
3750
3754
|
"div",
|
|
3751
3755
|
{
|
|
3752
3756
|
key: 1,
|
|
3753
|
-
class: normalizeClass(["me-tag", { disabled:
|
|
3757
|
+
class: normalizeClass(["me-tag", { disabled: _ctx.currentUserId && ((_a = selectedUserInfo.value) == null ? void 0 : _a[_ctx.exactSearchKey]) === _ctx.currentUserId }]),
|
|
3754
3758
|
onClick: _cache[1] || (_cache[1] = ($event) => addCurrentUser())
|
|
3755
3759
|
},
|
|
3756
3760
|
" 我 ",
|
|
@@ -3800,10 +3804,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3800
3804
|
1
|
|
3801
3805
|
/* TEXT */
|
|
3802
3806
|
),
|
|
3803
|
-
user.tenantId !==
|
|
3807
|
+
user.tenantId !== _ctx.tenantId && user.tenantId && _ctx.tenants[user.tenantId] ? (openBlock(), createElementBlock(
|
|
3804
3808
|
"span",
|
|
3805
3809
|
_hoisted_7,
|
|
3806
|
-
"@" + toDisplayString(
|
|
3810
|
+
"@" + toDisplayString(_ctx.tenants[user.tenantId]),
|
|
3807
3811
|
1
|
|
3808
3812
|
/* TEXT */
|
|
3809
3813
|
)) : createCommentVNode("v-if", true)
|
|
@@ -3826,7 +3830,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3826
3830
|
};
|
|
3827
3831
|
}
|
|
3828
3832
|
});
|
|
3829
|
-
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
3833
|
+
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-308925e9"]]);
|
|
3830
3834
|
const _hoisted_1 = { class: "bk-user-selector" };
|
|
3831
3835
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3832
3836
|
...{
|
|
@@ -3841,7 +3845,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3841
3845
|
draggable: { type: Boolean, default: false },
|
|
3842
3846
|
multiple: { type: Boolean, default: false },
|
|
3843
3847
|
currentUserId: { default: "" },
|
|
3844
|
-
|
|
3848
|
+
exactSearchKey: { default: "" }
|
|
3845
3849
|
},
|
|
3846
3850
|
emits: ["update:modelValue", "change"],
|
|
3847
3851
|
setup(__props, { emit: __emit }) {
|
|
@@ -3858,8 +3862,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3858
3862
|
const ids = Array.isArray(props.modelValue) ? props.modelValue : [];
|
|
3859
3863
|
if (ids.length > 0) {
|
|
3860
3864
|
try {
|
|
3861
|
-
console.log(props.
|
|
3862
|
-
const result = await lookupUsers(props.apiBaseUrl, props.tenantId, props.
|
|
3865
|
+
console.log(props.exactSearchKey);
|
|
3866
|
+
const result = await lookupUsers(props.apiBaseUrl, props.tenantId, props.exactSearchKey, ids);
|
|
3863
3867
|
selectedUsers.value = formatUsers(result);
|
|
3864
3868
|
} catch (error) {
|
|
3865
3869
|
console.error("获取选中用户信息失败:", error);
|
|
@@ -3897,12 +3901,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3897
3901
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedUser.value = $event),
|
|
3898
3902
|
"api-base-url": _ctx.apiBaseUrl,
|
|
3899
3903
|
"current-user-id": _ctx.currentUserId,
|
|
3900
|
-
"exact-key": _ctx.
|
|
3904
|
+
"exact-search-key": _ctx.exactSearchKey,
|
|
3901
3905
|
placeholder: _ctx.placeholder,
|
|
3902
3906
|
"tenant-id": _ctx.tenantId,
|
|
3903
3907
|
tenants: unref(tenants),
|
|
3904
3908
|
onChange: handleUpdateUser
|
|
3905
|
-
}, null, 8, ["modelValue", "api-base-url", "current-user-id", "exact-key", "placeholder", "tenant-id", "tenants"])) : (openBlock(), createElementBlock(
|
|
3909
|
+
}, null, 8, ["modelValue", "api-base-url", "current-user-id", "exact-search-key", "placeholder", "tenant-id", "tenants"])) : (openBlock(), createElementBlock(
|
|
3906
3910
|
Fragment,
|
|
3907
3911
|
{ key: 1 },
|
|
3908
3912
|
[
|
|
@@ -3913,13 +3917,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3913
3917
|
"api-base-url": _ctx.apiBaseUrl,
|
|
3914
3918
|
"current-user-id": _ctx.currentUserId,
|
|
3915
3919
|
draggable: _ctx.draggable,
|
|
3916
|
-
"exact-key": _ctx.
|
|
3920
|
+
"exact-search-key": _ctx.exactSearchKey,
|
|
3917
3921
|
placeholder: _ctx.placeholder,
|
|
3918
3922
|
"selected-users": selectedUsers.value,
|
|
3919
3923
|
"tenant-id": _ctx.tenantId,
|
|
3920
3924
|
tenants: unref(tenants),
|
|
3921
3925
|
"onUpdate:selectedUsers": handleUpdateSelectedUsers
|
|
3922
|
-
}, null, 8, ["modelValue", "api-base-url", "current-user-id", "draggable", "exact-key", "placeholder", "selected-users", "tenant-id", "tenants"])
|
|
3926
|
+
}, null, 8, ["modelValue", "api-base-url", "current-user-id", "draggable", "exact-search-key", "placeholder", "selected-users", "tenant-id", "tenants"])
|
|
3923
3927
|
],
|
|
3924
3928
|
2112
|
|
3925
3929
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
@@ -3928,7 +3932,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3928
3932
|
};
|
|
3929
3933
|
}
|
|
3930
3934
|
});
|
|
3931
|
-
const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
3935
|
+
const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fe084750"]]);
|
|
3932
3936
|
export {
|
|
3933
3937
|
BkUserSelector,
|
|
3934
3938
|
BkUserSelector as default
|