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

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