Поиск карты при добавлении #1
Some checks failed
Build and Push Docker Image / test (push) Has been cancelled
Build and Push Docker Image / build (push) Has been cancelled

This commit is contained in:
brusnitsyn
2026-01-19 09:09:09 +09:00
parent 0f4ce51ab3
commit 23daeb6f7e

View File

@@ -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"