- Aggiunto Filtri

- Finder
This commit is contained in:
Paolo Arena
2021-12-11 00:25:35 +01:00
parent c517dedd47
commit cab0562de7
25 changed files with 465 additions and 48 deletions

View File

@@ -1,8 +1,9 @@
import { defineComponent, onMounted, ref } from 'vue'
import { computed, defineComponent, onMounted, ref } from 'vue'
import { useI18n } from '@src/boot/i18n'
import { useUserStore } from '@store/UserStore'
import { useGlobalStore } from '@store/globalStore'
import { useQuasar } from 'quasar'
import { costanti } from '@costanti'
export default defineComponent({
name: 'CMySelect',
@@ -32,6 +33,11 @@ export default defineComponent({
required: false,
default: true
},
addall: {
type: Boolean,
required: false,
default: false
},
dense: {
type: Boolean,
required: false,
@@ -60,6 +66,21 @@ export default defineComponent({
const myvalue = ref(<string | number>'')
const valori = computed(() => {
let myarr = props.options
if (props.addall) {
let myobj: any = {}
if (typeof props.optlab === 'string') {
myobj[props.optlab] = '(Tutti)'
myobj[props.optval] = costanti.FILTER_TUTTI
}
myarr = [myobj, ...myarr]
}
return myarr
})
function changeval(newval: any) {
console.log('changeval', newval)
myvalue.value = newval
@@ -101,6 +122,7 @@ export default defineComponent({
return {
changeval,
myvalue,
valori,
}
}
})

View File

@@ -11,7 +11,7 @@
input-debounce="0"
@new-value="newvaluefunc"
new-value-mode="add-unique"
:options="options"
:options="valori"
:option-value="optval"
:option-label="optlab"
@update:model-value="changeval"
@@ -27,7 +27,7 @@
:dense="dense"
:input-class="myclass"
:model-value="myvalue"
:options="options"
:options="valori"
:option-value="optval"
:option-label="optlab"
@update:model-value="changeval"