Поиск карты при добавлении #1
This commit is contained in:
@@ -167,6 +167,22 @@ const updateValueSearch = async (value) => {
|
||||
})
|
||||
}
|
||||
|
||||
const onFilter = (pattern, option) => {
|
||||
if (!pattern) return true
|
||||
|
||||
const normalizeText = (text) => {
|
||||
return text
|
||||
.toLowerCase()
|
||||
.replace(/[-\s]/g, '') // удаляем дефисы и пробелы
|
||||
.trim();
|
||||
}
|
||||
|
||||
const normalizedPattern = normalizeText(pattern)
|
||||
const normalizedLabel = normalizeText(option.label || '')
|
||||
|
||||
return normalizedLabel.includes(normalizedPattern)
|
||||
}
|
||||
|
||||
watch(() => isCardInArchive.value, (val) => {
|
||||
if (val)
|
||||
onResetArchiveInfo({
|
||||
@@ -193,6 +209,7 @@ watch(() => isCardInArchive.value, (val) => {
|
||||
filterable
|
||||
:loading="loadingFilterPatients"
|
||||
:options="filteredPatients"
|
||||
:filter="(pattern, option) => onFilter(pattern, option)"
|
||||
v-model:value="archiveInfo.id"
|
||||
@update:value="(val) => updateValueSearch(val)"
|
||||
@search="handleSearchCard"
|
||||
|
||||
Reference in New Issue
Block a user