- aggiornamento catalogo: lista titoli del catalogo
- scheda prodotto libro - migliorata tabella prodotto
This commit is contained in:
@@ -13,7 +13,7 @@ import { tools } from '@tools'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMySelect',
|
||||
emits: ['update:value', 'update:arrvalue', 'changeval'],
|
||||
emits: ['update:value', 'update:arrvalue', 'changeval', 'clear'],
|
||||
props: {
|
||||
options: {
|
||||
type: Array,
|
||||
@@ -141,6 +141,10 @@ export default defineComponent({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
focus: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
withToggle: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
@@ -171,6 +175,11 @@ export default defineComponent({
|
||||
|
||||
const optionsreal: any = []
|
||||
|
||||
const selectMultiServer = ref(null)
|
||||
const selectPickup = ref(null)
|
||||
const selectMultiple = ref(null)
|
||||
const selectGeneric = ref(null)
|
||||
|
||||
const valoriload = computed(() => {
|
||||
return updateArrOptions()
|
||||
})
|
||||
@@ -317,7 +326,29 @@ export default defineComponent({
|
||||
|
||||
function mounted() {
|
||||
optionsreal.value = props.options
|
||||
if (props.focus) {
|
||||
focusVisibleSelect()
|
||||
}
|
||||
|
||||
update()
|
||||
|
||||
}
|
||||
|
||||
function focusVisibleSelect() {
|
||||
|
||||
try {
|
||||
if (selectMultiServer.value && props.multiselect_by_server) {
|
||||
selectMultiServer.value.focus()
|
||||
} else if (selectPickup.value && props.pickup) {
|
||||
selectPickup.value.focus()
|
||||
} else if (selectMultiple.value && props.multiple) {
|
||||
selectMultiple.value.focus()
|
||||
} else {
|
||||
selectGeneric.value.focus()
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Err', e)
|
||||
}
|
||||
}
|
||||
|
||||
function update() {
|
||||
@@ -778,7 +809,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function getOptionLabel(option: any): string {
|
||||
console.log('getOptionLabel', option)
|
||||
// console.log('getOptionLabel', option)
|
||||
if (typeof props.optlab === 'function') {
|
||||
return props.optlab(option); // Se optlab è una funzione, chiamala
|
||||
} else {
|
||||
@@ -786,6 +817,11 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function clear() {
|
||||
emit('clear')
|
||||
myvalue.value = ''
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
|
||||
@@ -804,6 +840,7 @@ export default defineComponent({
|
||||
selectText,
|
||||
getLabelValue,
|
||||
getOptionLabel,
|
||||
clear,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user