diff --git a/package.json b/package.json index 130f417a..a1f3e626 100755 --- a/package.json +++ b/package.json @@ -126,6 +126,7 @@ "jest": "^29.7.0", "json-loader": "^0.5.7", "node-sass": "^9.0.0", + "nodemon": "^3.1.7", "npm-check-updates": "^17.1.3", "optimize-css-assets-webpack-plugin": "^6.0.1", "parcel": "^2.12.0", diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index a5fc1375..d66b410e 100755 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -167,6 +167,7 @@ export const shared_consts = { MAPPACOMUNI: 370, MAPPAGETCOORDINATE: 380, EDITADDRESSBYCOORD: 390, + GRID_ORIZ: 400, }, QUERYTYPE_MYGROUP: 1, @@ -310,8 +311,8 @@ export const shared_consts = { TABLES_WITH_SORTING: ['mybachecas', 'myhosps'], TABLES_REC_ID: ['skills', 'goods', 'subskills', 'myskills', 'mybachecas', 'myhosps', 'mygoods'], - // costanti.VISUTABLE_SCHEDA_USER, VISUTABLE_SCHEDA_GROUP, VISUTABLE_USER_TABGROUP, VISUTABLE_USER_TABCIRCUIT, VISUTABLE_GROUP_CIRCUIT - VERTIC_SHOW_GRID: [-1, 2, -3, -4, -5, -6], + // costanti.VISUTABLE_SCHEDA_USER, VISUTABLE_SCHEDA_GROUP, VISUTABLE_USER_TABGROUP, VISUTABLE_USER_TABCIRCUIT, VISUTABLE_GROUP_CIRCUIT, VISUTABLE_ + VERTIC_SHOW_GRID: [-1, 2, -3, -4, -5, -6, -10], TABLES_UPDATE_LASTIFIED: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'bots'], TABLES_FINDER: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'mygroups'], @@ -1668,6 +1669,10 @@ export const shared_consts = { value: 280, label: 'Tutorial', }, + { + value: 400, + label: 'Griglia Tabelle', + }, ], TypesElemAdminTools: [ diff --git a/src/components/CGridOriz/CGridOriz.scss b/src/components/CGridOriz/CGridOriz.scss new file mode 100755 index 00000000..ab083089 --- /dev/null +++ b/src/components/CGridOriz/CGridOriz.scss @@ -0,0 +1,29 @@ + +.cltitlebg{ + +} + +.titletext { + color: white; + font-size: 3rem; + font-weight: 500; + line-height: 3rem; + text-shadow: .25rem .25rem .5rem black; + letter-spacing: .00937em; + opacity: 0.9; +} + +@media (max-width: 718px) { + // PER VERSIONE MOBILE + .titletext { + color: white; + font-size: 2rem; + font-weight: 500; + line-height: 2rem; + text-shadow: .25rem .25rem .5rem black; + } +} + +.q-img__content > div{ + background: rgba(0,0,0,0.17) !important; +} diff --git a/src/components/CGridOriz/CGridOriz.ts b/src/components/CGridOriz/CGridOriz.ts new file mode 100755 index 00000000..453ad01d --- /dev/null +++ b/src/components/CGridOriz/CGridOriz.ts @@ -0,0 +1,1095 @@ +import { + computed, + provide, defineComponent, onBeforeMount, onBeforeUnmount, onMounted, ref, toRef, toRefs, watch, +} from 'vue' + +import { tools } from '@store/Modules/tools' +import { CMyFieldDb } from '@/components/CMyFieldDb' +import { costanti } from '@costanti' +import { useGlobalStore } from '@store/globalStore' +import { useUserStore } from '@store/UserStore' + +import { CTitlePage } from '@/components/CTitlePage' +import { CGridTableRec } from '@/components/CGridTableRec' +import { IColGridTable, IMyBacheca, IMySkill, ISearchList, ISkill } from 'model' +import { shared_consts } from '@/common/shared_vuejs' +import { useI18n } from '@/boot/i18n' +import { toolsext } from '@store/Modules/toolsext' +import { fieldsTable } from '@store/Modules/fieldsTable' +import { useQuasar } from 'quasar' + +export default defineComponent({ + name: 'CGridOriz', + emits: ['clickButtBar'], + props: { + table: { + type: String, + required: true, + }, + showMap: { + type: Boolean, + required: false, + default: false, + }, + ind: { + type: Number, + required: false, + default: -1, + }, + tipovisu: { + type: Number, + required: false, + default: -1, + }, + prop_search: { + type: Boolean, + required: false, + default: true, + }, + finder: { + type: Boolean, + required: false, + default: true, + }, + }, + components: { + CMyFieldDb, CGridTableRec, CTitlePage, + }, + setup(props, { attrs, slots, emit }) { + const { t } = useI18n() + const $q = useQuasar() + const globalStore = useGlobalStore() + const userStore = useUserStore() + + const arrfilterand: any = ref([]) + const filtercustom: any = ref([]) + const searchList_Servizi = ref([]) + const searchList_Beni = ref([]) + const searchList_MyGroups = ref([]) + const searchList_MyCircuits = ref([]) + const searchList_Events = ref([]) + const searchList_Hosp = ref([]) + const searchList_Attivita = ref([]) + + const search = ref('') + const myrecfiltertoggle = ref(tools.FILTER_ALL) + + const prop_colkey = ref('idSkill') + const col_title = ref('descr') + const col_footer = ref('idCity') + const col_tabfooter = ref('mycities') + + const strextra = ref('') + const myoptions = ref([]) + + const col = ref({}) + + const myGridRef = ref(null) + + /* + const idSectorServizi = computed(() => { + let myval: any = null + myval = searchList_Servizi.value.find((rec) => (rec.table === toolsext.TABSECTORS)) + if (myval) { + const ris = myval.value || 0 + // console.log('idSectorServizi=', ris) + return ris + } else { + return 0 + } + }) + + */ + + + function updatefilter(value: any) { + if (value === tools.FILTER_MYREC) { + if (props.table === shared_consts.TABLES_MYGROUPS) { + filtercustom.value = [{ + 'admins': { + $elemMatch: { username: { $eq: userStore.my.username } } + }, + }] + } else if (props.table === shared_consts.TABLES_CIRCUITS) { + filtercustom.value = [{ + 'admins': { + $elemMatch: { username: { $eq: userStore.my.username } } + }, + }] + + } else { + filtercustom.value = [{ userId: userStore.my._id }] + } + + } else if (value === tools.FILTER_MYFOLLOW) { + if (props.table === shared_consts.TABLES_MYGROUPS) { + + } + } else { + filtercustom.value = [] + } + } + + + /*watch(() => filtercustom.value, (value: any, oldval: any) => { + updatefilter(myrecfiltertoggle.value) + }) + + */ + + watch(() => myrecfiltertoggle.value, (value: any, oldval: any) => { + updatefilter(value) + }, + ) + + const mypagination = computed(() => { + if (props.table === shared_consts.TABLES_MYBACHECAS) + return { sortBy: 'dateTimeStart', descending: false, page: 1, rowsNumber: 0, rowsPerPage: 10 } + else if (props.table === shared_consts.TABLES_MYGROUPS) + return { sortBy: 'date_created', descending: true, page: 1, rowsNumber: 0, rowsPerPage: 10 } + else if (props.table === toolsext.TABMOVEMENTS) + return { sortBy: 'transactionDate', descending: true, page: 1, rowsNumber: 0, rowsPerPage: 20 } + else if (props.table === shared_consts.TABLES_CIRCUITS) + return { sortBy: 'numMembers', descending: true, page: 1, rowsNumber: 0, rowsPerPage: 20 } + else if (props.table === toolsext.TABUSER) + return userStore.getMypaginationMembers() + else if (shared_consts.TABLES_ORDER_DATE_UPDATED.includes(props.table)) + return { sortBy: 'date_updated', descending: true, page: 1, rowsNumber: 0, rowsPerPage: 10 } // date_updated + else if (shared_consts.TABLES_ORDER_DESCR.includes(props.table)) + return { sortBy: 'desc', descending: false, page: 1, rowsNumber: 0, rowsPerPage: 10 } + + return { sortBy: 'date_created', descending: true, page: 1, rowsNumber: 0, rowsPerPage: 10 } + }) + + const searchList = computed(() => { + if (props.table === shared_consts.TABLES_MYGOODS) + return searchList_Beni.value + else if (props.table === shared_consts.TABLES_MYSKILLS) + return searchList_Servizi.value + else if (props.table === shared_consts.TABLES_MYGROUPS) + return searchList_MyGroups.value + else if (props.table === shared_consts.TABLES_CIRCUITS) + return searchList_MyCircuits.value + else if (props.table === shared_consts.TABLES_MYBACHECAS) + return searchList_Events.value + else if (props.table === shared_consts.TABLES_MYHOSPS) + return searchList_Hosp.value + else if (props.table === shared_consts.TABLES_ATTIVITAS) + return searchList_Attivita.value + + return searchList_Servizi.value + }) + + const showType = computed(() => { + return costanti.SHOW_MYCARD + }) + + const hint = computed(() => { + if (props.table === shared_consts.TABLES_MYGOODS) + return 'digita il nome del Bene o del settore' + else if (props.table === shared_consts.TABLES_MYSKILLS) + return 'digita il nome del Servizio o del settore' + else if (props.table === shared_consts.TABLES_MYGROUPS) + return 'digita il nome del Gruppo' + else if (props.table === shared_consts.TABLES_CIRCUITS) + return 'digita il nome della provincia' + else if (props.table === shared_consts.TABLES_MYBACHECAS) + return 'digita il nome dell\'Evento' + else if (props.table === shared_consts.TABLES_MYHOSPS) + return 'digita delle parole da cercare nella descrizione dell\'Ospitalità' + else if (props.table === shared_consts.TABLES_ATTIVITAS) + return 'digita un\'attività da cercare' + + return 'digita una parola da cercare' + }) + + const visuType = computed(() => { + if (props.table === shared_consts.TABLES_MYGOODS) + return false + else if (props.table === shared_consts.TABLES_MYSKILLS) + return false + else if (props.table === shared_consts.TABLES_MYGROUPS) + return false + else if (props.table === shared_consts.TABLES_MYBACHECAS) + return false + + return false // $q.screen.gt.xs + }) + + const noMsgRecord = computed(() => { + if (props.table === shared_consts.TABLES_MYGOODS) + return 'Nessun Bene trovato con i filtri selezionati' + else if (props.table === shared_consts.TABLES_MYSKILLS) + return 'Nessun Servizio trovato con i filtri selezionati' + else if (props.table === shared_consts.TABLES_MYGROUPS) + return 'Nessun Gruppo trovato con i filtri selezionati' + else if (props.table === shared_consts.TABLES_CIRCUITS) + return 'Nessun Circuito trovato con i filtri selezionati' + else if (props.table === shared_consts.TABLES_MYBACHECAS) + return 'Nessun Evento trovato con i filtri selezionati' + else if (props.table === shared_consts.TABLES_MYHOSPS) + return 'Nessuna Ospitalità trovata con i filtri selezionati' + else if (props.table === shared_consts.TABLES_ATTIVITAS) + return 'Nessuna Attività trovata con i filtri selezionati' + + return 'Nessun dato trovato con i filtri selezionati' + }) + + + function mounted() { + + let obj = tools.getParamsByTable(props.table) + + if (props.ind >= 0) { + strextra.value = costanti.MAINCARDS[props.ind].strsingolo! + } + + col.value = fieldsTable.getArrColsByTable(props.table) + + prop_colkey.value = obj.prop_colkey + col_title.value = obj.col_title + col_footer.value = obj.col_footer + col_tabfooter.value = obj.col_tabfooter + + if (props.table === shared_consts.TABLES_MYGROUPS) { + myoptions.value = [ + { label: '🌎 Tutti', value: tools.FILTER_ALL }, + { label: '👤 Gruppi che Gestisci', value: tools.FILTER_MYREC }, + // {label: 'Seguo', value: tools.FILTER_MYFOLLOW}, + ] + + } else if (props.table === shared_consts.TABLES_CIRCUITS) { + myoptions.value = [] + if (tools.gestiscoAlmeno1Circuito()) { + myoptions.value = [ + { label: '🌎 Tutti', value: tools.FILTER_ALL }, + { label: '👤 Circuiti che Gestisci', value: tools.FILTER_MYREC }, + // {label: 'Seguo', value: tools.FILTER_MYFOLLOW}, + ] + + } + + } else { + /* + myoptions.value = [ + { label: '🌎 Tutti', value: tools.FILTER_ALL }, + { label: '👤 Personali', value: tools.FILTER_MYREC }, + // {label: 'Seguo', value: tools.FILTER_MYFOLLOW}, + ] + */ + } + + function getFilterSkills(recSkill: any, index: number, arr: any) { + const recsectors: any = searchList.value.find((rec) => rec.table === toolsext.TABSECTORS) + // console.log('getFilterSkills', recSkill.idSector, recsectors.value) + if (recsectors && recSkill.idSector) { + return recSkill.idSector.includes(recsectors.value) + } else { + return true + } + } + + function getFilterGoods(recGood: any, index: number, arr: any) { + const recsectorGoods: any = searchList.value.find((rec) => rec.table === 'sectorgoods') + // console.log('getFilterSkills', recSkill.idSector, recsectors.value) + if (recsectorGoods && recGood.idSectorGood) { + return recGood.idSectorGood.includes(recsectorGoods.value) + } else { + return true + } + } + + function getFilterSubSkills(recSubSkill: any, index: number, arr: any) { + const recskills: any = searchList.value.find((rec) => rec.table === 'skills') + // console.log('recSubSkill', recSubSkill, 'recskills', recskills) + if (recskills) { + return recSubSkill.idSkill === recskills.value + } else { + return true + } + } + + /*function getFilterCitiesByProvince(recCities: any, index: number, arr: any) { + const recprov: any = searchList.value.find((rec) => rec.table === 'provinces') + // console.log('recSubSkill', recSubSkill, 'recskills', recskills) + if (recprov) { + return recCities.idProvince === recprov.value + } else { + return true + } + } + + */ + + function getFilterProvinceByRegion(recProvince: any, index: number, arr: any) { + const recreg: any = searchList.value.find((rec) => rec.table === 'regions') + if (recreg) { + return recProvince.reg === recreg.value + } else { + return true + } + } + + + searchList_Servizi.value = [ + { + label: 'Regione', + table: 'regions', + key: 'idReg', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'regions', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + filter: null, + useinput: false, + icon: 'fas fa-globe-europe' + }, + { + label: 'Provincia', + table: 'provinces', + key: 'idProvince', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'provinces', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + filter: getFilterProvinceByRegion, + useinput: true, + icon: 'flag', + tablesel: 'provinces', + }, + { + label: 'Comune', + table: 'cities', + key: 'idCity', + type: costanti.FieldType.select_by_server, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'cities', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + useinput: true, + filter: null, + // filter: getFilterCitiesByProvince, + // param1: shared_consts.PARAM_SHOW_PROVINCE, + tablesel: 'cities', + }, + /*{ + label: 'Visibilità', + table: 'pub_to_share', + key: 'pub_to_share', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + 'pub_to_share', shared_consts.PUBTOSHARE.ALL, true), + addall: false, + arrvalue: [], + useinput: false, + filter: null, + },*/ + { + label: 'Settore', + table: toolsext.TABSECTORS, + key: 'idSector', + 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, + addall: true, + notinsearch: true, + useinput: false, + }, + { + label: 'Categoria', + table: 'skills', + key: 'idSkill', + 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, + filter: getFilterSkills, + showcount: true, + useinput: false, + }, + { + label: 'Offro/Cerco', + table: 'adtypes', + key: 'adType', + 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, + filter: null, + useinput: false, + }, + /*{ + label: 'Specializzazione', + table: 'subskills', + key: 'idSubSkill', + value: tools.getCookie(tools.COOK_SEARCH + 'subskills' + '_' + tools.getCookie(tools.COOK_SEARCH + 'skills', costanti.FILTER_TUTTI), costanti.FILTER_TUTTI), + type: costanti.FieldType.select, + arrvalue: [], + addall: true, + filter: getFilterSubSkills, + showcount: true, + useinput: false, + icon: 'far fa-id-card', + }, + */ + + + + /* + { + label: 'Livello', + table: 'levels', + key: 'numLevel', + value: tools.getCookie(tools.COOK_SEARCH + 'levels', costanti.FILTER_TUTTI), + arrvalue: [], + addall: true, + type: costanti.FieldType.select, + filter: null, + useinput: false, + filteradv: true, + }, + + + */ + { + label: 'Disponibile', + table: 'statusSkills', + key: 'idStatusSkill', + value: 0, + arrvalue: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'statusSkills', []), + type: costanti.FieldType.multiselect, + filter: null, + useinput: false, + icon: 'fas fa-exchange-alt', + filteradv: true, + }, + { + label: 'In cambio di', + table: 'contribtypes', + key: 'idContribType', + value: 0, + arrvalue: tools.getCookie(tools.COOK_SEARCH + 'contribtypes', []), + type: costanti.FieldType.multiselect, + filter: null, + useinput: false, + icon: 'fas fa-hand-holding', + filteradv: true, + //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: '', + }, + + */ + + ] + + searchList_Events.value = [ + /*{ + label: 'Scambio', + table: 'statusSkills', + key: 'idStatusSkill', + value: 0, + arrvalue: tools.getCookie(tools.COOK_SEARCH + 'statusSkills', []), + type: costanti.FieldType.multiselect, + filter: null, + useinput: false, + icon: 'mood', + filteradv: false, + },*/ + { + label: 'Regione', + table: 'regions', + key: 'idReg', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'regions', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + filter: null, + useinput: false, + icon: 'fas fa-globe-europe' + }, + { + label: 'Provincia', + table: 'provinces', + key: 'idProvince', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'provinces', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + filter: getFilterProvinceByRegion, + useinput: true, + icon: 'flag', + }, + { + label: 'Comune', + table: 'cities', + key: 'idCity', + type: costanti.FieldType.select_by_server, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'cities', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + useinput: true, + filter: null, + // filter: getFilterCitiesByProvince, + // param1: shared_consts.PARAM_SHOW_PROVINCE, + tablesel: 'cities', + }, + /*{ + label: 'Visiblità', + table: 'pub_to_share', + key: 'pub_to_share', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + 'pub_to_share', shared_consts.PUBTOSHARE.ALL, true), + addall: false, + arrvalue: [], + useinput: true, + filter: null, + tablesel: 'pub_to_share', + },*/ + { + label: 'Data Inizio', + table: 'caldate', + key: 'dateTimeStart', + value: 2, + arrvalue: [], + type: costanti.FieldType.select, + addall: true, + filter: null, + useinput: false, + }, + { + label: 'Settore', + table: toolsext.TABSECTORS, + key: 'idSector', + 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, + addall: true, + notinsearch: true, + useinput: false, + }, + { + label: 'Categoria', + table: 'skills', + key: 'idSkill', + 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, + filter: getFilterSkills, + showcount: true, + useinput: false, + }, + { + label: 'In cambio di', + table: 'contribtypes', + key: 'idContribType', + value: 0, + arrvalue: tools.getCookie(tools.COOK_SEARCH + 'contribtypes', []), + type: costanti.FieldType.multiselect, + filter: null, + useinput: false, + icon: 'fas fa-hand-holding', + filteradv: false, + //icon: 'swap_horizontal_circle', + }, + + ] + + searchList_Hosp.value = [ + { + label: 'Regione', + table: 'regions', + key: 'idReg', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'regions', costanti.FILTER_TUTTI), + keycookie: '_hosp', + addall: true, + arrvalue: [], + filter: null, + useinput: false, + icon: 'fas fa-globe-europe' + }, + { + label: 'Provincia', + table: 'provinces', + key: 'idProvince', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'provinces', costanti.FILTER_TUTTI), + keycookie: '_hosp', + addall: true, + arrvalue: [], + filter: getFilterProvinceByRegion, + useinput: true, + icon: 'flag', + }, + { + label: 'Comune', + table: 'cities', + key: 'idCity', + type: costanti.FieldType.select_by_server, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'cities', costanti.FILTER_TUTTI), + keycookie: '_hosp', + addall: true, + arrvalue: [], + useinput: true, + filter: null, + // filter: getFilterCitiesByProvince, + // param1: shared_consts.PARAM_SHOW_PROVINCE, + tablesel: 'cities', + }, + { + label: 'Offro/Cerco', + table: 'adtypes', + key: 'adType', + 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, + filter: null, + useinput: false, + }, + { + label: 'Tipologia', + table: toolsext.TABTYPEHOSP, + key: 'typeHosp', + type: costanti.FieldType.select, + 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, + useinput: false, + icon: 'flag', + }, + { + label: 'N° max Ospiti', + table: toolsext.TABPEOPLE, + key: 'numMaxPeopleHosp', + type: costanti.FieldType.select, + 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, + useinput: false, + icon: 'fas fa-users', + }, + { + label: 'Preferenze', + table: toolsext.TABPREF, + key: 'preferences', + type: costanti.FieldType.multiselect, + value: 0, + addall: false, + arrvalue: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + toolsext.TABPREF, []), + filter: null, + useinput: false, + icon: 'fas fa-asterisk', + }, + { + label: 'In cambio di', + table: 'contribtypes', + key: 'idContribType', + value: 0, + arrvalue: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'contribtypes', []), + type: costanti.FieldType.multiselect, + filter: null, + useinput: false, + icon: 'fas fa-hand-holding', + filteradv: false, + //icon: 'swap_horizontal_circle', + }, + + ] + + searchList_Beni.value = [ + { + label: 'Regione', + table: 'regions', + key: 'idReg', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'regions', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + filter: null, + useinput: false, + icon: 'fas fa-globe-europe' + }, + { + label: 'Provincia', + table: 'provinces', + key: 'idProvince', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'provinces', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + filter: getFilterProvinceByRegion, + useinput: true, + icon: 'flag', + }, + { + label: 'Comune', + table: 'cities', + key: 'idCity', + type: costanti.FieldType.select_by_server, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'cities', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + useinput: true, + filter: null, + //filter: getFilterCitiesByProvince, + // param1: shared_consts.PARAM_SHOW_PROVINCE, + tablesel: 'cities', + }, + /*{ + label: 'Visiblità', + table: 'pub_to_share', + key: 'pub_to_share', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + 'pub_to_share', shared_consts.PUBTOSHARE.ALL, true), + addall: false, + arrvalue: [], + useinput: true, + filter: null, + tablesel: 'pub_to_share', + },*/ + { + label: 'Settore', + table: 'sectorgoods', + key: 'idSectorGood', + 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, + addall: true, + notinsearch: true, + useinput: false, + }, + { + label: 'Categoria', + table: 'goods', + key: 'idGood', + 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, + filter: getFilterGoods, + showcount: true, + useinput: false, + }, + { + label: 'Offro/Cerco', + table: 'adtypes', + key: 'adType', + 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, + filter: null, + useinput: false, + }, + /* + { + label: 'Consegna', + table: 'shippings', + key: 'idShipping', + value: tools.getCookie(tools.COOK_SEARCH + 'shippings', costanti.FILTER_TUTTI), + arrvalue: [], + type: costanti.FieldType.select, + addall: true, + filter: null, + useinput: false, + },*/ + /*{ + label: 'Specializzazione', + table: 'subskills', + key: 'idSubSkill', + value: tools.getCookie(tools.COOK_SEARCH + 'subskills' + '_' + tools.getCookie(tools.COOK_SEARCH + 'skills', costanti.FILTER_TUTTI), costanti.FILTER_TUTTI), + type: costanti.FieldType.select, + arrvalue: [], + addall: true, + filter: getFilterSubSkills, + showcount: true, + useinput: false, + icon: 'far fa-id-card', + }, + */ + + + + /* + { + label: 'Livello', + table: 'levels', + key: 'numLevel', + value: tools.getCookie(tools.COOK_SEARCH + 'levels', costanti.FILTER_TUTTI), + arrvalue: [], + addall: true, + type: costanti.FieldType.select, + filter: null, + useinput: false, + filteradv: true, + }, + + + */ + { + label: 'In cambio di', + table: 'contribtypes', + key: 'idContribType', + value: 0, + arrvalue: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'contribtypes', []), + type: costanti.FieldType.multiselect, + filter: null, + useinput: false, + icon: 'currency_exchange', + filteradv: true, + //icon: 'swap_horizontal_circle', + }, + { + label: 'Altri Filtri', + table: 'otherfilters', + key: 'otherfilters', + arrvalue: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'otherfilters', []), + value: 0, + type: costanti.FieldType.multiselect, + addall: false, + filter: null, + useinput: false, + icon: 'fas fa-filter' + }, + { + label: '', + table: '', + key: '', + value: 0, + type: costanti.FieldType.separator, + arrvalue: [], + addall: true, + filter: null, + showcount: true, + useinput: false, + notinsearch: true, + icon: '', + }, + + ] + + searchList_MyCircuits.value = [ + { + label: 'Regione', + table: 'regions', + key: 'idReg', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'regions', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + filter: null, + useinput: false, + icon: 'fas fa-globe-europe' + }, + { + label: 'Provincia', + table: 'provinces', + key: 'idProvince', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'provinces', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + filter: getFilterProvinceByRegion, + useinput: true, + icon: 'flag', + }, + { + label: 'Comune', + table: 'cities', + key: 'idCity', + type: costanti.FieldType.select_by_server, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'cities', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + useinput: true, + filter: null, + // filter: getFilterCitiesByProvince, + // param1: shared_consts.PARAM_SHOW_PROVINCE, + tablesel: 'cities', + }, + ] + + searchList_Attivita.value = [ + { + label: 'Regione', + table: 'regions', + key: 'idReg', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'regions', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + filter: null, + useinput: false, + icon: 'fas fa-globe-europe' + }, + { + label: 'Provincia', + table: 'provinces', + key: 'idProvince', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'provinces', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + filter: getFilterProvinceByRegion, + useinput: true, + icon: 'flag', + }, + { + label: 'Comune', + table: 'cities', + key: 'idCity', + type: costanti.FieldType.select_by_server, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'cities', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + useinput: true, + filter: null, + // filter: getFilterCitiesByProvince, + // param1: shared_consts.PARAM_SHOW_PROVINCE, + tablesel: 'cities', + }, + ] + + searchList_MyGroups.value = [ + { + label: 'Regione', + table: 'regions', + key: 'idReg', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'regions', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + filter: null, + useinput: false, + icon: 'fas fa-globe-europe' + }, + { + label: 'Provincia', + table: 'provinces', + key: 'idProvince', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'provinces', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + filter: getFilterProvinceByRegion, + useinput: true, + icon: 'flag', + }, + { + label: 'Comune', + table: 'cities', + key: 'idCity', + type: costanti.FieldType.select_by_server, + arrvalue: [], + addall: true, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'cities', costanti.FILTER_TUTTI), + useinput: true, + filter: null, + // filter: getFilterCitiesByProvince, + // param1: shared_consts.PARAM_SHOW_PROVINCE, + tablesel: 'cities', + icon: 'fas fa-map-marker-alt', + }, + { + label: 'Categorie', + table: 'catgrps', + key: 'idCatGrp', + 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, + addall: true, + useinput: false, + icon: 'engineering', + }, + { + label: 'Visiblità', + table: 'visibilGroup', + key: 'visibility', + type: costanti.FieldType.multiselect, + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'visibility', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + useinput: true, + filter: null, + tablesel: 'visibility', + }, + ] + + filtercustom.value = [] + } + + + + function mySortFieldsAvailable() { + if (props.table === toolsext.TABUSER) { + return userStore.getSortFieldsAvailable() + } + + return [] + } + + + + function doSearch() { + // + } + + function clickButtBar(item: any) { + if (myGridRef.value) { + myGridRef.value.clickButtBar(item) + } + + // emit('clickButtBar', item) + } + + onMounted(mounted) + + return { + t, + tools, + costanti, + arrfilterand, + filtercustom, + searchList, + search, + doSearch, + myrecfiltertoggle, + prop_colkey, + col_title, + col_footer, + col_tabfooter, + col, + toolsext, + mypagination, + noMsgRecord, + showType, + visuType, + hint, + strextra, + myoptions, + mySortFieldsAvailable, + clickButtBar, + myGridRef, + } + }, +}) diff --git a/src/components/CGridOriz/CGridOriz.vue b/src/components/CGridOriz/CGridOriz.vue new file mode 100755 index 00000000..7f689b0b --- /dev/null +++ b/src/components/CGridOriz/CGridOriz.vue @@ -0,0 +1,46 @@ + + + + diff --git a/src/components/CGridOriz/index.ts b/src/components/CGridOriz/index.ts new file mode 100755 index 00000000..2e45be99 --- /dev/null +++ b/src/components/CGridOriz/index.ts @@ -0,0 +1 @@ +export { default as CGridOriz } from './CGridOriz.vue' diff --git a/src/components/CGridTableRec/CGridTableRec.scss b/src/components/CGridTableRec/CGridTableRec.scss index e7e96511..d61350ce 100755 --- a/src/components/CGridTableRec/CGridTableRec.scss +++ b/src/components/CGridTableRec/CGridTableRec.scss @@ -68,4 +68,11 @@ .hint_search{ color: gray; +} + +.clOrizzontal{ + +} +.q-carousel__slide{ + padding: 8px !important; } \ No newline at end of file diff --git a/src/components/CGridTableRec/CGridTableRec.ts b/src/components/CGridTableRec/CGridTableRec.ts index 7e45d257..664c8444 100755 --- a/src/components/CGridTableRec/CGridTableRec.ts +++ b/src/components/CGridTableRec/CGridTableRec.ts @@ -1,4 +1,4 @@ -import { defineComponent, PropType, ref, watch, toRef, onMounted, onBeforeUnmount, toRefs, computed, inject, onUnmounted } from 'vue' +import { defineComponent, PropType, ref, watch, toRef, onMounted, onBeforeUnmount, toRefs, computed, inject, onUnmounted, nextTick } from 'vue' import { useI18n } from '@src/boot/i18n' import { tools } from '../../store/Modules/tools' @@ -361,6 +361,8 @@ export default defineComponent({ const showMap = ref(false) const showMapAtLeast1 = ref(false) const mapInitialized = ref(false) + const slideGridOriz = ref(0) + const autoplay = ref(true) const newRecordBool = ref(false) @@ -371,6 +373,12 @@ export default defineComponent({ const recModif = ref({}) const showInnerDialog = ref(false) + const carouselTabRef = ref(null) + const isAtStart = ref(true) + const isAtEnd = ref(false) + const activeIndex = ref(0) + const addEventScroll = ref(false) + const mytable = ref('') const mytitle = ref('') const mytitlenew = ref('') @@ -1209,6 +1217,8 @@ export default defineComponent({ spinner_visible.value = false changetable.value = false startsearch.value = false + + checkScrollPosition() }) } @@ -1306,6 +1316,8 @@ export default defineComponent({ // console.log(' ...DONE ') done(pagination.value.rowsNumber === 0 ? true : false) + checkScrollPosition() + alreadymounting.value = true }) } else { @@ -1660,13 +1672,55 @@ export default defineComponent({ myvertical.value = props.vertical - showfilter.value = props.prop_showfilter || (tools.getCookie('s_adv', '0') !== '0') + if (props.prop_search) { + showfilter.value = props.prop_showfilter || (tools.getCookie('s_adv', '0') !== '0') + } else { + showfilter.value = props.prop_showfilter + } } catch (e) { console.error('ERRORE', e) } } + const checkScrollPosition = () => { + console.log('checkScrollPosition') + const container = carouselTabRef.value + if (!container ) return + + if (!addEventScroll.value && carouselTabRef.value) { + carouselTabRef.value?.addEventListener('scroll', checkScrollPosition) + addEventScroll.value = true + } + + if (carouselTabRef.value) { + console.log('carouselTabRef LISTEN') + } else { + console.log('carouselTabRef NO !') + } + console.log(' .... >>> AVANTI ', container.scrollLeft, container.clientWidth) + + isAtStart.value = container.scrollLeft <= 0 + isAtEnd.value = container.scrollLeft + container.clientWidth >= container.scrollWidth - 1 + + if (serverData.value.length > 0) { // Assicurarsi che ci siano elementi + console.log('entro dentro...') + const cardWidth = container.scrollWidth / serverData.value.length + activeIndex.value = Math.round(container.scrollLeft / cardWidth) + } + } + + const scroll = (direction: any) => { + const container = carouselTabRef.value; + if (!container || !serverData.value.length) return; + + const cardWidth = container.scrollWidth / serverData.value.length; + container.scrollBy({ + left: direction * cardWidth, + behavior: 'smooth', + }); + }; + function mounted() { // console.log('mounted...') try { @@ -1713,6 +1767,10 @@ export default defineComponent({ changeTable(tablesel.value, true) + nextTick(() => { + checkScrollPosition() + }) + // Aggiungi gli listener agli eventi della tastiera document.addEventListener('keydown', onEscapeKey); // window.addEventListener('popstate', onBackButton); @@ -2188,7 +2246,7 @@ export default defineComponent({ newRecord.value = {} newRecordBool.value = false - + tools.showPositiveNotif($q, t('db.recupdated')) // refresh() } else { @@ -2476,6 +2534,10 @@ export default defineComponent({ // Rimuovi i listener al distruggere del componente onBeforeUnmount(() => { document.removeEventListener('keydown', onEscapeKey); + + carouselTabRef.value?.removeEventListener('scroll', checkScrollPosition) + + // window.removeEventListener('popstate', onBackButton); }); @@ -2700,6 +2762,13 @@ export default defineComponent({ gotoCurrentLocation, showInMap, showMapAtLeast1, + carouselTabRef, + isAtStart, + isAtEnd, + activeIndex, + scroll, + slideGridOriz, + autoplay, } } }) diff --git a/src/components/CGridTableRec/CGridTableRec.vue b/src/components/CGridTableRec/CGridTableRec.vue index 3a90c89a..b463c086 100755 --- a/src/components/CGridTableRec/CGridTableRec.vue +++ b/src/components/CGridTableRec/CGridTableRec.vue @@ -267,12 +267,17 @@ dense type="search" debounce="500" - :hint="!hintinbtnsearch ? hint: ''" + :hint="!hintinbtnsearch ? hint : ''" :error-message="noresultLabel" - :error="(getNumRecFromQuery() === 0 && !startsearch) && myfilter !== ''" + :error=" + getNumRecFromQuery() === 0 && !startsearch && myfilter !== '' + " :label="hintinbtnsearch ? hint : $t('grid.search')" @keyup.enter="doSearch" - @clear="myfilter = ''; doSearch()" + @clear=" + myfilter = ''; + doSearch(); + " @update:model-value="findByDebounce ? doSearch() : null" :clearable="!!myfilter" class="col q-mx-xs" @@ -284,10 +289,10 @@ -
-
+ -
-
-
-
- {{ tools.getstrMonth(row.dateTimeStart) }} -
+ + + + + + +
+ +
+
+ +
+
+
+
+
- +
+ {{ + tools.getstrMonth(row.dateTimeStart) + }} +
+
+ +
-
- - - - - - -
-
-
- - - - + + + + +
-
-
-
- -
-
-
- - + + + +
+
+
+
+ +
+
+
+ +