Ora cambiando Settore, la Categoria viene sbiancata su "Nessuno" (anche se ancora rimane visivamente selezionato)
i campi obbligatori non funziona il controllo? (Erano i campi di tipo Array) Aggiunta Categoria Ecovillaggi / Comunità + AutoProduzione Aggiunte consulenza, affrancamento, supporto.. su temi di LAVORO Quando inserisci un nuovo annuncio, prendi di default tutti i filtri visualizzati Aggiungere bottone "Condividi Pagina" sui gruppi
This commit is contained in:
@@ -97,6 +97,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
addnone: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
dense: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
@@ -220,7 +225,6 @@ export default defineComponent({
|
||||
// localStorage.setItem(props.tablesel + '_' + newval, valori.value[newval])
|
||||
|
||||
if (props.type_out === costanti.FieldType.object) {
|
||||
// debugger;
|
||||
const arrout = []
|
||||
for (const val of newval) {
|
||||
let obj: any = {}
|
||||
@@ -264,7 +268,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function update() {
|
||||
// console.log('update')
|
||||
console.log('update')
|
||||
// console.log(' #### mounted myselect', props.options, 'arrvalue', myarrvalue.value)
|
||||
let rec: any
|
||||
if (optionsreal.value) {
|
||||
@@ -285,6 +289,15 @@ export default defineComponent({
|
||||
|
||||
arrtempOpt.value.push(myobj)
|
||||
}
|
||||
if (props.addnone) {
|
||||
let myobj: any = {}
|
||||
if (typeof props.optlab === 'string') {
|
||||
myobj[props.optlab] = '[Nessuno]'
|
||||
myobj[props.optval] = costanti.FILTER_NESSUNO
|
||||
}
|
||||
|
||||
arrtempOpt.value = [myobj, ...arrtempOpt.value]
|
||||
}
|
||||
for (let i = 0; i < num; i++) {
|
||||
const itemId = parseInt(localStorage.getItem(props.tablesel + i + props.optval)!)
|
||||
const itemlab = localStorage.getItem(props.tablesel + i + props.optlab)
|
||||
@@ -326,6 +339,16 @@ export default defineComponent({
|
||||
myarrvalue.value.push(rec[`${props.optval}`])
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (props.addnone) {
|
||||
let myobj: any = {}
|
||||
if (typeof props.optlab === 'string') {
|
||||
myobj[props.optlab] = '[Nessuno]'
|
||||
myobj[props.optval] = costanti.FILTER_NESSUNO
|
||||
}
|
||||
|
||||
myarrvalue.value = [myobj, ...myarrvalue.value]
|
||||
}
|
||||
}
|
||||
|
||||
if (props.tablesel === 'friendsandme') {
|
||||
@@ -383,7 +406,7 @@ export default defineComponent({
|
||||
|
||||
// console.log(props.col.jointable, props.filter)
|
||||
if (props.col.jointable) {
|
||||
optionsreal.value = globalStore.getTableJoinByName(props.col.jointable, props.col.addall, props.filter)
|
||||
optionsreal.value = globalStore.getTableJoinByName(props.col.jointable, props.col.addall, props.col.addnone, props.filter)
|
||||
// console.log('optionsreal.value', optionsreal.value)
|
||||
} else {
|
||||
optionsreal.value = props.options
|
||||
@@ -402,7 +425,13 @@ export default defineComponent({
|
||||
if (props.multiple) {
|
||||
myarr = myarr.filter((rec: any) => rec[props.filter_field] === needle)
|
||||
} else {
|
||||
myarr = myarr.filter((rec: any) => rec[props.filter_field].includes(needle))
|
||||
|
||||
myarr = myarr.filter((rec: any) => {
|
||||
if (tools.isArray(rec[props.filter_field]))
|
||||
return rec[props.filter_field].includes(needle)
|
||||
else
|
||||
return false
|
||||
})
|
||||
}
|
||||
// console.log(' RISSSSSSSSS: ', myarr)
|
||||
}
|
||||
@@ -420,6 +449,17 @@ export default defineComponent({
|
||||
// console.log(' myarr: ', myarr)
|
||||
}
|
||||
|
||||
if (props.addnone) {
|
||||
let myobj: any = {}
|
||||
if (typeof props.optlab === 'string') {
|
||||
myobj[props.optlab] = '[Nessuno]'
|
||||
myobj[props.optval] = costanti.FILTER_NESSUNO
|
||||
}
|
||||
|
||||
if (myarr)
|
||||
myarr = [myobj, ...myarr]
|
||||
}
|
||||
|
||||
// console.log(' myarr: ', myarr)
|
||||
return myarr
|
||||
}
|
||||
@@ -505,6 +545,15 @@ export default defineComponent({
|
||||
myobj[props.optval] = costanti.FILTER_TUTTI
|
||||
}
|
||||
|
||||
myarr = [myobj, ...myarr]
|
||||
}
|
||||
if (props.addnone) {
|
||||
let myobj: any = {}
|
||||
if (typeof props.optlab === 'string') {
|
||||
myobj[props.optlab] = '[Nessuno]'
|
||||
myobj[props.optval] = costanti.FILTER_NESSUNO
|
||||
}
|
||||
|
||||
myarr = [myobj, ...myarr]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user