From cac35f9243f929d5297f52a81195dd63966e502e Mon Sep 17 00:00:00 2001 From: paoloar77 Date: Mon, 14 Feb 2022 11:30:53 +0100 Subject: [PATCH] Filtri avanzati a scomparsa --- _ALL_SITES/freeplanet.app/db/static_data.ts | 4 +- _ALL_SITES/insiemesipuo.app/db/static_data.ts | 4 +- .../popolodelnuovomondo.app/db/static_data.ts | 4 +- src/components/CFinder/CFinder.ts | 69 ++++++++++++------- src/components/CGridTableRec/CGridTableRec.ts | 8 +++ .../CGridTableRec/CGridTableRec.vue | 14 +++- src/components/CMainView/CMainView.vue | 2 +- src/components/CMySelect/CMySelect.ts | 14 +++- src/components/CMySelect/CMySelect.vue | 18 ++--- src/db/static_data.ts | 4 +- src/model/GlobalStore.ts | 1 + .../{work/work.scss => bacheca/bacheca.scss} | 0 src/root/{work/work.ts => bacheca/bacheca.ts} | 2 +- .../{work/work.vue => bacheca/bacheca.vue} | 4 +- src/store/Modules/costanti.ts | 1 + 15 files changed, 99 insertions(+), 50 deletions(-) rename src/root/{work/work.scss => bacheca/bacheca.scss} (100%) rename src/root/{work/work.ts => bacheca/bacheca.ts} (98%) rename src/root/{work/work.vue => bacheca/bacheca.vue} (83%) diff --git a/_ALL_SITES/freeplanet.app/db/static_data.ts b/_ALL_SITES/freeplanet.app/db/static_data.ts index 659413ca..c615dfb2 100755 --- a/_ALL_SITES/freeplanet.app/db/static_data.ts +++ b/_ALL_SITES/freeplanet.app/db/static_data.ts @@ -382,10 +382,10 @@ const baseroutes: IListRoutes[] = [ { active: true, order: 10, - path: '/work', + path: '/bacheca', materialIcon: 'fas fa-bullhorn', name: 'mypages.work', - component: () => import('@/root/work/work.vue'), + component: () => import('@/root/bacheca/bacheca.vue'), meta: { requiresAuth: true }, inmenu: true, infooter: true, diff --git a/_ALL_SITES/insiemesipuo.app/db/static_data.ts b/_ALL_SITES/insiemesipuo.app/db/static_data.ts index c291a704..35538e13 100755 --- a/_ALL_SITES/insiemesipuo.app/db/static_data.ts +++ b/_ALL_SITES/insiemesipuo.app/db/static_data.ts @@ -382,10 +382,10 @@ const baseroutes: IListRoutes[] = [ { active: true, order: 100, - path: '/work', + path: '/bacheca', materialIcon: 'fas fa-bullhorn', name: 'mypages.work', - component: () => import('@/root/work/work.vue'), + component: () => import('@/root/bacheca/bacheca.vue'), meta: { requiresAuth: true }, inmenu: true, infooter: true, diff --git a/_ALL_SITES/popolodelnuovomondo.app/db/static_data.ts b/_ALL_SITES/popolodelnuovomondo.app/db/static_data.ts index f3d173ff..cc610b2e 100755 --- a/_ALL_SITES/popolodelnuovomondo.app/db/static_data.ts +++ b/_ALL_SITES/popolodelnuovomondo.app/db/static_data.ts @@ -382,10 +382,10 @@ const baseroutes: IListRoutes[] = [ { active: true, order: 10, - path: '/work', + path: '/bacheca', materialIcon: 'fas fa-bullhorn', name: 'mypages.work', - component: () => import('@/root/work/work.vue'), + component: () => import('@/root/bacheca/bacheca.vue'), meta: { requiresAuth: true }, inmenu: true, infooter: true, diff --git a/src/components/CFinder/CFinder.ts b/src/components/CFinder/CFinder.ts index 81fc3a78..277e11ab 100755 --- a/src/components/CFinder/CFinder.ts +++ b/src/components/CFinder/CFinder.ts @@ -90,6 +90,32 @@ export default defineComponent({ searchList.value = [ + { + label: 'Provincia', + table: 'provinces', + key: 'idProvince', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + 'provinces', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + filter: null, + useinput: true, + icon: 'flag', + }, + { + label: 'Città', + table: 'cities', + key: 'idCity', + type: costanti.FieldType.select_by_server, + value: tools.getCookie(tools.COOK_SEARCH + 'cities', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + useinput: true, + filter: null, + // filter: getFilterCitiesByProvince, + // param1: shared_consts.PARAM_SHOW_PROVINCE, + tablesel: 'cities', + }, { label: 'Offro/Cerco', table: 'adtypes', @@ -138,6 +164,20 @@ export default defineComponent({ useinput: false, 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', table: 'regions', @@ -148,32 +188,6 @@ export default defineComponent({ filter: null, useinput: true, },*/ - { - label: 'Provincia', - table: 'provinces', - key: 'idProvince', - type: costanti.FieldType.multiselect, - value: 0, - addall: true, - arrvalue: tools.getCookie(tools.COOK_SEARCH + 'provinces', [costanti.FILTER_TUTTI]), - filter: null, - useinput: true, - icon: 'flag', - }, - { - label: 'Città', - table: 'cities', - key: 'idCity', - type: costanti.FieldType.multiselect_by_server, - value: 0, - addall: true, - arrvalue: tools.getCookie(tools.COOK_SEARCH + 'cities', [costanti.FILTER_TUTTI]), - useinput: true, - filter: null, - // filter: getFilterCitiesByProvince, - // param1: shared_consts.PARAM_SHOW_PROVINCE, - tablesel: 'cities', - }, { label: 'Livello', table: 'levels', @@ -184,6 +198,7 @@ export default defineComponent({ type: costanti.FieldType.select, filter: null, useinput: false, + filteradv: true, }, { label: 'Stato', @@ -195,6 +210,7 @@ export default defineComponent({ filter: null, useinput: false, icon: 'mood', + filteradv: true, }, { label: 'Contributo', @@ -206,6 +222,7 @@ export default defineComponent({ filter: null, useinput: false, icon: 'currency_exchange', + filteradv: true, //icon: 'swap_horizontal_circle', }, diff --git a/src/components/CGridTableRec/CGridTableRec.ts b/src/components/CGridTableRec/CGridTableRec.ts index 8f506950..de75fdfa 100755 --- a/src/components/CGridTableRec/CGridTableRec.ts +++ b/src/components/CGridTableRec/CGridTableRec.ts @@ -259,6 +259,7 @@ export default defineComponent({ const colclicksel = ref(null) const selected: any = ref([]) + const showfilteradv = ref(false) // filtri avanzati const filter = ref(0) const filtergrp = ref(costanti.MY_GROUPS) @@ -284,6 +285,10 @@ export default defineComponent({ refresh() }) + watch(() => showfilteradv.value, (newval: any, from: any) => { + tools.setCookie('s_adv', newval) + }) + watch(() => props.filtercustom, (to: any, from: any) => { console.log('filtercustom', to) refresh() @@ -896,6 +901,8 @@ export default defineComponent({ myvertical.value = props.vertical myvertical.value = tools.getCookie('myv_' + props.prop_mytable, props.vertical) + + showfilteradv.value = tools.getCookie('s_adv', false) } function mounted() { @@ -1485,6 +1492,7 @@ export default defineComponent({ getValueExtra, shared_consts, getLabelFooterByRow, + showfilteradv, } } }) diff --git a/src/components/CGridTableRec/CGridTableRec.vue b/src/components/CGridTableRec/CGridTableRec.vue index 94d663a7..e6f708eb 100755 --- a/src/components/CGridTableRec/CGridTableRec.vue +++ b/src/components/CGridTableRec/CGridTableRec.vue @@ -105,9 +105,15 @@
+
+ + +
+ -
+
+ + v-on:keyup.enter="doSearch" + > diff --git a/src/components/CMainView/CMainView.vue b/src/components/CMainView/CMainView.vue index e0cc380a..d3e873c6 100755 --- a/src/components/CMainView/CMainView.vue +++ b/src/components/CMainView/CMainView.vue @@ -2,7 +2,7 @@
+ label="Bacheca" to="/bacheca" icon="fas fa-bullhorn" color="blue"> diff --git a/src/components/CMySelect/CMySelect.ts b/src/components/CMySelect/CMySelect.ts index 1cc05910..ef181a37 100755 --- a/src/components/CMySelect/CMySelect.ts +++ b/src/components/CMySelect/CMySelect.ts @@ -426,6 +426,8 @@ export default defineComponent({ let myarr: any = [] + let mystr = val.toLocaleLowerCase() + myarr = updateArrOptions() if (!fieldsTable.tableRemotePickup.includes(props.tablesel)) { if (myarr && myarr.length > 0) { @@ -435,6 +437,16 @@ export default defineComponent({ valori.value = [] } } + + if (!props.multiple && !props.multiselect_by_server) { + + if (val === '') { + valori.value = myarr + } else { + valori.value = myarr.filter((v: any) => v[`${props.optlab}`].toLowerCase().indexOf(mystr) > -1) + } + } + return } @@ -444,8 +456,6 @@ export default defineComponent({ return } - let mystr = val.toLocaleLowerCase() - // console.log('props.tablesel', props.tablesel) if (fieldsTable.tableRemotePickup.includes(props.tablesel)) { diff --git a/src/components/CMySelect/CMySelect.vue b/src/components/CMySelect/CMySelect.vue index eaf2d54b..6bd258b6 100755 --- a/src/components/CMySelect/CMySelect.vue +++ b/src/components/CMySelect/CMySelect.vue @@ -2,13 +2,13 @@