Skip to content

Commit

Permalink
feat(frontend): 告警通知优化 TencentBlueKing#8366
Browse files Browse the repository at this point in the history
  • Loading branch information
3octaves committed Jan 21, 2025
1 parent 3d93f44 commit dbf31a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dbm-ui/frontend/patch/user-selector/selector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -868,9 +868,9 @@
}
try {
loading.value = true;
const pasteStr = event.clipboardData.getData('text').replace(/\s/g, '');
const pasteStr = event.clipboardData.getData('text').replace(/[^\S\r\n]/g, '');
const values = pasteStr
.split(/,|;/)
.split(/\s*[||,,;;、\t/\s]\s*/g)
.map((value) => pasteFormatter.value(value))
.filter((value) => value.length);
const uniqueValues = [...new Set(values)];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
:default-alternate="defaultAlternate"
:disabled="disabled"
:fuzzy-search-method="fuzzySearchMethod"
:paste-validator="pasteValidator"
:render-list="renderList"
:render-tag="renderTag"
:search-from-default-alternate="false"
Expand Down Expand Up @@ -227,6 +228,13 @@
userSelectorRef.value.search();
};

const pasteValidator = (values: string[]) =>
getUserList({
exact_lookups: values.join(','),
offset: 0,
limit: -1,
}).then((userResult) => userResult.results.map((userItem) => userItem.username));

defineExpose<Exposes>({
getSelectedReceivers() {
return modelValue.value.map((modelValueItem) => ({
Expand Down

0 comments on commit dbf31a4

Please sign in to comment.