corretto filtro Provincia
This commit is contained in:
@@ -27,7 +27,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
setup(props, { attrs, slots, emit }) {
|
setup(props, { attrs, slots, emit }) {
|
||||||
const mytable = 'users'
|
const mytable = 'users'
|
||||||
const { t } = useI18n();
|
const { t } = useI18n()
|
||||||
const globalStore = useGlobalStore()
|
const globalStore = useGlobalStore()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|
||||||
@@ -36,6 +36,7 @@ export default defineComponent({
|
|||||||
const searchList = ref(<ISearchList[]>[])
|
const searchList = ref(<ISearchList[]>[])
|
||||||
|
|
||||||
const search = ref('')
|
const search = ref('')
|
||||||
|
const myrecfiltertoggle = ref(tools.FILTER_ALL)
|
||||||
|
|
||||||
const idSector = computed(() => {
|
const idSector = computed(() => {
|
||||||
let myval: any = null
|
let myval: any = null
|
||||||
@@ -49,6 +50,16 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch(() => myrecfiltertoggle.value, (value: any, oldval: any) => {
|
||||||
|
if (value === tools.FILTER_MYREC) {
|
||||||
|
filtercustom.value = [{ userId: userStore.my._id }]
|
||||||
|
} else {
|
||||||
|
filtercustom.value = []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
function mounted() {
|
function mounted() {
|
||||||
/*arrfilterand.value = [
|
/*arrfilterand.value = [
|
||||||
{
|
{
|
||||||
@@ -164,20 +175,6 @@ export default defineComponent({
|
|||||||
useinput: false,
|
useinput: false,
|
||||||
icon: 'far fa-id-card',
|
icon: 'far fa-id-card',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: '',
|
|
||||||
table: '',
|
|
||||||
key: '',
|
|
||||||
value: 0,
|
|
||||||
type: costanti.FieldType.separator,
|
|
||||||
arrvalue: [],
|
|
||||||
addall: true,
|
|
||||||
filter: null,
|
|
||||||
showcount: true,
|
|
||||||
useinput: false,
|
|
||||||
notinsearch: true,
|
|
||||||
icon: '',
|
|
||||||
},
|
|
||||||
/*{
|
/*{
|
||||||
label: 'Regione',
|
label: 'Regione',
|
||||||
table: 'regions',
|
table: 'regions',
|
||||||
@@ -225,6 +222,20 @@ export default defineComponent({
|
|||||||
filteradv: true,
|
filteradv: true,
|
||||||
//icon: 'swap_horizontal_circle',
|
//icon: 'swap_horizontal_circle',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '',
|
||||||
|
table: '',
|
||||||
|
key: '',
|
||||||
|
value: 0,
|
||||||
|
type: costanti.FieldType.separator,
|
||||||
|
arrvalue: [],
|
||||||
|
addall: true,
|
||||||
|
filter: null,
|
||||||
|
showcount: true,
|
||||||
|
useinput: false,
|
||||||
|
notinsearch: true,
|
||||||
|
icon: '',
|
||||||
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -335,6 +346,7 @@ export default defineComponent({
|
|||||||
idSector,
|
idSector,
|
||||||
search,
|
search,
|
||||||
doSearch,
|
doSearch,
|
||||||
|
myrecfiltertoggle,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,6 +2,18 @@
|
|||||||
<div class="bi-border-all">
|
<div class="bi-border-all">
|
||||||
<div class="q-ma-xs q-gutter-xs q-pa-xs">
|
<div class="q-ma-xs q-gutter-xs q-pa-xs">
|
||||||
|
|
||||||
|
<div class="text-center">
|
||||||
|
<q-btn-toggle
|
||||||
|
v-model="myrecfiltertoggle"
|
||||||
|
push
|
||||||
|
glossy
|
||||||
|
toggle-color="primary"
|
||||||
|
:options="[
|
||||||
|
{label: 'Tutti', value: tools.FILTER_ALL},
|
||||||
|
{label: 'Personali', value: tools.FILTER_MYREC},
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div v-if="false" class="q-mr-sm">
|
<div v-if="false" class="q-mr-sm">
|
||||||
<q-input
|
<q-input
|
||||||
v-model="search" filled dense type="search" debounce="500" :hint="t('finder.search_skill')"
|
v-model="search" filled dense type="search" debounce="500" :hint="t('finder.search_skill')"
|
||||||
@@ -26,7 +38,7 @@
|
|||||||
:nodataLabel="idSector > 0 ? 'Nessuna Competenza trovata': 'Selezionare un Settore'"
|
:nodataLabel="idSector > 0 ? 'Nessuna Competenza trovata': 'Selezionare un Settore'"
|
||||||
:prop_search="true"
|
:prop_search="true"
|
||||||
:finder="true"
|
:finder="true"
|
||||||
:choose_visutype="true"
|
:choose_visutype="$q.screen.gt.xs"
|
||||||
:butt_modif_new="false"
|
:butt_modif_new="false"
|
||||||
noresultLabel="Il filtro selezionato non ha trovato nessun risultato"
|
noresultLabel="Il filtro selezionato non ha trovato nessun risultato"
|
||||||
:arrfilters="arrfilterand"
|
:arrfilters="arrfilterand"
|
||||||
|
|||||||
@@ -431,13 +431,23 @@ export default defineComponent({
|
|||||||
|
|
||||||
if (searchList.value) {
|
if (searchList.value) {
|
||||||
for (const item of searchList.value) {
|
for (const item of searchList.value) {
|
||||||
|
|
||||||
//searchList.value.forEach((item: ISearchList) => {
|
//searchList.value.forEach((item: ISearchList) => {
|
||||||
if (!item.notinsearch) {
|
if (!item.notinsearch) {
|
||||||
let objitem: any = {}
|
let objitem: any = {}
|
||||||
// console.log(' item ', item)
|
// console.log(' item ', item)
|
||||||
if (item.value > 0) {
|
|
||||||
|
if (item.table === 'provinces') {
|
||||||
|
let obj: any = {}
|
||||||
|
|
||||||
|
obj['mycities.prov'] = item.value
|
||||||
|
if (item.value !== '') {
|
||||||
|
filtersearch3or.push(obj)
|
||||||
|
}
|
||||||
|
} else if (item.value > 0) {
|
||||||
objitem[item.key] = item.value
|
objitem[item.key] = item.value
|
||||||
filtersearch.push(objitem)
|
filtersearch.push(objitem)
|
||||||
|
|
||||||
} else if (item.arrvalue.length > 0) {
|
} else if (item.arrvalue.length > 0) {
|
||||||
const myarr = item.arrvalue.filter((value: any) => {
|
const myarr = item.arrvalue.filter((value: any) => {
|
||||||
if (typeof value === 'number') {
|
if (typeof value === 'number') {
|
||||||
@@ -448,20 +458,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
let arr2: any = []
|
let arr2: any = []
|
||||||
|
|
||||||
if (item.table === 'provinces') {
|
if (item.table !== 'provinces') {
|
||||||
arr2 = []
|
|
||||||
myarr.forEach((myval: any) => {
|
|
||||||
let objitem3: any = {}
|
|
||||||
objitem3['mycities.prov'] = myval
|
|
||||||
arr2.push(objitem3)
|
|
||||||
})
|
|
||||||
let obj2: any = {
|
|
||||||
$or: arr2
|
|
||||||
}
|
|
||||||
if (arr2.length > 0) {
|
|
||||||
filtersearch3or = arr2
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
myarr.forEach((myval: any) => {
|
myarr.forEach((myval: any) => {
|
||||||
let objitem2: any = {}
|
let objitem2: any = {}
|
||||||
objitem2[item.key] = myval
|
objitem2[item.key] = myval
|
||||||
|
|||||||
@@ -106,9 +106,8 @@
|
|||||||
<div v-if="searchList"
|
<div v-if="searchList"
|
||||||
:class="$q.screen.lt.sm ? `` : `row` + ` text-blue `">
|
:class="$q.screen.lt.sm ? `` : `row` + ` text-blue `">
|
||||||
<span v-for="(item, index) in searchList" :key="index">
|
<span v-for="(item, index) in searchList" :key="index">
|
||||||
<div class="text-center" v-if="(item.type === costanti.FieldType.separator)">
|
<div class="text-center q-my-xs" v-if="(item.type === costanti.FieldType.separator)">
|
||||||
<q-btn rounded size="md" dense :icon="!showfilteradv ? 'fas fa-arrow-down' : 'fas fa-arrow-up'" label="Filtri Avanzati" @click="showfilteradv = !showfilteradv"></q-btn>
|
<q-btn rounded flat size="sm" dense :icon="!showfilteradv ? 'fas fa-arrow-down' : 'fas fa-arrow-up'" label="Filtri Avanzati" @click="showfilteradv = !showfilteradv"></q-btn>
|
||||||
<q-separator class="q-my-sm"></q-separator>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<CMySelect
|
<CMySelect
|
||||||
@@ -235,7 +234,7 @@
|
|||||||
|
|
||||||
<q-space></q-space>
|
<q-space></q-space>
|
||||||
<q-select
|
<q-select
|
||||||
v-if="mytable && pagination.rowsNumber > 0 && (prop_search || canEdit) && showCol"
|
v-if="mytable && pagination.rowsNumber > 0 && (prop_search || canEdit) && showCol && myvertical === 0"
|
||||||
v-model="colVisib"
|
v-model="colVisib"
|
||||||
rounded
|
rounded
|
||||||
outlined
|
outlined
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
:input-class="myclass"
|
:input-class="myclass"
|
||||||
:options="valori"
|
:options="valori"
|
||||||
:option-value="optval"
|
:option-value="optval"
|
||||||
|
options-selected-class="text-deep-blue"
|
||||||
class="combowidth"
|
class="combowidth"
|
||||||
style="min-width: 250px"
|
style="min-width: 250px"
|
||||||
>
|
>
|
||||||
@@ -131,6 +132,7 @@
|
|||||||
emit-value
|
emit-value
|
||||||
stack-label
|
stack-label
|
||||||
:options="valori"
|
:options="valori"
|
||||||
|
options-selected-class="text-deep-blue"
|
||||||
:option-value="optval"
|
:option-value="optval"
|
||||||
:option-label="optlab"
|
:option-label="optlab"
|
||||||
:dense="dense">
|
:dense="dense">
|
||||||
@@ -189,7 +191,7 @@
|
|||||||
@new-value="newvaluefuncfirst"
|
@new-value="newvaluefuncfirst"
|
||||||
emit-value
|
emit-value
|
||||||
input-debounce="0"
|
input-debounce="0"
|
||||||
options-selected-class="text-deep-orange"
|
options-selected-class="text-deep-blue"
|
||||||
map-options
|
map-options
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
class="combowidth">
|
class="combowidth">
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ export const tools = {
|
|||||||
TABBED_HOME: 't-home',
|
TABBED_HOME: 't-home',
|
||||||
TABBED_NAVE: 't-nave',
|
TABBED_NAVE: 't-nave',
|
||||||
|
|
||||||
|
FILTER_ALL: 0,
|
||||||
|
FILTER_MYREC: 1,
|
||||||
|
|
||||||
COOK_SEARCH: 'SEARCH_',
|
COOK_SEARCH: 'SEARCH_',
|
||||||
|
|
||||||
FRIENDS_SEARCH: 'FR_SE',
|
FRIENDS_SEARCH: 'FR_SE',
|
||||||
|
|||||||
Reference in New Issue
Block a user