diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index 837f2ec3..4333d346 100755 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -282,6 +282,7 @@ export const shared_consts = { TABLES_WITH_FILTER_FIELD: ['caldate'], TABLES_WITH_SPECIAL_FILTER: ['pub_to_share'], COL_WITH_FILTER_GTE: ['numMaxPeopleHosp'], + COL_WITH_ARRFILTER_IN_AND: ['preferences'], TABLES_WITH_DATE: ['mybachecas', 'myhosps'], // 'mybachecas' TABLES_WITH_SORTING: ['mybachecas', 'myhosps'], TABLES_REC_ID: ['skills', 'goods', 'subskills', 'myskills', 'mybachecas', 'myhosps', 'mygoods'], diff --git a/src/components/CBarSelection/CBarSelection.ts b/src/components/CBarSelection/CBarSelection.ts index bb00eee0..7771bdd2 100755 --- a/src/components/CBarSelection/CBarSelection.ts +++ b/src/components/CBarSelection/CBarSelection.ts @@ -147,6 +147,7 @@ export default defineComponent({ watch(() => props.table, (newval, oldval) => { tablesel.value = props.table + console.log('CHANGE TABLESEL', tablesel.value) }) watch(() => globalStore.myselector.data, (newval, oldval) => { @@ -180,11 +181,11 @@ export default defineComponent({ const recRegion = searchList.value.find((rec) => rec.table === tabregion) if (recRegion) - tools.setCookie(tools.COOK_SEARCH + tabregion, newval) + tools.setCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + tabregion, newval) for (const item of searchList.value) { if (item.table === tableprov) { - const valsaved = tools.getCookie(tools.COOK_SEARCH + tableprov + '_' + newval, costanti.FILTER_TUTTI) + const valsaved = tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + item.table + costanti.FILTER_SEP + newval, costanti.FILTER_TUTTI) const rec = searchList.value.find((myrec) => myrec.table === tableprov) // check if exist let trovato = false let arrvalues = [] @@ -201,7 +202,7 @@ export default defineComponent({ } } } else if (item.table === toolsext.TABCITIES) { - const valsaved = tools.getCookie(tools.COOK_SEARCH + toolsext.TABCITIES + '_' + newval, costanti.FILTER_TUTTI) + const valsaved = tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + item.table + costanti.FILTER_SEP + newval, costanti.FILTER_TUTTI) const rec = searchList.value.find((myrec) => myrec.table === toolsext.TABCITIES) // check if exist let trovato = false let arrvalues = [] @@ -222,20 +223,19 @@ export default defineComponent({ } - function searchval(newval: any, table: any) { - // console.log('REFRR searchval', newval, table) + function searchval(newval: any, table: any, tablesel: any) { + console.log('REFRR searchval', newval, table, 'tablesel', tablesel) globalStore.myselector = { table, data: newval } // console.log('globalStore.myselector', globalStore.myselector) - - tools.setCookie(tools.COOK_SEARCH + table, newval) + tools.setCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + table, newval) if (table === toolsext.TABREGIONS) { setProvinceByRegion(toolsext.TABPROVINCE, table, newval) } else if (table === toolsext.TABGOODS) { const recSector = searchList.value.find((rec) => rec.table === toolsext.TABSECTORGOODS) if (recSector) { - tools.setCookie(tools.COOK_SEARCH + table + '_' + recSector.value, newval) + tools.setCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + recSector.value, newval) } // setCategBySector('sectorgoods', table, newval) } diff --git a/src/components/CBarSelection/CBarSelection.vue b/src/components/CBarSelection/CBarSelection.vue index 00fe2a9e..6212d6e7 100755 --- a/src/components/CBarSelection/CBarSelection.vue +++ b/src/components/CBarSelection/CBarSelection.vue @@ -3,6 +3,7 @@ :class="$q.screen.lt.sm ? `` : `q-pa-xs`" v-if="isfinishLoading && mycolumns" > +
@@ -83,7 +84,7 @@ : labelcombo(item) " v-model:value="item.value" - @update:value="searchval(item.value, item.table)" + @update:value="searchval(item.value, item.table, tablesel)" :addall="item.addall" :addnone="item.addnone" :addlast="true" @@ -126,7 +127,7 @@ :multiselect_by_server="true" :label="labelcombo(item)" v-model:arrvalue="item.arrvalue" - @update:arrvalue="searchval(item.arrvalue, item.table)" + @update:arrvalue="searchval(item.arrvalue, item.table, tablesel)" :addall="item.addall" :addnone="item.addnone" dark @@ -152,7 +153,7 @@ v-model="item.arrvalue" label-color="primary" :label="labelcombo(item)" - @update:model-value="searchval(item.arrvalue, item.table)" + @update:model-value="searchval(item.arrvalue, item.table, tablesel)" rounded dark dense diff --git a/src/components/CFinder/CFinder.ts b/src/components/CFinder/CFinder.ts index 85530990..9d6df9d9 100755 --- a/src/components/CFinder/CFinder.ts +++ b/src/components/CFinder/CFinder.ts @@ -333,7 +333,7 @@ export default defineComponent({ table: 'regions', key: 'idReg', type: costanti.FieldType.select, - value: tools.getCookie(tools.COOK_SEARCH + 'regions', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'regions', costanti.FILTER_TUTTI), addall: true, arrvalue: [], filter: null, @@ -345,7 +345,7 @@ export default defineComponent({ table: 'provinces', key: 'idProvince', type: costanti.FieldType.select, - value: tools.getCookie(tools.COOK_SEARCH + 'provinces', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'provinces', costanti.FILTER_TUTTI), addall: true, arrvalue: [], filter: getFilterProvinceByRegion, @@ -358,7 +358,7 @@ export default defineComponent({ table: 'cities', key: 'idCity', type: costanti.FieldType.select_by_server, - value: tools.getCookie(tools.COOK_SEARCH + 'cities', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'cities', costanti.FILTER_TUTTI), addall: true, arrvalue: [], useinput: true, @@ -382,7 +382,7 @@ export default defineComponent({ label: 'Settore', table: toolsext.TABSECTORS, key: 'idSector', - value: tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, 0, true), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + toolsext.TABSECTORS, 0, true), arrvalue: [], type: costanti.FieldType.select, filter: null, @@ -394,7 +394,7 @@ export default defineComponent({ label: 'Categoria', table: 'skills', key: 'idSkill', - value: tools.getCookie(tools.COOK_SEARCH + toolsext.TABSKILLS + '_' + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI, true), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI, true), arrvalue: [], type: costanti.FieldType.select, addall: true, @@ -406,7 +406,7 @@ export default defineComponent({ label: 'Offro/Cerco', table: 'adtypes', key: 'adType', - value: tools.getCookie(tools.COOK_SEARCH + 'adtypes', costanti.FILTER_TUTTI, true), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'adtypes', costanti.FILTER_TUTTI, true), arrvalue: [], addall: true, type: costanti.FieldType.select, @@ -451,7 +451,7 @@ export default defineComponent({ table: 'statusSkills', key: 'idStatusSkill', value: 0, - arrvalue: tools.getCookie(tools.COOK_SEARCH + 'statusSkills', []), + arrvalue: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'statusSkills', []), type: costanti.FieldType.multiselect, filter: null, useinput: false, @@ -509,7 +509,7 @@ export default defineComponent({ table: 'regions', key: 'idReg', type: costanti.FieldType.select, - value: tools.getCookie(tools.COOK_SEARCH + 'regions', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'regions', costanti.FILTER_TUTTI), addall: true, arrvalue: [], filter: null, @@ -521,7 +521,7 @@ export default defineComponent({ table: 'provinces', key: 'idProvince', type: costanti.FieldType.select, - value: tools.getCookie(tools.COOK_SEARCH + 'provinces', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'provinces', costanti.FILTER_TUTTI), addall: true, arrvalue: [], filter: getFilterProvinceByRegion, @@ -533,7 +533,7 @@ export default defineComponent({ table: 'cities', key: 'idCity', type: costanti.FieldType.select_by_server, - value: tools.getCookie(tools.COOK_SEARCH + 'cities', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'cities', costanti.FILTER_TUTTI), addall: true, arrvalue: [], useinput: true, @@ -569,7 +569,7 @@ export default defineComponent({ label: 'Settore', table: toolsext.TABSECTORS, key: 'idSector', - value: tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, 0, true), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + toolsext.TABSECTORS, 0, true), arrvalue: [], type: costanti.FieldType.select, filter: null, @@ -581,7 +581,7 @@ export default defineComponent({ label: 'Categoria', table: 'skills', key: 'idSkill', - value: tools.getCookie(tools.COOK_SEARCH + toolsext.TABSKILLS + '_' + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI, true), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI, true), arrvalue: [], type: costanti.FieldType.select, addall: true, @@ -611,7 +611,7 @@ export default defineComponent({ table: 'regions', key: 'idReg', type: costanti.FieldType.select, - value: tools.getCookie(tools.COOK_SEARCH + 'regions_hosp', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'regions', costanti.FILTER_TUTTI), keycookie: '_hosp', addall: true, arrvalue: [], @@ -624,7 +624,7 @@ export default defineComponent({ table: 'provinces', key: 'idProvince', type: costanti.FieldType.select, - value: tools.getCookie(tools.COOK_SEARCH + 'provinces_hosp', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'provinces', costanti.FILTER_TUTTI), keycookie: '_hosp', addall: true, arrvalue: [], @@ -637,7 +637,7 @@ export default defineComponent({ table: 'cities', key: 'idCity', type: costanti.FieldType.select_by_server, - value: tools.getCookie(tools.COOK_SEARCH + 'cities_hosp', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'cities', costanti.FILTER_TUTTI), keycookie: '_hosp', addall: true, arrvalue: [], @@ -652,7 +652,7 @@ export default defineComponent({ table: toolsext.TABTYPEHOSP, key: 'typeHosp', type: costanti.FieldType.select, - value: tools.getCookie(tools.COOK_SEARCH + 'typeHosp', costanti.FILTER_TUTTI, true), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + toolsext.TABTYPEHOSP, costanti.FILTER_TUTTI, true), addall: true, arrvalue: [], filter: null, @@ -664,7 +664,7 @@ export default defineComponent({ table: toolsext.TABPEOPLE, key: 'numMaxPeopleHosp', type: costanti.FieldType.select, - value: tools.getCookie(tools.COOK_SEARCH + 'numMaxPeopleHosp', costanti.FILTER_TUTTI, true), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + toolsext.TABPEOPLE, costanti.FILTER_TUTTI, true), addall: true, arrvalue: [], filter: null, @@ -676,9 +676,9 @@ export default defineComponent({ table: toolsext.TABPREF, key: 'preferences', type: costanti.FieldType.multiselect, - value: tools.getCookie(tools.COOK_SEARCH + 'preferences', costanti.FILTER_TUTTI), + value: 0, addall: false, - arrvalue: [], + arrvalue: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + toolsext.TABPREF, []), filter: null, useinput: false, icon: 'fas fa-asterisk', @@ -688,7 +688,7 @@ export default defineComponent({ table: 'contribtypes', key: 'idContribType', value: 0, - arrvalue: tools.getCookie(tools.COOK_SEARCH + 'contribtypes', []), + arrvalue: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'contribtypes', []), type: costanti.FieldType.multiselect, filter: null, useinput: false, @@ -705,7 +705,7 @@ export default defineComponent({ table: 'regions', key: 'idReg', type: costanti.FieldType.select, - value: tools.getCookie(tools.COOK_SEARCH + 'regions', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'regions', costanti.FILTER_TUTTI), addall: true, arrvalue: [], filter: null, @@ -717,7 +717,7 @@ export default defineComponent({ table: 'provinces', key: 'idProvince', type: costanti.FieldType.select, - value: tools.getCookie(tools.COOK_SEARCH + 'provinces', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'provinces', costanti.FILTER_TUTTI), addall: true, arrvalue: [], filter: getFilterProvinceByRegion, @@ -729,7 +729,7 @@ export default defineComponent({ table: 'cities', key: 'idCity', type: costanti.FieldType.select_by_server, - value: tools.getCookie(tools.COOK_SEARCH + 'cities', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'cities', costanti.FILTER_TUTTI), addall: true, arrvalue: [], useinput: true, @@ -754,7 +754,7 @@ export default defineComponent({ label: 'Settore', table: 'sectorgoods', key: 'idSectorGood', - value: tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORGOODS, 0, true), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + toolsext.TABSECTORGOODS, 0, true), arrvalue: [], type: costanti.FieldType.select, filter: null, @@ -766,7 +766,7 @@ export default defineComponent({ label: 'Categoria', table: 'goods', key: 'idGood', - value: tools.getCookie(tools.COOK_SEARCH + toolsext.TABGOODS + '_' + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORGOODS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI, true), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORGOODS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI, true), arrvalue: [], type: costanti.FieldType.select, addall: true, @@ -778,7 +778,7 @@ export default defineComponent({ label: 'Offro/Cerco', table: 'adtypes', key: 'adType', - value: tools.getCookie(tools.COOK_SEARCH + 'adtypes', costanti.FILTER_TUTTI, true), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'adtypes', costanti.FILTER_TUTTI, true), arrvalue: [], addall: true, type: costanti.FieldType.select, @@ -835,7 +835,7 @@ export default defineComponent({ table: 'contribtypes', key: 'idContribType', value: 0, - arrvalue: tools.getCookie(tools.COOK_SEARCH + 'contribtypes', []), + arrvalue: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'contribtypes', []), type: costanti.FieldType.multiselect, filter: null, useinput: false, @@ -847,7 +847,7 @@ export default defineComponent({ label: 'Altri Filtri', table: 'otherfilters', key: 'otherfilters', - arrvalue: tools.getCookie(tools.COOK_SEARCH + 'otherfilters', []), + arrvalue: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'otherfilters', []), value: 0, type: costanti.FieldType.multiselect, addall: false, @@ -878,7 +878,7 @@ export default defineComponent({ table: 'regions', key: 'idReg', type: costanti.FieldType.select, - value: tools.getCookie(tools.COOK_SEARCH + 'regions', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'regions', costanti.FILTER_TUTTI), addall: true, arrvalue: [], filter: null, @@ -890,7 +890,7 @@ export default defineComponent({ table: 'provinces', key: 'idProvince', type: costanti.FieldType.select, - value: tools.getCookie(tools.COOK_SEARCH + 'provinces', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'provinces', costanti.FILTER_TUTTI), addall: true, arrvalue: [], filter: getFilterProvinceByRegion, @@ -902,7 +902,7 @@ export default defineComponent({ table: 'cities', key: 'idCity', type: costanti.FieldType.select_by_server, - value: tools.getCookie(tools.COOK_SEARCH + 'cities', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'cities', costanti.FILTER_TUTTI), addall: true, arrvalue: [], useinput: true, @@ -919,7 +919,7 @@ export default defineComponent({ table: 'regions', key: 'idReg', type: costanti.FieldType.select, - value: tools.getCookie(tools.COOK_SEARCH + 'regions', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'regions', costanti.FILTER_TUTTI), addall: true, arrvalue: [], filter: null, @@ -931,7 +931,7 @@ export default defineComponent({ table: 'provinces', key: 'idProvince', type: costanti.FieldType.select, - value: tools.getCookie(tools.COOK_SEARCH + 'provinces', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'provinces', costanti.FILTER_TUTTI), addall: true, arrvalue: [], filter: getFilterProvinceByRegion, @@ -945,7 +945,7 @@ export default defineComponent({ type: costanti.FieldType.select_by_server, arrvalue: [], addall: true, - value: tools.getCookie(tools.COOK_SEARCH + 'cities', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'cities', costanti.FILTER_TUTTI), useinput: true, filter: null, // filter: getFilterCitiesByProvince, @@ -957,7 +957,7 @@ export default defineComponent({ label: 'Categorie', table: 'catgrps', key: 'idCatGrp', - value: tools.getCookie(tools.COOK_SEARCH + 'catgrps', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'catgrps', costanti.FILTER_TUTTI), arrvalue: [], type: costanti.FieldType.select, filter: null, @@ -970,7 +970,7 @@ export default defineComponent({ table: 'visibilGroup', key: 'visibility', type: costanti.FieldType.multiselect, - value: tools.getCookie(tools.COOK_SEARCH + 'visibility', costanti.FILTER_TUTTI), + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'visibility', costanti.FILTER_TUTTI), addall: true, arrvalue: [], useinput: true, diff --git a/src/components/CGridTableRec/CGridTableRec.ts b/src/components/CGridTableRec/CGridTableRec.ts index 3e1cb586..bf6e4fcd 100755 --- a/src/components/CGridTableRec/CGridTableRec.ts +++ b/src/components/CGridTableRec/CGridTableRec.ts @@ -399,7 +399,7 @@ export default defineComponent({ const getNumRecFromQuery = computed(() => () => { - return serverData.value.length + return serverData.value.length }) const valoriopt = computed(() => (item: any, addall?: boolean, addnone?: boolean) => { // console.log('valoriopt', item.table) @@ -508,11 +508,11 @@ export default defineComponent({ const recSector = searchList.value.find((rec) => rec.table === tabsector) if (recSector) - tools.setCookie(tools.COOK_SEARCH + tabsector, newval) + tools.setCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + mytable.value + costanti.FILTER_SEP + tabsector, newval) for (const item of searchList.value) { if (item.table === tablecat) { - const valsaved = tools.getCookie(tools.COOK_SEARCH + tablecat + '_' + newval, costanti.FILTER_TUTTI) + const valsaved = tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + mytable.value + costanti.FILTER_SEP + item.table + costanti.FILTER_SEP + newval, costanti.FILTER_TUTTI) const rec = searchList.value.find((myrec) => myrec.table === tablecat) // check if exist let trovato = false let arrvalues = [] @@ -539,11 +539,11 @@ export default defineComponent({ const recRegion = searchList.value.find((rec) => rec.table === tabregion) if (recRegion) - tools.setCookie(tools.COOK_SEARCH + tabregion, newval) + tools.setCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + mytable.value + costanti.FILTER_SEP + tabregion, newval) for (const item of searchList.value) { if (item.table === tableprov) { - const valsaved = tools.getCookie(tools.COOK_SEARCH + tableprov + '_' + newval, costanti.FILTER_TUTTI) + const valsaved = tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + mytable.value + costanti.FILTER_SEP + tableprov + costanti.FILTER_SEP + newval, costanti.FILTER_TUTTI) const rec = searchList.value.find((myrec) => myrec.table === tableprov) // check if exist let trovato = false let arrvalues = [] @@ -561,7 +561,7 @@ export default defineComponent({ } } } else if (item.table === toolsext.TABCITIES) { - const valsaved = tools.getCookie(tools.COOK_SEARCH + toolsext.TABCITIES + '_' + newval, costanti.FILTER_TUTTI) + const valsaved = tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + mytable.value + costanti.FILTER_SEP + item.table + costanti.FILTER_SEP + newval, costanti.FILTER_TUTTI) const rec = searchList.value.find((myrec) => myrec.table === toolsext.TABCITIES) // check if exist let trovato = false let arrvalues = [] @@ -588,9 +588,9 @@ export default defineComponent({ } function searchval(newval: any, table: any) { - console.log('REFRR searchval', newval, table) + console.log('REFRR searchval', newval, table, 'mytable', mytable.value) const myrecfilt = searchList.value.find((rec) => rec.table === table) - let keycookie = tools.COOK_SEARCH + table + let keycookie = tools.COOK_SEARCH + costanti.FILTER_SEP + mytable.value + costanti.FILTER_SEP + table if (myrecfilt && myrecfilt.keycookie) keycookie += myrecfilt.keycookie tools.setCookie(keycookie, newval) @@ -598,7 +598,7 @@ export default defineComponent({ if (table === toolsext.TABSKILLS) { const recSector = searchList.value.find((rec) => rec.table === 'sectors') if (recSector) { - tools.setCookie(tools.COOK_SEARCH + table + '_' + recSector.value, newval) + tools.setCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + mytable.value + costanti.FILTER_SEP + recSector.value, newval) } } else if (table === toolsext.TABSECTORS) { setCategBySector(toolsext.TABSKILLS, table, newval) @@ -609,7 +609,7 @@ export default defineComponent({ } else if (table === toolsext.TABGOODS) { const recSector = searchList.value.find((rec) => rec.table === toolsext.TABSECTORGOODS) if (recSector) { - tools.setCookie(tools.COOK_SEARCH + table + '_' + recSector.value, newval) + tools.setCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + mytable.value + costanti.FILTER_SEP + table + costanti.FILTER_SEP + recSector.value, newval) } // setCategBySector('sectorgoods', table, newval) } else if (table === toolsext.TABCITIES) { @@ -850,7 +850,6 @@ export default defineComponent({ } else if (item.arrvalue.length > 0) { - const myarr = item.arrvalue.filter((value: any) => { if (typeof value === 'number') { return value > 0 @@ -861,17 +860,33 @@ export default defineComponent({ const arr2: any = [] if (item.table !== 'provinces') { - myarr.forEach((myval: any) => { - const objitem2: any = {} - objitem2[item.key] = myval - arr2.push(objitem2) - }) + if (shared_consts.COL_WITH_ARRFILTER_IN_AND.includes(item.key)) { + myarr.forEach((myval: any) => { + const objitem2: any = {} + objitem2[item.key] = myval + arr2.push(objitem2) + }) - const obj2: any = { - $or: arr2 - } - if (arr2.length > 0) { - filtersearch.push(obj2) + const obj2: any = { + $and: arr2 + } + if (arr2.length > 0) { + filtersearch.push(obj2) + } + } else { + + myarr.forEach((myval: any) => { + const objitem2: any = {} + objitem2[item.key] = myval + arr2.push(objitem2) + }) + + const obj2: any = { + $or: arr2 + } + if (arr2.length > 0) { + filtersearch.push(obj2) + } } } diff --git a/src/components/CGridTableUser/CGridTableUser.ts b/src/components/CGridTableUser/CGridTableUser.ts index ecdbcbc5..126db554 100755 --- a/src/components/CGridTableUser/CGridTableUser.ts +++ b/src/components/CGridTableUser/CGridTableUser.ts @@ -488,11 +488,11 @@ export default defineComponent({ const recSector = searchList.value.find((rec) => rec.table === tabsector) if (recSector) - tools.setCookie(tools.COOK_SEARCH + tabsector, newval) + tools.setCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + tabsector + costanti.FILTER_SEP + tabsector, newval) for (const item of searchList.value) { if (item.table === tablecat) { - const valsaved = tools.getCookie(tools.COOK_SEARCH + tablecat + '_' + newval, costanti.FILTER_TUTTI) + const valsaved = tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + tablecat + costanti.FILTER_SEP + newval, costanti.FILTER_TUTTI) const rec = searchList.value.find((myrec) => myrec.table === tablecat) // check if exist let trovato = false let arrvalues = [] @@ -519,11 +519,11 @@ export default defineComponent({ const recRegion = searchList.value.find((rec) => rec.table === tabregion) if (recRegion) - tools.setCookie(tools.COOK_SEARCH + tabregion, newval) + tools.setCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + tabregion + costanti.FILTER_SEP + tabregion, newval) for (const item of searchList.value) { if (item.table === tableprov) { - const valsaved = tools.getCookie(tools.COOK_SEARCH + tableprov + '_' + newval, costanti.FILTER_TUTTI) + const valsaved = tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + tableprov + costanti.FILTER_SEP + newval, costanti.FILTER_TUTTI) const rec = searchList.value.find((myrec) => myrec.table === tableprov) // check if exist let trovato = false let arrvalues = [] @@ -541,7 +541,7 @@ export default defineComponent({ } } } else if (item.table === toolsext.TABCITIES) { - const valsaved = tools.getCookie(tools.COOK_SEARCH + toolsext.TABCITIES + '_' + newval, costanti.FILTER_TUTTI) + const valsaved = tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + item.table + costanti.FILTER_SEP + newval, costanti.FILTER_TUTTI) const rec = searchList.value.find((myrec) => myrec.table === toolsext.TABCITIES) // check if exist let trovato = false let arrvalues = [] @@ -570,7 +570,7 @@ export default defineComponent({ function searchval(newval: any, table: any) { console.log('REFRR searchval', newval, table) const myrecfilt = searchList.value.find((rec) => rec.table === table) - let keycookie = tools.COOK_SEARCH + table + let keycookie = tools.COOK_SEARCH + costanti.FILTER_SEP + mytable.value + costanti.FILTER_SEP if (myrecfilt && myrecfilt.keycookie) keycookie += myrecfilt.keycookie tools.setCookie(keycookie, newval) @@ -578,7 +578,7 @@ export default defineComponent({ if (table === toolsext.TABSKILLS) { const recSector = searchList.value.find((rec) => rec.table === 'sectors') if (recSector) { - tools.setCookie(tools.COOK_SEARCH + table + '_' + recSector.value, newval) + tools.setCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + mytable.value + costanti.FILTER_SEP + table + costanti.FILTER_SEP + recSector.value, newval) } } else if (table === toolsext.TABSECTORS) { setCategBySector(toolsext.TABSKILLS, table, newval) @@ -589,7 +589,7 @@ export default defineComponent({ } else if (table === toolsext.TABGOODS) { const recSector = searchList.value.find((rec) => rec.table === toolsext.TABSECTORGOODS) if (recSector) { - tools.setCookie(tools.COOK_SEARCH + table + '_' + recSector.value, newval) + tools.setCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + mytable.value + costanti.FILTER_SEP + table + costanti.FILTER_SEP + recSector.value, newval) } // setCategBySector('sectorgoods', table, newval) } else if (table === toolsext.TABCITIES) { diff --git a/src/components/CMyCardService/CMyCardService.vue b/src/components/CMyCardService/CMyCardService.vue index 3363ff26..25a58290 100644 --- a/src/components/CMyCardService/CMyCardService.vue +++ b/src/components/CMyCardService/CMyCardService.vue @@ -148,9 +148,7 @@ costanti.TIPOFAVBOOK.SEEN, false, $t('cmd.seen', { - num: myrec.numseen - ? myrec.numseen - : 0, + num: myrec.numseen ? myrec.numseen : 0, }) ) " @@ -161,9 +159,7 @@ {{ $t('cmd.seen', { - num: myrec.numseen - ? myrec.numseen - : 0, + num: myrec.numseen ? myrec.numseen : 0, }) }} @@ -235,9 +231,7 @@ costanti.TIPOFAVBOOK.BOOKMARK, false, $t('cmd.bookmark', { - num: myrec.numbook - ? myrec.numbook - : 0, + num: myrec.numbook ? myrec.numbook : 0, }) ) " @@ -248,9 +242,7 @@ {{ $t('cmd.bookmark', { - num: myrec.numbook - ? myrec.numbook - : 0, + num: myrec.numbook ? myrec.numbook : 0, }) }} @@ -277,6 +269,23 @@
+ + + + + {{ globalStore.getStatusSkillById(recstatus) }} + + + + +