diff --git a/.env.development b/.env.development index e1a5dc1f..53c5f5db 100755 --- a/.env.development +++ b/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.2.7" +APP_VERSION="0.2.8" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL="newfreeplanet" @@ -26,3 +26,4 @@ TELEGRAM_SUPPORT="" PROJECT_ID_MAIN="5cc0a13fe5c9d156728f400a" TEST_CELL="" ISTEST=1 +BAK_MONGODB_HOST="http://192.168.0.200:3000" diff --git a/_ALL_SITES/freeplanet.app/.env.development b/_ALL_SITES/freeplanet.app/.env.development index 7f39a893..60e09447 100755 --- a/_ALL_SITES/freeplanet.app/.env.development +++ b/_ALL_SITES/freeplanet.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.2.7" +APP_VERSION="0.2.8" SERVICE_WORKER_FILE="service-worker.js" APP_ID="1" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/insiemesipuo.app/.env.development b/_ALL_SITES/insiemesipuo.app/.env.development index e1a5dc1f..40824226 100755 --- a/_ALL_SITES/insiemesipuo.app/.env.development +++ b/_ALL_SITES/insiemesipuo.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.2.7" +APP_VERSION="0.2.8" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/popolodelnuovomondo.app/.env.development b/_ALL_SITES/popolodelnuovomondo.app/.env.development index ac6abd3f..613fe03b 100755 --- a/_ALL_SITES/popolodelnuovomondo.app/.env.development +++ b/_ALL_SITES/popolodelnuovomondo.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.2.7" +APP_VERSION="0.2.8" SERVICE_WORKER_FILE="service-worker.js" APP_ID="12" DIRECTORY_LOCAL="newfreeplanet" diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index 98e047f5..8b6dfe7b 100755 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -96,10 +96,11 @@ export const shared_consts = { TABLES_ID_NUMBER: ['permissions', 'levels', 'adtypes', 'adtypegoods', 'statusSkills', 'sectors', 'sectorgoods', 'catgrps', 'skills', 'subskills', 'cities', 'provinces', 'myskills', 'mybachecas', 'mygoods', 'mygroups'], - TABLES_USER_ID: ['myskills', 'mybachecas', 'mygoods'], + TABLES_USER_ID: ['mygroups', 'myskills', 'mybachecas', 'mygoods'], TABLES_UPDATE_LASTIFIED: ['myskills', 'mybachecas', 'mygoods', 'mybots'], TABLES_FINDER: ['myskills', 'mybachecas', 'mygoods', 'mygroups'], - TABLES_VISU_CMYSRECCARD: ['myskills', 'mybachecas', 'mygoods'], + TABLES_VISU_CMYSRECCARD: ['myskills', 'mybachecas', 'mygoods', 'mygroups'], + TABLES_SHOW_ADTYPE: ['myskills', 'mybachecas', 'mygoods'], TABLES_PERM_CHANGE_FOR_USERS: ['myskills', 'mybachecas', 'mygoods'], TABLES_VISU_LISTA_USER: ['myskills', 'mybachecas', 'mygoods', 'users'], diff --git a/src/components/CDashboard/CDashboard.vue b/src/components/CDashboard/CDashboard.vue index 376c4f58..45ccb31f 100755 --- a/src/components/CDashboard/CDashboard.vue +++ b/src/components/CDashboard/CDashboard.vue @@ -51,7 +51,7 @@ {{ calcstat.numMyBachecas }} - Dacci un Occhio + Eventi diff --git a/src/components/CFinder/CFinder.ts b/src/components/CFinder/CFinder.ts index 06f92e60..b0a42cdd 100755 --- a/src/components/CFinder/CFinder.ts +++ b/src/components/CFinder/CFinder.ts @@ -15,6 +15,7 @@ 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: 'CFinder', @@ -23,12 +24,18 @@ export default defineComponent({ type: String, required: true, }, + showFilterPersonal: { + type: Boolean, + required: false, + default: true, + } }, components: { CMyFieldDb, CGridTableRec, }, setup(props, { attrs, slots, emit }) { const { t } = useI18n() + const $q = useQuasar() const globalStore = useGlobalStore() const userStore = useUserStore() @@ -36,6 +43,7 @@ export default defineComponent({ const filtercustom: any = ref([]) const searchList_Servizi = ref([]) const searchList_Beni = ref([]) + const searchList_MyGroups = ref([]) const search = ref('') const myrecfiltertoggle = ref(tools.FILTER_ALL) @@ -74,14 +82,60 @@ export default defineComponent({ ) const searchList = computed(() => { - if (props.table === 'mygoods') + if (props.table === toolsext.TABMYGOODS) return searchList_Beni.value - else if (props.table === 'myskills') + else if (props.table === toolsext.TABMYSKILLS) return searchList_Servizi.value + else if (props.table === toolsext.TABMYGROUPS) + return searchList_MyGroups.value return searchList_Servizi.value }) + const showType = computed(() => { + if (props.table === toolsext.TABMYGOODS) + return costanti.SHOW_MYCARD + else if (props.table === toolsext.TABMYSKILLS) + return costanti.SHOW_MYCARD + else if (props.table === toolsext.TABMYGROUPS) + return costanti.SHOW_MYCARD + + return costanti.SHOW_MYCARD + }) + + const hint = computed(() => { + if (props.table === toolsext.TABMYGOODS) + return 'nome del Bene o settore da cercare' + else if (props.table === toolsext.TABMYSKILLS) + return 'nome del servizio o settore da cercare' + else if (props.table === toolsext.TABMYGROUPS) + return 'nome del gruppo da cercare' + + return 'nome del gruppo da cercare' + }) + + const visuType = computed(() => { + if (props.table === toolsext.TABMYGOODS) + return $q.screen.gt.xs + else if (props.table === toolsext.TABMYSKILLS) + return $q.screen.gt.xs + else if (props.table === toolsext.TABMYGROUPS) + return $q.screen.gt.xs + + return $q.screen.gt.xs + }) + + const noMsgRecord = computed(() => { + if (props.table === toolsext.TABMYGOODS) + return 'Nessun Bene trovato con i filtri selezionati' + else if (props.table === toolsext.TABMYSKILLS) + return 'Nessun Servizio trovato con i filtri selezionati' + else if (props.table === toolsext.TABMYGROUPS) + return 'Nessun Gruppo trovato con i filtri selezionati' + + return 'Nessun dato trovato con i filtri selezionati' + }) + function mounted() { @@ -433,12 +487,169 @@ export default defineComponent({ ] + searchList_MyGroups.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: 'Comune', + table: 'cities', + key: 'idCity', + type: costanti.FieldType.select_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', + icon: 'fas fa-map-marker-alt', + }, + { + label: 'Categorie', + table: 'catgrps', + key: 'idCatGrp', + value: tools.getCookie(tools.COOK_SEARCH + 'catgrps', costanti.FILTER_TUTTI), + arrvalue: [], + type: costanti.FieldType.select, + filter: null, + addall: true, + useinput: false, + icon: 'engineering', + }, + ] + filtercustom.value = [] } function extraparams() { - if (props.table === 'myskills') { + if (props.table === toolsext.TABMYGROUPS) { + + let lk_tab = 'mygroups' + let lk_LF = 'userId' + let lk_FF = '_id' + let lk_as = 'group' + let af_objId_tab = 'myId' + + return { + lookup1: { + lk_tab, + lk_LF, + lk_FF, + lk_as, + af_objId_tab, + lk_proj: { + groupname: 1, + title: 1, + descr: 1, + img: 1, + visibility: 1, + admins: 1, + idCatGrp: 1, + photos: 1, + idCity: 1, + note: 1, + website: 1, + comune: 1, + mycities: 1, + sector: 1, + } + }, + lookup2: { + lk_tab: 'cities', + lk_LF: 'idCity', + lk_FF: '_id', + lk_as: 'comune', + lk_proj: { + groupname: 1, + title: 1, + descr: 1, + img: 1, + idCatGrp: 1, + visibility: 1, + admins: 1, + photos: 1, + idCity: 1, + note: 1, + //**ADDFIELD_MYGROUPS + website: 1, + comune: 1, + mycities: 1, + } + }, + + } + + } else if (props.table === toolsext.TABMYGOODS) { + return { + lookup1: { + lk_tab: 'users', + lk_LF: 'userId', + lk_FF: '_id', + lk_as: 'user', + af_objId_tab: 'myId', + }, + lookup2: { + lk_tab: 'goods', + lk_LF: 'idGood', + lk_FF: '_id', + lk_as: 'recGood', + af_objId_tab: '', + lk_proj: { + recGood: 1, + sectorGood: 1, + idSectorGood: 1, + idGood: 1, + mygood: 1, + idStatusSkill: 1, + idContribType: 1, + idCity: 1, + numLevel: 1, + adType: 1, + photos: 1, + note: 1, + website: 1, + //**ADDFIELD_MYSKILL + descr: 1, + date_created: 1, + date_updated: 1, + userId: 1, + username: 1, + name: 1, + surname: 1, + comune: 1, + mycities: 1, + 'profile.img': 1, + 'profile.qualifica': 1, + } + }, + lookup3: { + lk_tab: 'sectorgoods', + lk_LF: 'recGood.idSectorGood', + lk_FF: '_id', + lk_as: 'sectorgood', + af_objId_tab: '', + }, + lookup5: { + lk_tab: 'cities', + lk_LF: 'idCity', + lk_FF: '_id', + lk_as: 'mycities', + af_objId_tab: '', + }, + } + } else { return { lookup1: { lk_tab: 'users', @@ -497,64 +708,6 @@ export default defineComponent({ af_objId_tab: '', }, } - } else if (props.table === 'myskills') { - return { - lookup1: { - lk_tab: 'users', - lk_LF: 'userId', - lk_FF: '_id', - lk_as: 'user', - af_objId_tab: 'myId', - }, - lookup2: { - lk_tab: 'goods', - lk_LF: 'idGood', - lk_FF: '_id', - lk_as: 'recGood', - af_objId_tab: '', - lk_proj: { - recGood: 1, - sectorGood: 1, - idSectorGood: 1, - idGood: 1, - mygood: 1, - idStatusSkill: 1, - idContribType: 1, - idCity: 1, - numLevel: 1, - adType: 1, - photos: 1, - note: 1, - website: 1, - //**ADDFIELD_MYSKILL - descr: 1, - date_created: 1, - date_updated: 1, - userId: 1, - username: 1, - name: 1, - surname: 1, - comune: 1, - mycities: 1, - 'profile.img': 1, - 'profile.qualifica': 1, - } - }, - lookup3: { - lk_tab: 'sectorgoods', - lk_LF: 'recGood.idSectorGood', - lk_FF: '_id', - lk_as: 'sectorgood', - af_objId_tab: '', - }, - lookup5: { - lk_tab: 'cities', - lk_LF: 'idCity', - lk_FF: '_id', - lk_as: 'mycities', - af_objId_tab: '', - }, - } } } @@ -565,6 +718,8 @@ export default defineComponent({ return tools.getdefaultnewrec_MyBacheca() } else if (props.table === toolsext.TABMYGOODS) { return tools.getdefaultnewrec_MyGoods() + } else if (props.table === toolsext.TABMYGROUPS) { + return tools.getdefaultnewrec_MyGroup() } return null } @@ -595,6 +750,10 @@ export default defineComponent({ toolsext, getdefaultnewrec, mypagination, + noMsgRecord, + showType, + visuType, + hint, } }, }) diff --git a/src/components/CFinder/CFinder.vue b/src/components/CFinder/CFinder.vue index 7babc6aa..030dd446 100755 --- a/src/components/CFinder/CFinder.vue +++ b/src/components/CFinder/CFinder.vue @@ -2,7 +2,8 @@
-
+
diff --git a/src/components/CFirstPageApp/CFirstPageApp.scss b/src/components/CFirstPageApp/CFirstPageApp.scss index 525b821a..c7624e80 100755 --- a/src/components/CFirstPageApp/CFirstPageApp.scss +++ b/src/components/CFirstPageApp/CFirstPageApp.scss @@ -3,3 +3,9 @@ font-size: 1.1rem; text-align: center; } + + +.errore{ + font-size: 1rem; + color: grey; +} diff --git a/src/components/CFirstPageApp/CFirstPageApp.ts b/src/components/CFirstPageApp/CFirstPageApp.ts index 52f658ca..5902e3b2 100755 --- a/src/components/CFirstPageApp/CFirstPageApp.ts +++ b/src/components/CFirstPageApp/CFirstPageApp.ts @@ -31,6 +31,10 @@ export default defineComponent({ // mounted } + function reloadPage(){ + $router.go(0) + } + onMounted(mounted) return { @@ -38,6 +42,7 @@ export default defineComponent({ static_data, globalStore, t, + reloadPage, } }, diff --git a/src/components/CFirstPageApp/CFirstPageApp.vue b/src/components/CFirstPageApp/CFirstPageApp.vue index ab5056cc..a25fa7e8 100755 --- a/src/components/CFirstPageApp/CFirstPageApp.vue +++ b/src/components/CFirstPageApp/CFirstPageApp.vue @@ -1,16 +1,23 @@ diff --git a/src/components/CGridTableRec/CGridTableRec.ts b/src/components/CGridTableRec/CGridTableRec.ts index 228e124f..a8e29a2a 100755 --- a/src/components/CGridTableRec/CGridTableRec.ts +++ b/src/components/CGridTableRec/CGridTableRec.ts @@ -102,11 +102,13 @@ export default defineComponent({ required: false, default: '', }, - keyMain: { +/* keyMain: { type: String, required: false, default: '', }, + + */ nodataLabel: { type: String, required: false, @@ -530,14 +532,14 @@ export default defineComponent({ returnedData.value = [] returnedCount = 0 } else { - if (props.keyMain) { + /*if (props.keyMain) { nosearch = true filtersearch.forEach((rec: any) => { if (!!rec[props.keyMain]) { nosearch = false } }) - } + }*/ } // if ((false && nosearch && props.finder) || (props.finder_noNull && nosearch)) { if (props.finder_noNull && nosearch) { diff --git a/src/components/CMyGroup/CMyGroup.ts b/src/components/CMyGroup/CMyGroup.ts index 063f3202..d42cbc3f 100755 --- a/src/components/CMyGroup/CMyGroup.ts +++ b/src/components/CMyGroup/CMyGroup.ts @@ -8,6 +8,7 @@ import { useQuasar } from 'quasar' import { useI18n } from '@/boot/i18n' import { useRoute, useRouter } from 'vue-router' import { CUserNonVerif } from '@/components/CUserNonVerif' +import { toolsext } from '@store/Modules/toolsext' export default defineComponent({ name: 'CMyGroup', @@ -42,6 +43,8 @@ export default defineComponent({ const grp = ref(null) + const table = ref(toolsext.TABMYGROUPS) + watch(() => props.mygrp, (newval, oldval) => { mounted() }) @@ -75,6 +78,10 @@ export default defineComponent({ onMounted(mounted) + function getPathByGroup(grp: IMyGroup){ + return '/' + tools.getDirectoryByTable(table.value) + '/' + grp.groupname + } + return { grp, costanti, @@ -85,6 +92,7 @@ export default defineComponent({ userStore, tools, $q, + getPathByGroup, } }, }) diff --git a/src/components/CMyGroup/CMyGroup.vue b/src/components/CMyGroup/CMyGroup.vue index cc5a4edb..c2a02c91 100755 --- a/src/components/CMyGroup/CMyGroup.vue +++ b/src/components/CMyGroup/CMyGroup.vue @@ -2,13 +2,13 @@
- + - + {{ grp.title }} ({{ grp.groupname }}) {{ grp.descr }} diff --git a/src/components/CMyRecCard/CMyRecCard.ts b/src/components/CMyRecCard/CMyRecCard.ts index 3bdf7510..827263b3 100755 --- a/src/components/CMyRecCard/CMyRecCard.ts +++ b/src/components/CMyRecCard/CMyRecCard.ts @@ -49,6 +49,14 @@ export default defineComponent({ } } + function showBadge() { + if (shared_consts.TABLES_SHOW_ADTYPE.includes(props.table)) { + return true + } + + return false + } + function getImgUser(profile: IUserFields) { return userStore.getImgByProfile(profile) } @@ -81,6 +89,7 @@ export default defineComponent({ fieldsTable, cmdExt, visupage, + showBadge, } }, }) diff --git a/src/components/CMyRecCard/CMyRecCard.vue b/src/components/CMyRecCard/CMyRecCard.vue index 1c2ea662..8eb50621 100755 --- a/src/components/CMyRecCard/CMyRecCard.vue +++ b/src/components/CMyRecCard/CMyRecCard.vue @@ -8,7 +8,7 @@ - + {{ fieldsTable.getValByTabAndId(table, 'adType', myrec.adType) }} diff --git a/src/components/CTestServer/CTestServer.ts b/src/components/CTestServer/CTestServer.ts index a70a0ab7..cf660396 100755 --- a/src/components/CTestServer/CTestServer.ts +++ b/src/components/CTestServer/CTestServer.ts @@ -22,6 +22,34 @@ export default defineComponent({ const testServer = ref({}) + const myrecfiltertoggle = ref(0) + + const SERVER_TEST = ref([ + { key: 1, label: 'Test', host: 'https://test.freeplanet.app:3001' }, + { key: 2, label: 'Produzione', host: 'https://freeplanet.app:3000' }, + { key: 3, label: 'Locale', host: 'http://192.168.0.200:3000' }, + ]) + + watch(() => + myrecfiltertoggle.value, (value: any, oldValue: any) => { + if (value) { + const trovato = SERVER_TEST.value.find((rec: any) => rec.key === value) + if (trovato) { + globalStore.serverHost = trovato.host + ricarica() + } + } + }, + ) + const getoptions = computed( () => { + const arr = [] + for (const rec of SERVER_TEST.value) { + arr.push({label: rec.label, value: rec.key}) + } + + return arr + }) + function mounted() { ricarica() } @@ -36,9 +64,11 @@ export default defineComponent({ return { t, tools, + getoptions, costanti, testServer, ricarica, + myrecfiltertoggle, } }, }) diff --git a/src/components/CTestServer/CTestServer.vue b/src/components/CTestServer/CTestServer.vue index 05fa1ea3..28a15e19 100755 --- a/src/components/CTestServer/CTestServer.vue +++ b/src/components/CTestServer/CTestServer.vue @@ -6,9 +6,18 @@ class="bg-primary text-white" color="primary q-title" style="text-align: center;"> - Server: {{testServer}} +

Server: {{tools.getServerHost()}}

+

Risposta: {{testServer}}

+ +
diff --git a/src/components/Header/Header.ts b/src/components/Header/Header.ts index fa1096cc..63283332 100755 --- a/src/components/Header/Header.ts +++ b/src/components/Header/Header.ts @@ -347,7 +347,7 @@ export default defineComponent({ function getappname() { let mystr = '' if (tools.isTest()){ - mystr = 'Ambiente di TEST' + mystr = getAppVersion() } else { let mystr = tools.getsuffisso() + tools.getappname(tools.isMobile()) if (!tools.isMobile()) { diff --git a/src/components/MyFooter/MyFooter.ts b/src/components/MyFooter/MyFooter.ts index 4d28cdaa..20e93f9c 100755 --- a/src/components/MyFooter/MyFooter.ts +++ b/src/components/MyFooter/MyFooter.ts @@ -41,6 +41,7 @@ export default defineComponent({ t, getMyUsername, Username, + tools, } }, diff --git a/src/components/MyFooter/MyFooter.vue b/src/components/MyFooter/MyFooter.vue index 489b6790..21ec86ce 100755 --- a/src/components/MyFooter/MyFooter.vue +++ b/src/components/MyFooter/MyFooter.vue @@ -1,5 +1,6 @@ diff --git a/src/store/Api/Instance.ts b/src/store/Api/Instance.ts index 07fde841..d43ec1a1 100755 --- a/src/store/Api/Instance.ts +++ b/src/store/Api/Instance.ts @@ -1,13 +1,13 @@ import axios, { AxiosInstance, AxiosResponse } from 'axios' // import LoginModule from '../Modules/Auth/LoginStore' -import { tools } from '@src/store/Modules/tools' import { toolsext } from '@src/store/Modules/toolsext' import { serv_constants } from '@src/store/Modules/serv_constants' import { useGlobalStore } from '@store/globalStore' import { useUserStore } from '@store/UserStore' +import { tools } from '@src/store/Modules/tools' import * as Types from './ApiTypes' -export const API_URL = process.env.MONGODB_HOST +export let API_URL = process.env.MONGODB_HOST export const axiosInstance: AxiosInstance = axios.create({ baseURL: API_URL, headers: { @@ -48,6 +48,7 @@ export const removeAuthHeaders = () => { } async function Request(type: string, path: string, payload: any): Promise { + let ricevuto = false const userStore = useUserStore() const globalStore = useGlobalStore() @@ -56,6 +57,7 @@ async function Request(type: string, path: string, payload: any): Promise { return res.status !== PayloadMessageTypes.statusfound @@ -5005,7 +5017,7 @@ export const tools = { return 'mywork' } else if (table === toolsext.TABMYBACHECAS) { return 'mypage' - } else if (table === 'mygroups') { + } else if (table === toolsext.TABMYGROUPS) { return 'grp' } diff --git a/src/store/globalStore.ts b/src/store/globalStore.ts index 55c066e6..a70606fb 100644 --- a/src/store/globalStore.ts +++ b/src/store/globalStore.ts @@ -67,6 +67,8 @@ export const useGlobalStore = defineStore('GlobalStore', { rightDrawerOpen: false, rightCartOpen: false, stateConnection: stateConnDefault, + serverError: false, + serverMsgError: {}, networkDataReceived: false, clickcmd: '', cfgServer: [], @@ -778,10 +780,13 @@ export const useGlobalStore = defineStore('GlobalStore', { return Api.SendReq('/gettable', 'POST', params) .then((res) => { + this.serverError = false // console.table(res) return res.data }) .catch((error) => { + this.serverError = true + this.serverMsgError = error console.log('error loadTable', error) userStore.setErrorCatch(error) return null @@ -1228,7 +1233,9 @@ export const useGlobalStore = defineStore('GlobalStore', { return Api.SendReq(`/loadsite/${myuserid}/${process.env.APP_ID}/${process.env.APP_VERSION}`, 'GET', null) .then((res) => { console.log('____________________________ res', res) + this.serverError = false if (res.status === 200) { + calendarStore.bookedevent = (res.data.bookedevent) ? res.data.bookedevent : [] calendarStore.eventlist = (res.data.eventlist) ? res.data.eventlist : [] calendarStore.operators = (res.data.operators) ? res.data.operators : [] @@ -1304,6 +1311,8 @@ export const useGlobalStore = defineStore('GlobalStore', { }).then((res) => res).catch((error) => { console.log('error dbLoad', error) // userStore.setErrorCatch(error) + this.serverError = true + this.serverMsgError = error return new Types.AxiosError(serv_constants.RIS_CODE_ERR, null, toolsext.ERR_GENERICO, error) }) }, @@ -1432,5 +1441,35 @@ export const useGlobalStore = defineStore('GlobalStore', { return myarr }, + getMsgServerError() { + if (this.serverError) { + if (this.serverMsgError) { + if (this.serverMsgError.status === 500) { + return 'Errore Interno del Server' + } else if (this.serverMsgError.msgerr === '') { + return 'Codice Errore ' + this.serverMsgError.status + } + try { + return this.serverMsgError.msgerr.message + }catch (e) { + return this.serverMsgError.msgerr + } + } + } + + return '' + }, + + getServerHost() { + + if (this.serverHost) { + return this.serverHost + } else { + return process.env.MONGODB_HOST + } + + }, + + }, }) diff --git a/src/views/user/myfriends/myfriends.vue b/src/views/user/myfriends/myfriends.vue index 8f5f8734..cc8a7538 100755 --- a/src/views/user/myfriends/myfriends.vue +++ b/src/views/user/myfriends/myfriends.vue @@ -24,7 +24,6 @@ :filtercustom="filtercustom" :prop_searchList="searchList" :showType="costanti.SHOW_USERINFO" - keyMain="" :showCol="false" :extraparams="extraparams()"> diff --git a/src/views/user/mygroup/mygroup.vue b/src/views/user/mygroup/mygroup.vue index b9ba992c..7ad3647e 100755 --- a/src/views/user/mygroup/mygroup.vue +++ b/src/views/user/mygroup/mygroup.vue @@ -34,8 +34,8 @@ - - + + @@ -111,7 +111,7 @@ -
+

@@ -142,7 +142,6 @@ :filtercustom="filtercustom" :prop_searchList="searchList" :showType="costanti.SHOW_USERINFO" - keyMain="" :showCol="false" :extrafield="groupname" :extraparams="extraparams()" diff --git a/src/views/user/mygroups/mygroups.ts b/src/views/user/mygroups/mygroups.ts index 9ea13d17..53fb3865 100755 --- a/src/views/user/mygroups/mygroups.ts +++ b/src/views/user/mygroups/mygroups.ts @@ -1,6 +1,8 @@ import { CMyGroups } from '@/components/CMyGroups' +import { CFinder } from '@/components/CFinder' import { CGridTableRec } from '@/components/CGridTableRec' import { tools } from '@store/Modules/tools' +import { toolsext } from '@store/Modules/toolsext' import { computed, defineComponent, onMounted, ref, watch } from 'vue' import { useUserStore } from '@store/UserStore' import { useRoute, useRouter } from 'vue-router' @@ -13,65 +15,15 @@ import { shared_consts } from '@/common/shared_vuejs' export default defineComponent({ name: 'mygroups', - components: { CMyGroups, CGridTableRec }, + components: { CMyGroups, CGridTableRec, CFinder }, props: {}, setup() { const userStore = useUserStore() - const $route = useRoute() const { t } = useI18n() - const arrfilterand: any = ref([]) - const filtercustom: any = ref([]) - const searchList = ref([]) - const filter = ref(costanti.FIND_GROUP) function mounted() { - searchList.value = [] - filtercustom.value = [] - arrfilterand.value = [] - - 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: 'Comune', - table: 'cities', - key: 'idCity', - type: costanti.FieldType.select_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', - icon: 'fas fa-map-marker-alt', - }, - { - label: 'Categorie', - table: 'catgrps', - key: 'idCatGrp', - value: tools.getCookie(tools.COOK_SEARCH + 'catgrps', costanti.FILTER_TUTTI), - arrvalue: [], - type: costanti.FieldType.select, - filter: null, - addall: true, - useinput: false, - icon: 'engineering', - }, - ] const filt_loaded = tools.getCookie(tools.COOK_SEARCH + tools.GROUP_SEARCH) filter.value = filt_loaded ? filt_loaded : costanti.FIND_GROUP @@ -81,81 +33,14 @@ export default defineComponent({ tools.setCookie(tools.COOK_SEARCH + tools.GROUP_SEARCH, newval) }) - - function getdefaultnewrec(): any { - return tools.getdefaultnewrec_MyGroup() - } - - function extraparams() { - let lk_tab = 'mygroups' - let lk_LF = 'userId' - let lk_FF = '_id' - let lk_as = 'group' - let af_objId_tab = 'myId' - - return { - lookup1: { - lk_tab, - lk_LF, - lk_FF, - lk_as, - af_objId_tab, - lk_proj: { - groupname: 1, - title: 1, - descr: 1, - img: 1, - visibility: 1, - admins: 1, - idCatGrp: 1, - photos: 1, - idCity: 1, - note: 1, - website: 1, - comune: 1, - mycities: 1, - sector: 1, - } - }, - lookup2: { - lk_tab: 'cities', - lk_LF: 'idCity', - lk_FF: '_id', - lk_as: 'comune', - lk_proj: { - groupname: 1, - title: 1, - descr: 1, - img: 1, - idCatGrp: 1, - visibility: 1, - admins: 1, - photos: 1, - idCity: 1, - note: 1, - //**ADDFIELD_MYGROUPS - website: 1, - comune: 1, - mycities: 1, - } - }, - - } - } - - onMounted(mounted) return { filter, costanti, shared_consts, - arrfilterand, - filtercustom, - searchList, colmyUserGroup, - extraparams, - getdefaultnewrec, + toolsext, } } }) diff --git a/src/views/user/mygroups/mygroups.vue b/src/views/user/mygroups/mygroups.vue index 7a7a75ce..d62c3314 100755 --- a/src/views/user/mygroups/mygroups.vue +++ b/src/views/user/mygroups/mygroups.vue @@ -4,13 +4,20 @@ v-model="filter" :finder="true" > + + + +