feat: 拼音子序列匹配+产品名拼音补全+滴数框缩窄
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Failing after 5s
Test / e2e-test (push) Has been skipped
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Failing after 5s
PR Preview / deploy-preview (pull_request) Has been skipped
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Failing after 5s
Test / e2e-test (push) Has been skipped
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Failing after 5s
PR Preview / deploy-preview (pull_request) Has been skipped
- 拼音匹配支持子序列(js匹配紧致霜),排序: 前缀>子串>子序列 - 补全产品名拼音(身紧致霜膏膜等) - 滴数输入框从65/70px缩至50px Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -413,7 +413,7 @@ import { useUiStore } from '../stores/ui'
|
||||
import { api } from '../composables/useApi'
|
||||
import { showConfirm, showPrompt } from '../composables/useDialog'
|
||||
import { parseSingleBlock, parseMultiRecipes } from '../composables/useSmartPaste'
|
||||
import { matchesPinyinInitials } from '../composables/usePinyinMatch'
|
||||
import { matchesPinyinInitials, pinyinMatchScore } from '../composables/usePinyinMatch'
|
||||
import RecipeCard from '../components/RecipeCard.vue'
|
||||
import TagPicker from '../components/TagPicker.vue'
|
||||
import RecipeDetailOverlay from '../components/RecipeDetailOverlay.vue'
|
||||
@@ -866,11 +866,11 @@ function filteredOilNames(search) {
|
||||
const results = oils.oilNames.filter(name =>
|
||||
name.toLowerCase().includes(q) || matchesPinyinInitials(name, q)
|
||||
)
|
||||
// Sort: pinyin prefix match first, then name contains, then rest
|
||||
// Sort: prefix > substring > subsequence > name match only
|
||||
results.sort((a, b) => {
|
||||
const aPin = matchesPinyinInitials(a, q) ? 0 : 1
|
||||
const bPin = matchesPinyinInitials(b, q) ? 0 : 1
|
||||
if (aPin !== bPin) return aPin - bPin
|
||||
const sa = pinyinMatchScore(a, q), sb = pinyinMatchScore(b, q)
|
||||
const scoreA = sa >= 0 ? sa : 3, scoreB = sb >= 0 ? sb : 3
|
||||
if (scoreA !== scoreB) return scoreA - scoreB
|
||||
return a.localeCompare(b, 'zh')
|
||||
})
|
||||
return results
|
||||
@@ -2112,7 +2112,7 @@ watch(() => recipeStore.recipes, () => {
|
||||
.editor-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 8px; }
|
||||
.editor-table th { text-align: left; padding: 6px 4px; color: #999; font-weight: 500; font-size: 12px; border-bottom: 1px solid #eee; }
|
||||
.editor-table td { padding: 6px 4px; border-bottom: 1px solid #f5f5f5; }
|
||||
.editor-drops { width: 65px; padding: 6px 8px; border: 1.5px solid #d4cfc7; border-radius: 8px; font-size: 13px; text-align: center; outline: none; font-family: inherit; }
|
||||
.editor-drops { width: 50px; padding: 6px 4px; border: 1.5px solid #d4cfc7; border-radius: 8px; font-size: 13px; text-align: center; outline: none; font-family: inherit; }
|
||||
.editor-drops:focus { border-color: #7ec6a4; }
|
||||
.drops-with-unit { display: flex; align-items: center; gap: 2px; }
|
||||
.unit-hint { font-size: 11px; color: #b0aab5; white-space: nowrap; }
|
||||
|
||||
Reference in New Issue
Block a user