- Cerca Amici persone: filtro per Regione o Provincia

This commit is contained in:
Surya Paolo
2023-03-23 00:09:59 +01:00
parent 9745133e81
commit c28c6c4d8b
11 changed files with 48 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.81" APP_VERSION="0.5.82"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.81" APP_VERSION="0.5.82"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.81" APP_VERSION="0.5.82"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.81" APP_VERSION="0.5.82"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.81" APP_VERSION="0.5.82"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.81" APP_VERSION="0.5.82"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="14" APP_ID="14"
DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -62,6 +62,11 @@ export default defineComponent({
required: false, required: false,
default: '', default: '',
}, },
prop_showfilter: {
type: Boolean,
required: false,
default: false,
},
hint: { hint: {
type: String, type: String,
required: false, required: false,
@@ -102,6 +107,11 @@ export default defineComponent({
required: false, required: false,
default: false, default: false,
}, },
finder_noNullFilters: {
type: Boolean,
required: false,
default: false,
},
vertical: { vertical: {
type: Number, type: Number,
required: false, required: false,
@@ -640,6 +650,22 @@ export default defineComponent({
return myobj return myobj
} }
function getNumFilterSelected(): number {
let numfilter = 0
for (const item of searchList.value) {
if (!item.notinsearch) {
if (item.value && item.value !== -100) {
console.log(item.label, item.value)
numfilter++
}
}
}
return numfilter
}
// emulate ajax call // emulate ajax call
// SELECT * FROM ... WHERE...LIMIT... // SELECT * FROM ... WHERE...LIMIT...
async function fetchFromServer(startRow: any, endRow: any, param_myfilter: any, param_myfilterand: any, sortBy: any, descending: any) { async function fetchFromServer(startRow: any, endRow: any, param_myfilter: any, param_myfilterand: any, sortBy: any, descending: any) {
@@ -883,7 +909,7 @@ export default defineComponent({
}*/ }*/
} }
// if ((false && nosearch && props.finder) || (props.finder_noNull && nosearch)) { // if ((false && nosearch && props.finder) || (props.finder_noNull && nosearch)) {
if (props.finder_noNull && nosearch) { if ((props.finder_noNull || (props.finder_noNullFilters && filtersearch3and.values.length === 0)) && nosearch) {
returnedData.value = [] returnedData.value = []
returnedCount = 0 returnedCount = 0
return true return true
@@ -2278,6 +2304,7 @@ export default defineComponent({
doSort, doSort,
ordinam, ordinam,
ordinam_desc, ordinam_desc,
getNumFilterSelected,
} }
} }
}) })

View File

@@ -78,7 +78,7 @@
--> -->
</div> </div>
<q-slide-transition> <q-slide-transition>
<div v-show="showfilter"> <div v-show="showfilter || prop_showfilter">
<div <div
v-show="searchList" v-show="searchList"
:class="$q.screen.lt.sm ? `` : `row` + ` text-blue `" :class="$q.screen.lt.sm ? `` : `row` + ` text-blue `"
@@ -249,7 +249,9 @@
color="positive" color="positive"
icon="fas fa-filter" icon="fas fa-filter"
@click="showfilter = !showfilter" @click="showfilter = !showfilter"
></q-btn> ><q-badge v-if="getNumFilterSelected()" color="red" floating transparent> {{ getNumFilterSelected() }} </q-badge>
</q-btn>
<q-btn <q-btn
dense dense
color="orange" color="orange"
@@ -269,7 +271,7 @@
label="Ordinamento:" label="Ordinamento:"
emit-value emit-value
map-options map-options
style="min-width:120px;" style="min-width: 120px"
> >
</q-select> </q-select>
<q-btn <q-btn
@@ -313,7 +315,7 @@
{{ pagination.rowsNumber }} elemento trovato {{ pagination.rowsNumber }} elemento trovato
</div> </div>
<div v-if="pagination.rowsNumber > 1 && prop_search"> <div v-if="pagination.rowsNumber > 1 && prop_search">
{{ pagination.rowsNumber }} {{labelElemFind}} {{ pagination.rowsNumber }} {{ labelElemFind }}
</div> </div>
<div v-if="choose_visutype && $q.screen.gt.xs" class=""> <div v-if="choose_visutype && $q.screen.gt.xs" class="">

View File

@@ -263,7 +263,7 @@
{{ $t('groups.accept_group') }} {{ $t('groups.accept_group') }}
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup @click="showAccountInfo = true"> <q-item v-if="circuit" clickable v-close-popup @click="showAccountInfo = true">
<q-item-section avatar> <q-item-section avatar>
<q-icon name="fas fa-info" /> <q-icon name="fas fa-info" />
</q-item-section> </q-item-section>
@@ -427,7 +427,7 @@
{{ $t('circuit.accept') }} {{ $t('circuit.accept') }}
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup @click="showAccountInfo = true"> <q-item v-if="circuit" clickable v-close-popup @click="showAccountInfo = true">
<q-item-section avatar> <q-item-section avatar>
<q-icon name="fas fa-info" /> <q-icon name="fas fa-info" />
</q-item-section> </q-item-section>
@@ -854,7 +854,7 @@
$t('handshake.remove_from_myhandshake') $t('handshake.remove_from_myhandshake')
}}</q-item-section> }}</q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup @click="showAccountInfo = true"> <q-item v-if="circuit" clickable v-close-popup @click="showAccountInfo = true">
<q-item-section avatar> <q-item-section avatar>
<q-icon name="fas fa-info" /> <q-icon name="fas fa-info" />
</q-item-section> </q-item-section>

View File

@@ -85,6 +85,7 @@ export default defineComponent({
username: 1, username: 1,
name: 1, name: 1,
surname: 1, surname: 1,
'profile.handshake': 1,
'profile.img': 1, 'profile.img': 1,
'profile.mygroups': 1, 'profile.mygroups': 1,
'profile.qualifica': 1, 'profile.qualifica': 1,

View File

@@ -24,13 +24,15 @@
:vertical="costanti.VISUTABLE_LISTA" :vertical="costanti.VISUTABLE_LISTA"
nodataLabel=" " nodataLabel=" "
:prop_search="true" :prop_search="true"
:prop_showfilter="true"
hint="Username o nome da trovare" hint="Username o nome da trovare"
:finder="true" :finder="true"
:choose_visutype="true" :choose_visutype="true"
:finder_noNull="true" :finder_noNull="false"
:finder_noNullFilters="false"
:options="shared_consts.OPTIONS_SEARCH_USER_ALL_WORDS" :options="shared_consts.OPTIONS_SEARCH_USER_ALL_WORDS"
:butt_modif_new="false" :butt_modif_new="false"
noresultLabel="Username non trovato" noresultLabel="Username o nome non trovato"
:arrfilters="arrfilterand" :arrfilters="arrfilterand"
:filtercustom="filtercustom" :filtercustom="filtercustom"
:prop_searchList="searchList" :prop_searchList="searchList"