InfiniteScroll 3

fix user list
send telegram text
invited show in profile
This commit is contained in:
paoloar77
2022-08-18 05:26:21 +02:00
parent 8a41aff739
commit ed6abf2b07
23 changed files with 131 additions and 61 deletions

View File

@@ -850,7 +850,7 @@ export default defineComponent({
// calculate starting row of data
const startRow = numRecLoaded.value
const endRow = startRow + fetchCount
console.log('startRow', startRow, 'endRow', endRow, 'rowsNumber', pagination.value.rowsNumber)
// console.log('startRow', startRow, 'endRow', endRow, 'rowsNumber', pagination.value.rowsNumber)
if ((startRow < pagination.value.rowsNumber) || clickbuttsearch.value) {
@@ -859,14 +859,14 @@ export default defineComponent({
return fetchFromServer(startRow, endRow, myfilternow, myfilterandnow, sortBy, descending).then((ris: any) => {
pagination.value.rowsNumber = getRowsNumberCount(myfilter)
console.log(' ...rowsNumber', pagination.value.rowsNumber)
// console.log(' ...rowsNumber', pagination.value.rowsNumber)
if (returnedData.value === []) {
// no more data
} else {
try {
numRecLoaded.value = numRecLoaded.value + (returnedData.value ? returnedData.value.length : 0)
console.log(' ...numRecLoaded.value', numRecLoaded.value)
// console.log(' ...numRecLoaded.value', numRecLoaded.value)
serverData.value = [...serverData.value, ...returnedData.value]
} catch (e) {
serverData.value = []
@@ -890,7 +890,7 @@ export default defineComponent({
myinfscroll.value.resume()
}
console.log(' ...DONE ')
// console.log(' ...DONE ')
done(pagination.value.rowsNumber === 0 ? true : false)
})
} else {
@@ -1869,7 +1869,7 @@ export default defineComponent({
}
function onLoadScroll (index: number, done: any) {
if (index > 0) {
if (index > 1) {
console.log('onLoadScroll', index, 'RECLOAD', numRecLoaded.value, 'ROWS: ', pagination.value.rowsNumber)
if (numRecLoaded.value < pagination.value.rowsNumber || (pagination.value.rowsNumber <= 0 && clickbuttsearch.value)) {
if (pagination.value.rowsNumber === 0) {
@@ -1881,6 +1881,8 @@ export default defineComponent({
} else {
done(true)
}
} else{
done()
}
}
// onMounted(mounted)

View File

@@ -35,7 +35,7 @@
</q-inner-loading>
<div v-if="shared_consts.VERTIC_SHOW_GRID.includes(myvertical)">
<div v-if="(prop_search || canEdit)" class="q-my-xs text-right">
<div v-if="(prop_search || canEdit) && finder" class="q-my-xs text-right">
<q-btn size="sm" dense icon="fas fa-filter" :label="!showfilter ? $t('grid.showfilters') : $t('grid.hidefilters')"
@click="showfilter = !showfilter"></q-btn>
</div>
@@ -169,7 +169,7 @@
<template v-slot:prepend>
<q-icon name="search"/>
</template>
<template v-if="searchList" v-slot:after>
<template v-if="searchList && finder" v-slot:after>
<q-btn dense label="" color="primary" @click="showfilter = !showfilter" icon="fas fa-filter"></q-btn>
</template>
</q-input>
@@ -199,6 +199,7 @@
<div v-if="pagination.rowsNumber > 1 && prop_search">{{ pagination.rowsNumber }} elementi trovati</div>
</div>
<q-infinite-scroll
ref="myinfscroll"
v-if="shared_consts.VERTIC_SHOW_GRID.includes(myvertical)"
@@ -209,36 +210,73 @@
>
<div v-for="(row, index) in serverData" :key="index" class="caption">
<div v-if="row && shared_consts.TABLES_WITH_DATE.includes(tablesel)">
<div
v-if="showType === costanti.SHOW_MYCARD || (myvertical !== costanti.VISUTABLE_USER_TABGROUP && myvertical === costanti.VISUTABLE_LISTA && shared_consts.TABLES_VISU_CMYSRECCARD.includes(tablesel)) ">
<div v-if="row.dateTimeStart && (tools.getstrVeryShortDate(row.dateTimeStart) !== actual)" class="actualdate">
<span style="display: none">{{ actual = tools.getstrVeryShortDate(row.dateTimeStart) }}</span>
<q-chip class="text-center shadow-5 glossy bg-orange" icon="fas fa-calendar-day">{{ tools.getstrDateLong(row.dateTimeStart) }}</q-chip>
<div v-if="row && shared_consts.TABLES_WITH_DATE.includes(tablesel)">
<div v-if="row.dateTimeStart && (tools.getstrVeryShortDate(row.dateTimeStart) !== actual)" class="actualdate">
<span style="display: none">{{ actual = tools.getstrVeryShortDate(row.dateTimeStart) }}</span>
<q-chip class="text-center shadow-5 glossy bg-orange" icon="fas fa-calendar-day">{{ tools.getstrDateLong(row.dateTimeStart) }}</q-chip>
</div>
</div>
<CMyRecGrpCard
v-if="tablesel === toolsext.TABMYGROUPS"
:table="tablesel"
:prop_myrec="row"
@cmdext="cmdExt"
>
</CMyRecGrpCard>
<CMyRecCard
v-else
:table="tablesel"
:prop_myrec="row"
@cmdext="cmdExt"
>
</CMyRecCard>
</div>
<div
v-else-if="((showType === costanti.SHOW_USERINFO) && myvertical !== costanti.VISUTABLE_SCHEDA_USER) || ((myvertical === 2) && (shared_consts.TABLES_VISU_LISTA_USER.includes(tablesel)))"
class="fill-all-width">
<div>
<CMyUser
:notsetcmd="true"
:mycontact="row"
:visu="visufind"
:groupname="extrafield"
:labelextra="col_title ? row[col_title] : ''"
:labelFooter="col_footer ? getLabelFooterByRow(row) : ''"
>
</CMyUser>
<q-separator></q-separator>
</div>
</div>
<div
v-else-if="((showType === costanti.SHOW_GROUPINFO) && myvertical !== costanti.VISUTABLE_SCHEDA_GROUP) || ((myvertical === 2) && (tablesel === 'mygroups'))"
class="fill-all-width">
<div>
<CMyGroups
v-model="filtergrp"
:finder="false"
:mygrp="row"
:visu="costanti.FIND_GROUP"
/>
</div>
</div>
<CMyRecGrpCard
v-if="tablesel === toolsext.TABMYGROUPS"
:table="tablesel"
:prop_myrec="row"
@cmdext="cmdExt"
>
</CMyRecGrpCard>
<CMyRecCard
v-else
:table="tablesel"
:prop_myrec="row"
@cmdext="cmdExt"
>
</CMyRecCard>
</div>
<template v-slot:loading>
<div class="row justify-center q-my-md">
<q-spinner-dots color="primary" size="40px"/>
</div>
</template>
</q-infinite-scroll>
<q-table
v-else
:grid="shared_consts.VERTIC_SHOW_GRID.includes(myvertical)"

View File

@@ -13,8 +13,10 @@
<template v-slot:control>
<div class="self-center full-width no-outline" tabindex="0">
{{ value }}
<slot></slot>
</div>
</template>
</q-field>
</div>
</template>

View File

@@ -72,14 +72,15 @@
<div class="row q-ma-sm q-pa-sm justify-center">
<div class="q-ma-sm">
<q-btn
icon="far fa-file-alt" label="Apri Pagina" color="primary" text-color="white"
icon="far fa-file-alt" label="Apri" color="primary" text-color="white"
:to="tools.getToByCol(col, table, myrec)"
/>
</div>
<div class="q-ma-sm">
<q-btn
color="primary" text-color="white" icon="fas fa-copy" label="Condividi Pagina"
v-if="myrec._id"
text-color="black" icon="fas fa-share-alt"
label="Condividi"
@click="condividipag"></q-btn>
</div>
</div>

View File

@@ -88,7 +88,10 @@ export default defineComponent({
}
function condividipag() {
return tools.copyStringToClipboard($q, self.location.host + tools.getPathByTable(props.table, myrec.value._id), true)
const mystr = self.location.host + tools.getPathByTable(props.table, myrec.value._id)
tools.copyStringToClipboard($q, mystr, true)
tools.sendMsgTelegramCmd($q, t, shared_consts.MsgTeleg.SHARE_TEXT, false, mystr)
return true
}
function showBadge() {

View File

@@ -51,7 +51,7 @@
</div>
<div v-else-if="mycol.name === 'numMaxPeopleHosp'">
<div class="text-bacheca">
<span class="accom_maxosp">{{tools.getValue(myrec, mycol.field, mycol.subfield) }}</span>{{ t('hosps.numMaxPeopleHosp') }}
<span class="accom_maxosp">{{ tools.getValue(myrec, mycol.field, mycol.subfield) }}</span>{{ t('hosps.numMaxPeopleHosp') }}
</div>
</div>
<div v-else-if="mycol.name === 'dateTimeStart'" class="text-center cal">
@@ -105,17 +105,15 @@
class="row q-ma-sm q-pa-sm justify-center">
<div class="q-ma-sm">
<q-btn
icon="far fa-file-alt" label="Apri Pagina" color="primary" text-color="white"
icon="far fa-file-alt" label="Apri" color="primary" text-color="white"
:to="tools.getToByCol(col, table, myrec)"
/>
</div>
</div>
<div v-if="myrec._id"
class="row q-ma-sm q-pa-sm justify-center">
<div class="q-ma-sm">
<q-btn
color="primary" text-color="white" icon="fas fa-copy" label="Condividi Pagina"
v-if="myrec._id"
text-color="black" icon="fas fa-share-alt"
label="Condividi"
@click="condividipag"></q-btn>
</div>
</div>

View File

@@ -47,7 +47,7 @@
<!--<span class="dateevent" v-if="myrec.dateTimeStart">dal <span class="datainizio">{{tools.getstrVeryShortDate(myrec.dateStart) }}</span> al <span class="datafine">{{ tools.getstrVeryShortDate(myrec.dateEnd) }}</span>
</span>-->
</q-item-label>
<q-item-label lines="3" v-if="myrec.descr">{{ myrec.descr }}<br>
<q-item-label lines="4" v-if="myrec.descr">{{ myrec.descr }}<br>
</q-item-label>
<q-item-label lines="1" style="text-align: right" class="text_user_city">
<span class="text-weight-bold">{{ myrec.username }}</span> -

View File

@@ -1,6 +1,6 @@
<template>
<div>
<div class="q-ma-sm q-gutter-sm q-pa-xs">
<div class="q-my-sm q-gutter-xs q-py-xs">
<CGridTableRec
v-if="filtercustom.length > 0 && col && col.length > 0"
:prop_mytable="table"