feat(search) : display reference alongside name in all entity select components
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
:empty-text="emptyText"
|
||||
size="sm"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
:option-label="formatLabel"
|
||||
:disabled="disabled"
|
||||
server-search
|
||||
@update:modelValue="updateValue"
|
||||
@@ -104,6 +104,12 @@ const updateValue = (value: string | number | null | undefined) => {
|
||||
emit('update:modelValue', String(value))
|
||||
}
|
||||
|
||||
const formatLabel = (option: any) => {
|
||||
if (!option) return ''
|
||||
const name = option.name || 'Composant'
|
||||
return option.reference ? `${name} — ${option.reference}` : name
|
||||
}
|
||||
|
||||
const formatDescription = (option: any) => {
|
||||
const parts: string[] = []
|
||||
const typeName = option?.typeComposant?.name
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
:empty-text="emptyText"
|
||||
size="sm"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
:option-label="formatLabel"
|
||||
:disabled="disabled"
|
||||
server-search
|
||||
@update:modelValue="updateValue"
|
||||
@@ -104,6 +104,12 @@ const updateValue = (value: string | number | null | undefined) => {
|
||||
emit('update:modelValue', String(value))
|
||||
}
|
||||
|
||||
const formatLabel = (option: any) => {
|
||||
if (!option) return ''
|
||||
const name = option.name || 'Pièce'
|
||||
return option.reference ? `${name} — ${option.reference}` : name
|
||||
}
|
||||
|
||||
const formatDescription = (option: any) => {
|
||||
const parts: string[] = []
|
||||
const typeName = option?.typePiece?.name
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
:empty-text="emptyText"
|
||||
size="sm"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
:option-label="formatLabel"
|
||||
:disabled="disabled"
|
||||
server-search
|
||||
@update:modelValue="updateValue"
|
||||
@@ -104,6 +104,12 @@ const updateValue = (value: string | number | null | undefined) => {
|
||||
emit('update:modelValue', String(value))
|
||||
}
|
||||
|
||||
const formatLabel = (option: any) => {
|
||||
if (!option) return ''
|
||||
const name = option.name || 'Produit'
|
||||
return option.reference ? `${name} — ${option.reference}` : name
|
||||
}
|
||||
|
||||
const formatDescription = (option: any) => {
|
||||
const parts: string[] = []
|
||||
const typeName = option?.typeProduct?.name
|
||||
|
||||
@@ -147,7 +147,10 @@ const selectedTypeName = computed(() => {
|
||||
return found?.name || ''
|
||||
})
|
||||
|
||||
const entityOptionLabel = (e: any) => e.name || '(sans nom)'
|
||||
const entityOptionLabel = (e: any) => {
|
||||
const name = e.name || '(sans nom)'
|
||||
return e.reference ? `${name} — ${e.reference}` : name
|
||||
}
|
||||
const entityOptionDescription = (e: any) => e.reference || ''
|
||||
|
||||
const selectedEntitySummary = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user