Поиск карты при добавлении #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) => {
|
watch(() => isCardInArchive.value, (val) => {
|
||||||
if (val)
|
if (val)
|
||||||
onResetArchiveInfo({
|
onResetArchiveInfo({
|
||||||
@@ -193,6 +209,7 @@ watch(() => isCardInArchive.value, (val) => {
|
|||||||
filterable
|
filterable
|
||||||
:loading="loadingFilterPatients"
|
:loading="loadingFilterPatients"
|
||||||
:options="filteredPatients"
|
:options="filteredPatients"
|
||||||
|
:filter="(pattern, option) => onFilter(pattern, option)"
|
||||||
v-model:value="archiveInfo.id"
|
v-model:value="archiveInfo.id"
|
||||||
@update:value="(val) => updateValueSearch(val)"
|
@update:value="(val) => updateValueSearch(val)"
|
||||||
@search="handleSearchCard"
|
@search="handleSearchCard"
|
||||||
|
|||||||
Reference in New Issue
Block a user