Ver 0.2.8

Added msg Server error in every pages
Nuovo Gruppo non funziona.
Corretto altre funzioni del Gruppo
Errore del server" Network Error", fare pagina test con altri host per vedere se da lo stesso msg, con IP
This commit is contained in:
paoloar77
2022-02-22 15:24:16 +01:00
parent 3f81f85bd4
commit f717702d67
30 changed files with 407 additions and 216 deletions

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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'],

View File

@@ -51,7 +51,7 @@
<q-item class="q-pb-none q-pt-xs">
<q-item-section>
<q-item-label class="text-h4" style="font-weight: 500;letter-spacing: 3px;">{{ calcstat.numMyBachecas }}</q-item-label>
<q-item-label :class="!$q.dark.isActive? 'text-grey-7':'text-white'" style="letter-spacing: 1px;">Dacci un Occhio</q-item-label>
<q-item-label :class="!$q.dark.isActive? 'text-grey-7':'text-white'" style="letter-spacing: 1px;">Eventi</q-item-label>
</q-item-section>
<q-item-section side>

View File

@@ -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(<ISearchList[]>[])
const searchList_Beni = ref(<ISearchList[]>[])
const searchList_MyGroups = ref(<ISearchList[]>[])
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,
}
},
})

View File

@@ -2,7 +2,8 @@
<div class="bi-border-all">
<div class="q-ma-xs q-gutter-xs q-pa-xs">
<div class="text-center">
<div v-if="showFilterPersonal"
class="text-center">
<q-btn-toggle
v-model="myrecfiltertoggle"
push
@@ -36,17 +37,17 @@
:col_tabfooter="col_tabfooter"
:vertical="costanti.VISUTABLE_LISTA"
:prop_pagination="mypagination"
:showType="costanti.SHOW_MYCARD"
:nodataLabel="'Nessun annuncio trovato con i filtri selezionati'"
:showType="showType"
:hint="hint"
:nodataLabel="noMsgRecord"
:prop_search="true"
:finder="true"
:choose_visutype="$q.screen.gt.xs"
:choose_visutype="visuType"
:butt_modif_new="true"
noresultLabel="Il filtro selezionato non ha trovato nessun risultato"
:arrfilters="arrfilterand"
:filtercustom="filtercustom"
:prop_searchList="searchList"
keyMain="idSkill"
:defaultnewrec="getdefaultnewrec"
:extraparams="extraparams()">

View File

@@ -3,3 +3,9 @@
font-size: 1.1rem;
text-align: center;
}
.errore{
font-size: 1rem;
color: grey;
}

View File

@@ -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,
}
},

View File

@@ -1,16 +1,23 @@
<template>
<div v-if="tools.isTest()">
<!--<q-banner
<div v-if="globalStore.serverError">
<q-banner
rounded
dense
class="bg-primary text-white"
class="bg-negative text-white"
color="primary q-title"
style="text-align: center;">
<template v-slot:avatar>
<q-icon name="fas fa-exclamation-triangle" color="yellow" size="xs" />
</template>
<span class="mybanner">Ambiente di Test</span>
</q-banner>-->
<span class="mybanner">Errore di Connessione al Server</span>
<p v-if="globalStore.serverMsgError" class="errore">{{globalStore.getMsgServerError()}}</p>
<q-btn
size="md"
color="secondary" rounded icon="refresh"
class="btnNewVersShow" @click="reloadPage" label="Riprova">
</q-btn>
</q-banner>
</div>
</template>

View File

@@ -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) {

View File

@@ -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(<IMyGroup | null>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,
}
},
})

View File

@@ -2,13 +2,13 @@
<div v-if="tools.isUserOk()">
<div v-if="grp">
<q-item class="q-my-sm" clickable>
<q-item-section avatar @click="naviga(`/` + tools.getDirectoryByTable(table) + `/` + grp.groupname)">
<q-item-section avatar @click="naviga(getPathByGroup(grp))">
<q-avatar size="60px">
<q-img :src="getImgGroup(grp)" :alt="grp.groupname" img-class="imgprofile" height="60px"/>
</q-avatar>
</q-item-section>
<q-item-section @click="naviga(`/` + tools.getDirectoryByTable(table) + `/` + grp.groupname)">
<q-item-section @click="naviga(getPathByGroup(grp))">
<q-item-label><strong>{{ grp.title }}</strong> ({{ grp.groupname }})
</q-item-label>
<q-item-label v-if="grp.descr" caption lines="1"><em>{{ grp.descr }}</em></q-item-label>

View File

@@ -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,
}
},
})

View File

@@ -8,7 +8,7 @@
</q-avatar>
</q-item-section>
<q-item-section v-else avatar @click="naviga(`/my/` + myrec.username)">
<q-badge class="q-my-xs self-center" :color="fieldsTable.getColByAdType(myrec.adType)">
<q-badge v-if="showBadge" class="q-my-xs self-center" :color="fieldsTable.getColByAdType(myrec.adType)">
{{ fieldsTable.getValByTabAndId(table, 'adType', myrec.adType) }}
<q-icon :name="fieldsTable.getIconByAdType(myrec.adType)" color="white"
class="q-ml-xs"/>

View File

@@ -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,
}
},
})

View File

@@ -6,9 +6,18 @@
class="bg-primary text-white"
color="primary q-title"
style="text-align: center;">
<span class="mybanner">Server: {{testServer}}</span>
<p class="mybanner">Server: {{tools.getServerHost()}}</p>
<p class="mybanner">Risposta: {{testServer}}</p>
</q-banner>
<q-btn-toggle
v-model="myrecfiltertoggle"
push
glossy
toggle-color="primary"
:options="getoptions"
/>
<div class="text-center q-ma-lg">
<q-btn push size="lg" color="primary" rounded label="Ricarica" @click="ricarica"></q-btn>
</div>

View File

@@ -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()) {

View File

@@ -41,6 +41,7 @@ export default defineComponent({
t,
getMyUsername,
Username,
tools,
}
},

View File

@@ -1,5 +1,6 @@
<template>
<q-footer
v-if="tools.isUserOk()"
class="bg-white small-screen-only"
bordered
>

View File

@@ -221,6 +221,8 @@ export interface IGlobalState {
rightCartOpen: boolean
category: string
stateConnection: string
serverError: boolean
serverMsgError: any
networkDataReceived: boolean
clickcmd?: string
cfgServer: ICfgServer[]
@@ -256,6 +258,7 @@ export interface IGlobalState {
TIMER_STATE: number
URL_RITORNA: string
URL_RESTORE: string
serverHost?: string
levels: ILevel[],
adtypes: IAdType[],
adtypegoods: IAdType[],

View File

@@ -10,6 +10,7 @@
</span>
<div class="q-ma-sm q-gutter-sm q-pa-xs">
<CTitleBanner title="Gruppi"></CTitleBanner>
<CGridTableRec
prop_mytable="groups"
@@ -21,6 +22,7 @@
noresultLabel="Il filtro selezionato non ha trovato nessun risultato">
</CGridTableRec>
</div>
</CMyPage>
</template>

View File

@@ -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<Types.AxiosSuccess | Types.AxiosError | undefined> {
let ricevuto = false
const userStore = useUserStore()
const globalStore = useGlobalStore()
@@ -56,6 +57,7 @@ async function Request(type: string, path: string, payload: any): Promise<Types.
let response: AxiosResponse
if (type === 'post' || type === 'put' || type === 'patch') {
response = await axiosInstance[type](path, payload, {
baseURL: globalStore.getServerHost(),
headers: {
'Content-Type': 'application/json',
'x-auth': userStore.x_auth_token,
@@ -103,6 +105,7 @@ async function Request(type: string, path: string, payload: any): Promise<Types.
} if (type === 'get' || type === 'delete') {
// @ts-ignore
response = await axiosInstance[type](path, {
baseURL: globalStore.getServerHost(),
params: payload,
headers: {
'Content-Type': 'application/json',
@@ -113,6 +116,7 @@ async function Request(type: string, path: string, payload: any): Promise<Types.
return new Types.AxiosSuccess(response.data, response.status)
} if (type === 'postFormData') {
response = await axiosInstance.post(path, payload, {
baseURL: globalStore.getServerHost(),
headers: {
'Content-Type': 'multipart/form-data',
'x-auth': userStore.x_auth_token,

View File

@@ -1201,6 +1201,18 @@ export const tools = {
],
},
getServerHost() {
const globalStore = useGlobalStore()
if (globalStore.serverHost) {
return globalStore.serverHost
} else {
return process.env.MONGODB_HOST
}
},
getTitlePriority(priority: number): string {
let cl = ''
@@ -3384,7 +3396,7 @@ export const tools = {
}
},
geturlupload() {
return process.env.MONGODB_HOST + `/uploadnew/${this.getvers()}/`
return tools.getServerHost() + `/uploadnew/${this.getvers()}/`
},
escapeslash(mystr: string) {
return mystr.replace(/\//g, '-')
@@ -4398,7 +4410,7 @@ export const tools = {
async registeredemail(email: string) {
const VALIDATE_USER_URL = process.env.MONGODB_HOST + '/email/ck'
const VALIDATE_USER_URL = tools.getServerHost() + '/email/ck'
let onSuccess = (res: AxiosResponse) => {
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'
}

View File

@@ -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
}
},
},
})

View File

@@ -24,7 +24,6 @@
:filtercustom="filtercustom"
:prop_searchList="searchList"
:showType="costanti.SHOW_USERINFO"
keyMain=""
:showCol="false"
:extraparams="extraparams()">

View File

@@ -34,8 +34,8 @@
<q-tabs v-model="tabgrp" class="text-blue">
<q-tab label="Info" name="info" icon="fas fa-info"></q-tab>
<q-tab v-if="!!mygrp.note && userStore.IsMyGroupByGroupname(mygrp.groupname)" label="Pagina" name="page" icon="fas fa-file-word"></q-tab>
<q-tab v-if="userStore.IsMyGroupByGroupname(mygrp.groupname)" label="Iscritti" name="membri" icon="fas fa-users"></q-tab>
<q-tab v-if="!!mygrp.note && userStore.IsMyGroupByGroupname(mygrp.groupname) || tools.iAmAdminGroup(groupname)" label="Pagina" name="page" icon="fas fa-file-word"></q-tab>
<q-tab v-if="userStore.IsMyGroupByGroupname(mygrp.groupname) || tools.iAmAdminGroup(groupname)" label="Iscritti" name="membri" icon="fas fa-users"></q-tab>
<q-tab v-if="tools.iAmAdminGroup(groupname)" label="Richieste" name="rich" icon="fas fa-user-plus"></q-tab>
</q-tabs>
@@ -111,7 +111,7 @@
</q-tab-panel>
<q-tab-panel name="page">
<div v-if="mygrp.title">
<div v-if="mygrp.note">
<br>
<div class="q-ma-sm q-gutter-sm q-pa-xs">
<div v-if="mygrp.note" v-html="mygrp.note">
@@ -142,7 +142,6 @@
:filtercustom="filtercustom"
:prop_searchList="searchList"
:showType="costanti.SHOW_USERINFO"
keyMain=""
:showCol="false"
:extrafield="groupname"
:extraparams="extraparams()"

View File

@@ -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(<ISearchList[]>[])
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,
}
}
})

View File

@@ -4,13 +4,20 @@
v-model="filter"
:finder="true"
>
<CFinder
:table="toolsext.TABMYGROUPS"
:showFilterPersonal="false"
/>
<!--
<CGridTableRec
prop_mytable="mygroups"
prop_mytitle=""
:prop_mycolumns="colmyUserGroup"
prop_colkey="_id"
col_title="groupname"
:vertical="costanti.VISUTABLE_LISTA"
:vertical="costanti.VISUTABLE_SCHEDA_GROUP"
nodataLabel=" Nessun Gruppo"
:prop_search="true"
hint="nome del gruppo da trovare"
@@ -30,6 +37,7 @@
:extraparams="extraparams()">
</CGridTableRec>
-->
</CMyGroups>
<div v-if="filter === costanti.CREATE_GROUP">