InfiniteScroll: Le liste (Beni / Servizi / Eventi) devono essere caricate in automatico, scorrendo la lista...

fix category
This commit is contained in:
paoloar77
2022-08-15 15:10:00 +02:00
parent 0b6188699e
commit c93361dfa2
38 changed files with 1051 additions and 328 deletions

View File

@@ -316,7 +316,7 @@ export default defineComponent({
tablesel: 'cities',
},
{
label: 'Visiblità',
label: 'Visibilità',
table: 'pub_to_share',
key: 'pub_to_share',
type: costanti.FieldType.select,
@@ -353,7 +353,7 @@ export default defineComponent({
label: 'Categoria',
table: 'skills',
key: 'idSkill',
value: tools.getCookie(tools.COOK_SEARCH + 'skills' + '_' + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI, true),
value: tools.getCookie(tools.COOK_SEARCH + toolsext.TABSKILLS + '_' + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI, true),
arrvalue: [],
type: costanti.FieldType.select,
addall: true,
@@ -517,7 +517,7 @@ export default defineComponent({
label: 'Categoria',
table: 'skills',
key: 'idSkill',
value: tools.getCookie(tools.COOK_SEARCH + 'skills' + '_' + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI, true),
value: tools.getCookie(tools.COOK_SEARCH + toolsext.TABSKILLS + '_' + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI, true),
arrvalue: [],
type: costanti.FieldType.select,
addall: true,
@@ -706,11 +706,11 @@ export default defineComponent({
filter: null,
useinput: false,
},
/*{
{
label: 'Settore',
table: 'sectorgoods',
key: 'idSectorGood',
value: tools.getCookie(tools.COOK_SEARCH + 'sectorgoods', 0),
value: tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORGOODS, 0, true),
arrvalue: [],
type: costanti.FieldType.select,
filter: null,
@@ -722,7 +722,7 @@ export default defineComponent({
label: 'Categoria',
table: 'goods',
key: 'idGood',
value: tools.getCookie(tools.COOK_SEARCH + 'goods' + '_' + tools.getCookie(tools.COOK_SEARCH + 'sectorgoods', costanti.FILTER_TUTTI), costanti.FILTER_TUTTI),
value: tools.getCookie(tools.COOK_SEARCH + toolsext.TABGOODS + '_' + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORGOODS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI, true),
arrvalue: [],
type: costanti.FieldType.select,
addall: true,
@@ -730,6 +730,7 @@ export default defineComponent({
showcount: true,
useinput: false,
},
/*
{
label: 'Consegna',
table: 'shippings',
@@ -910,6 +911,8 @@ export default defineComponent({
visibility: 1,
admins: 1,
idCatGrp: 1,
date_created: 1,
date_updated: 1,
photos: 1,
idCity: 1,
note: 1,
@@ -933,6 +936,8 @@ export default defineComponent({
visibility: 1,
admins: 1,
idCatGrp: 1,
date_created: 1,
date_updated: 1,
photos: 1,
idCity: 1,
note: 1,
@@ -955,6 +960,8 @@ export default defineComponent({
descr: 1,
img: 1,
idCatGrp: 1,
date_created: 1,
date_updated: 1,
visibility: 1,
admins: 1,
photos: 1,
@@ -1027,9 +1034,10 @@ export default defineComponent({
},
lookup3: {
lk_tab: 'sectorgoods',
lk_LF: 'recGood.idSectorGood',
// lk_LF: 'recGood.idSectorGood',
lk_LF: 'idSectorGood',
lk_FF: '_id',
lk_as: 'sectorgood',
lk_as: 'sectorGood',
af_objId_tab: '',
},
lookup5: {
@@ -1094,7 +1102,8 @@ export default defineComponent({
},
lookup3: {
lk_tab: toolsext.TABSECTORS,
lk_LF: 'recSkill.idSector',
// lk_LF: 'recSkill.idSector',
lk_LF: 'idSector',
lk_FF: '_id',
lk_as: 'sector',
af_objId_tab: '',
@@ -1210,7 +1219,8 @@ export default defineComponent({
},
lookup3: {
lk_tab: toolsext.TABSECTORS,
lk_LF: 'recSkill.idSector',
// lk_LF: 'recSkill.idSector',
lk_LF: 'idSector',
lk_FF: '_id',
lk_as: 'sector',
af_objId_tab: '',

View File

@@ -51,6 +51,11 @@
</CGridTableRec>
</div>
<q-page-scroller position="bottom-right" :scroll-offset="850" :offset="[18, 18]" style="opacity: 0.3">
<q-btn fab icon="keyboard_arrow_up" color="accent"/>
</q-page-scroller>
</div>
</template>

View File

@@ -9,6 +9,7 @@
.tdclass, .trclass{
min-height: 20px !important;
margin-top: 5px;
}
.q-table td {

View File

@@ -251,8 +251,12 @@ export default defineComponent({
const $router = useRouter()
const myinfscroll = ref(null)
const serverData: any = ref([])
const numRecLoaded = ref(0)
const spinner_visible = ref(false)
const changetable = ref(false)
const searchList = ref(<ISearchList[]>[])
let actual = ''
@@ -302,7 +306,10 @@ export default defineComponent({
watch(() => searchList.value, (to: any, from: any) => {
// console.log('watch searchlist', to)
refresh()
if (searchList.value && !changetable.value) {
console.log('REFRR searchList.value', to)
refresh()
}
})
watch(() => showfilteradv.value, (newval: any, from: any) => {
@@ -311,7 +318,10 @@ export default defineComponent({
watch(() => props.filtercustom, (to: any, from: any) => {
// console.log('filtercustom', to)
refresh()
if (JSON.stringify(to) !== JSON.stringify(from)) {
console.log('REFRR props.filtercustom', to, from)
refresh()
}
})
$router.beforeResolve((to: any) => {
@@ -325,6 +335,7 @@ export default defineComponent({
})
function setCategBySector(tablecat: string, tabsector: string, newval: any) {
console.log('setCategBySector', tablecat, tabsector, newval)
const recSector = searchList.value.find((rec) => rec.table === tabsector)
if (recSector)
@@ -341,10 +352,12 @@ export default defineComponent({
if (arrvalues)
trovato = arrvalues.find((rec: any) => rec[rec.key] === valsaved)
}
console.log(' ...item', item)
if (valsaved && trovato)
item.value = valsaved
else {
if (arrvalues) {
console.log(' ...filter tutti')
item.value = costanti.FILTER_TUTTI
}
}
@@ -400,7 +413,7 @@ export default defineComponent({
}
function searchval(newval: any, table: any) {
console.log('searchval', newval, table)
console.log('REFRR searchval', newval, table)
tools.setCookie(tools.COOK_SEARCH + table, newval)
if (table === toolsext.TABSKILLS) {
@@ -410,12 +423,19 @@ export default defineComponent({
}
} else if (table === toolsext.TABSECTORS) {
setCategBySector(toolsext.TABSKILLS, table, newval)
} else if (table === toolsext.TABSECTORGOODS) {
setCategBySector(toolsext.TABGOODS, table, newval)
} else if (table === toolsext.TABREGIONS) {
setProvinceByRegion(toolsext.TABPROVINCE, table, newval)
} else if (table === 'goods') {
setCategBySector('sectorgoods', table, newval)
} else if (table === toolsext.TABGOODS) {
const recSector = searchList.value.find((rec) => rec.table === toolsext.TABSECTORGOODS)
if (recSector) {
tools.setCookie(tools.COOK_SEARCH + table + '_' + recSector.value, newval)
}
// setCategBySector('sectorgoods', table, newval)
}
refresh()
}
@@ -440,7 +460,7 @@ export default defineComponent({
// emulate ajax call
// SELECT * FROM ... WHERE...LIMIT...
async function fetchFromServer(startRow: any, endRow: any, param_myfilter: any, param_myfilterand: any, sortBy: any, descending: any) {
// console.log('fetchFromServer')
let myobj: any = {}
if (sortBy) {
myobj = {}
@@ -623,7 +643,7 @@ export default defineComponent({
let obj2: any = {}
if (idSectorGood > 0) {
// idSectorGood
obj2['sectorgood._id'] = idSectorGood
obj2['sectorGood._id'] = idSectorGood
filtersearch2.push(obj2)
}
} else if ((item.table === 'subskills') && item.value === costanti.FILTER_TUTTI) {
@@ -742,8 +762,11 @@ export default defineComponent({
savefilter()
if (!mytable.value)
if (!mytable.value) {
startsearch.value = false
return
}
// console.log('myfilterandnow', myfilterandnow, 'myfilterandnow', myfilterandnow)
@@ -762,7 +785,7 @@ export default defineComponent({
const startRow = (page - 1) * rowsPerPage
const endRow = startRow + fetchCount
// console.log('startRow', startRow, 'endRow', endRow)
console.log('onRequest: startRow', startRow, 'endRow', endRow)
serverData.value = []
@@ -798,9 +821,86 @@ export default defineComponent({
// ...and turn of loading indicator
loading.value = false
spinner_visible.value = false
changetable.value = false
startsearch.value = false
})
}
function onUpdateData(index: number, myprops: any, done: any) {
const { page, rowsPerPage, rowsNumber, sortBy, descending } = myprops.pagination
const myfilternow = myfilter.value
const myfilterandnow = myfilterand.value
savefilter()
if (!mytable.value) {
startsearch.value = false
if (myinfscroll.value) {
// @ts-ignore
myinfscroll.value.resume()
}
done()
return
}
// function all rows if "All" (0) is rowsel
const fetchCount = rowsPerPage === 0 ? rowsNumber : rowsPerPage
// calculate starting row of data
const startRow = numRecLoaded.value
const endRow = startRow + fetchCount
console.log('startRow', startRow, 'endRow', endRow, 'fetchCount', fetchCount)
if (startRow < pagination.value.rowsNumber) {
// fetch data from "server"
return fetchFromServer(startRow, endRow, myfilternow, myfilterandnow, sortBy, descending).then((ris: any) => {
pagination.value.rowsNumber = getRowsNumberCount(myfilter)
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)
serverData.value = [...serverData.value, ...returnedData.value]
} catch (e) {
serverData.value = []
}
}
// don't forfunction to update local pagination object
pagination.value.page = page
pagination.value.rowsPerPage = rowsPerPage
pagination.value.sortBy = sortBy
pagination.value.descending = descending
// console.log('pagination', pagination)
// ...and turn of loading indicator
changetable.value = false
startsearch.value = false
if (myinfscroll.value) {
// @ts-ignore
myinfscroll.value.resume()
}
console.log(' ...DONE ')
done()
})
} else {
startsearch.value = false
if (myinfscroll.value) {
// @ts-ignore
myinfscroll.value.resume()
}
}
}
function refresh_arr() {
const myarr = [...serverData.value]
@@ -809,19 +909,37 @@ export default defineComponent({
}
function refresh_table() {
onRequest({
pagination: pagination.value
})
rowclicksel.value = null
}
function refresh_infscroll(done: any) {
rowclicksel.value = null
onUpdateData(0,
{
pagination: pagination.value
}, done)
}
function refresh() {
console.log('refresh', 'startsearch', startsearch.value)
// console.log('refresh')
if (!startsearch.value)
if (startsearch.value)
return false
console.log('REFRESH!')
startsearch.value = true
serverData.value = []
numRecLoaded.value = 0
search.value = search.value.trim()
@@ -834,10 +952,21 @@ export default defineComponent({
// console.log('myfilter', myfilter.value)
refresh_table()
if (shared_consts.VERTIC_SHOW_GRID.includes(myvertical.value)) {
if (myinfscroll.value) {
// @ts-ignore
myinfscroll.value.stop()
}
refresh_infscroll(function () { return true })
} else {
refresh_table()
}
}
watch(() => mycodeid.value, (newval, oldval) => {
console.log('REFRR - mycodeid.value', newval)
refresh()
})
@@ -846,6 +975,8 @@ export default defineComponent({
myvertical.value === costanti.VISUTABLE_SCHEDA_GROUP ||
myvertical.value === costanti.VISUTABLE_SCHEDA_USER ||
(props.showType === costanti.SHOW_USERINFO))) {
console.log('REFRR - updateTables.value', newval)
refresh()
userStore.updateTables = false
@@ -865,6 +996,10 @@ export default defineComponent({
return userStore.isFacilitatore
}
function isAdmin() {
return userStore.isAdmin
}
function disabilita() {
if ((mytable.value === 'users') && (isFacilitatore() && !userStore.isAdmin && !userStore.isManager)) {
return true
@@ -891,6 +1026,14 @@ export default defineComponent({
item['idSkill'] = costanti.FILTER_NESSUNO
newRecord.value['idSkill'] = item['idSkill']
}
} else if (col.jointable === toolsext.TABSECTORGOODS) {
// Sbianca la select della Categoria Beni
if (item && item.hasOwnProperty('idGood')) {
item['idGood'] = costanti.FILTER_NESSUNO
newRecord.value['idGood'] = item['idGood']
console.log('newRecord', newRecord)
}
}
rowsel = item
idsel = item._id
@@ -936,7 +1079,7 @@ export default defineComponent({
}
function annulla(val: any) {
console.log('annulla')
console.log('GridTable annulla')
/*
if (newRecord.value) {
globalStore.DeleteRec({ table: mytable.value, id: newRecord.value._id })
@@ -1280,7 +1423,8 @@ export default defineComponent({
}
function changeTable(mysel: any) {
// console.log('changeTable', tablesel.value)
console.log('changeTable', tablesel.value)
changetable.value = true
if (tablesel.value === undefined || tablesel.value === '')
return
@@ -1379,12 +1523,12 @@ export default defineComponent({
}
}
startsearch.value = true
console.log('REFRR - changetable')
refresh()
}
function doSearch() {
console.log('REFRR - doSearch')
refresh()
}
@@ -1721,6 +1865,17 @@ export default defineComponent({
return actualDate.value
}
function onLoadScroll (index: number, done: any) {
if (index > 0) {
console.log('onLoadScroll', index, 'RECLOAD', numRecLoaded.value, 'ROWS: ', pagination.value.rowsNumber)
if (numRecLoaded.value >= pagination.value.rowsNumber) {
done(true)
} else {
pagination.value.page = pagination.value.page + 1
refresh_infscroll(done)
}
}
}
// onMounted(mounted)
created()
@@ -1809,6 +1964,10 @@ export default defineComponent({
getActualDate,
actualDate,
actual,
isAdmin,
onLoadScroll,
numRecLoaded,
myinfscroll,
}
}
})

View File

@@ -33,7 +33,208 @@
<q-inner-loading :showing="spinner_visible">
<q-spinner-tail size="2em" color="primary"/>
</q-inner-loading>
<div v-if="shared_consts.VERTIC_SHOW_GRID.includes(myvertical)">
<div v-if="searchList"
:class="$q.screen.lt.sm ? `` : `row` + ` text-blue `">
<span v-for="(item, index) in searchList" :key="index">
<!--<div class="text-center q-my-xs" v-if="(item.type === costanti.FieldType.separator)">
<q-btn size="sm" dense :icon="!showfilteradv ? 'fas fa-arrow-down' : 'fas fa-arrow-up'" label="Filtri Avanzati" @click="showfilteradv = !showfilteradv"></q-btn>
</div>-->
<CMySelect
:col="fieldsTable.getColByColumns(mycolumns, item.key)"
v-if="(item.type === costanti.FieldType.select) || (item.type === costanti.FieldType.select_by_server)"
:label="labelcombo(item)"
v-model:value="item.value"
@update:value="searchval(item.value, item.table)"
:addall="item.addall"
:addnone="item.addnone"
:tablesel="item.type === costanti.FieldType.select_by_server ? item.tablesel : ''"
:pickup="item.type === costanti.FieldType.select_by_server"
label-color="primary"
class="combowidth"
color="primary"
:icon_alternative="item.icon"
:optval="fieldsTable.getKeyByTable(item.table)"
:optlab="fieldsTable.getLabelByTable(item.table)"
:options="valoriopt(item, false)"
:filter="item.filter"
:filter_extra="item.filter_extra"
:useinput="item.useinput && item.type !== costanti.FieldType.select_by_server">
</CMySelect>
<!--<div v-if="item.type === costanti.FieldType.multiselect_by_server">
item: {{ item}}
</div>-->
<CMySelect
v-if="item.type === costanti.FieldType.multiselect_by_server"
:col="fieldsTable.getColByColumns(mycolumns, item.key)"
:multiselect_by_server="true"
:label="labelcombo(item)"
v-model:arrvalue="item.arrvalue"
@update:arrvalue="searchval(item.arrvalue, item.table)"
:addall="item.addall"
:addnone="item.addnone"
:tablesel="item.tablesel"
:pickup="true"
:param1="item.param1"
label-color="primary"
class="combowidth"
color="primary"
:icon_alternative="item.icon"
:optval="fieldsTable.getKeyByTable(item.table)"
:optlab="fieldsTable.getLabelByTable(item.table)"
:filter="item.filter"
:filter_extra="item.filter_extra"
:options="valoriopt(item, false)"
:useinput="true">
</CMySelect>
<q-select
v-if="(item.type === costanti.FieldType.multiselect)"
v-model="item.arrvalue"
label-color="primary"
:label="labelcombo(item)"
@update:model-value="searchval(item.arrvalue, item.table)"
rounded
dense
outlined
multiple
options-dense
emit-value
map-options
stack-label
:useinput="item.useinput"
:options="valoriopt(item, item.addall, item.addnone)"
:filter="item.filter"
class="combowidth"
:option-value="fieldsTable.getKeyByTable(item.table)"
>
<template v-if="item.icon" v-slot:prepend>
<q-icon :name="item.icon"/>
</template>
<template
v-if="item.arrvalue.length >= 1"
v-slot:selected-item="scope">
<div
v-if="scope.opt[fieldsTable.getLabelByTable(item.table)] || (scope.opt && checkIfShowRec(scope.opt)) ">
<q-chip
removable
dense
@remove="scope.removeAtIndex(scope.index)"
v-if="checkIfShowRec(scope.opt)"
color="white"
text-color="mycol"
class="q-my-none q-ml-xs q-mr-none"
>
<q-avatar color="primary" text-color="white" :icon="item.icon" size="12px"/>
{{ scope.opt[fieldsTable.getLabelByTable(item.table)] || (scope.opt) }}
</q-chip>
</div>
</template>
<template v-slot:option="{ itemProps, opt, selected, toggleOption }">
<q-item v-bind="itemProps">
<q-item-section>
<q-item-label>{{ opt[fieldsTable.getLabelByTable(item.table)] }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-toggle :model-value="selected" @update:model-value="toggleOption(opt)"/>
</q-item-section>
</q-item>
</template>
</q-select>
</span>
</div>
<div v-if="(prop_search || canEdit)"
class="row justify-center vertical-middle">
<div v-if="prop_search" class="q-mr-sm full-width">
<q-input
v-model="search" filled dense type="search" debounce="500" :hint="hint"
label="Cerca"
v-on:keyup.enter="doSearch"
>
<template v-slot:after>
<q-btn v-if="mytable" dense label="" color="primary" @click="refresh" icon="search"></q-btn>
</template>
</q-input>
</div>
<q-space></q-space>
<q-select
v-if="mytable && pagination.rowsNumber > 0 && (prop_search || canEdit) && showCol && myvertical === 0"
v-model="colVisib"
rounded
outlined
multiple
dense
options-dense
:display-value="$t('grid.columns')"
emit-value
map-options
:options="mycolumns"
option-value="name"
@update:model-value="changeCol">
</q-select>
</div>
<div v-if="pagination.rowsNumber === 1 && prop_search">{{ pagination.rowsNumber }} elemento trovato</div>
<div v-if="pagination.rowsNumber > 1 && prop_search">{{ pagination.rowsNumber }} elementi trovati</div>
</div>
numRecLoaded: {{numRecLoaded}}
<q-infinite-scroll
ref="myinfscroll"
v-if="shared_consts.VERTIC_SHOW_GRID.includes(myvertical)"
initial-index="0"
@load="onLoadScroll" :offset="350"
debounce="300"
>
INFINITE: <br />
<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="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>
<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)"
:grid-header="shared_consts.VERTIC_SHOW_GRID.includes(myvertical) && shared_consts.TABLES_WITH_SORTING.includes(mytable)"
flat
@@ -42,10 +243,14 @@
:rows="serverData"
:columns="mycolumns"
:filter="myfilter"
v-model:pagination="pagination"
v-model:pagination="pagination2"
virtual-scroll
:virtual-scroll-item-size="48"
:virtual-scroll-sticky-size-start="48"
@virtual-scroll="onScroll"
:rows-per-page-options="[0]"
:row-key="colkey"
:loading="loading"
@request="onRequest"
@selection="selectionclick"
binary-state-sort
:visible-columns="colVisib"
@@ -98,7 +303,7 @@
</template>
<template v-slot:top-right v-if="tablesList || arrfilters">
<span style="display: none">{{actual = null}}</span>
<span style="display: none">{{ actual = null }}</span>
<q-select
v-if="tablesList"
@@ -291,17 +496,15 @@
<div v-if="pagination.rowsNumber === 1 && prop_search">{{ pagination.rowsNumber }} elemento trovato</div>
<div v-if="pagination.rowsNumber > 1 && prop_search">{{ pagination.rowsNumber }} elementi trovati</div>
<div v-if="choose_visutype" class="">
<q-radio v-model="myvertical" :val="2" label="Lista"
@update:model-value="tools.setCookie('myv_' + prop_mytable, myvertical) "/>
<q-radio v-if="mytable === toolsext.TAB" v-model="myvertical" :val="costanti.VISUTABLE_SCHEDA_GROUP"
<div v-if="choose_visutype && $q.screen.gt.xs && isAdmin()" class="">
<q-radio v-model="myvertical" :val="2" label="Lista"/>
<!--<q-radio v-if="mytable === toolsext.TAB" v-model="myvertical" :val="costanti.VISUTABLE_SCHEDA_GROUP"
label="Scheda"
@update:model-value="tools.setCookie('myv_' + prop_mytable, myvertical) "/>
<q-radio v-else-if="mytable !== toolsext.TABMYGROUPS && !finder" v-model="myvertical"
:val="costanti.VISUTABLE_SCHEDA_USER" label="Scheda"
@update:model-value="tools.setCookie('myv_' + prop_mytable, myvertical) "/>
<q-radio v-if="$q.screen.gt.xs" v-model="myvertical" :val="0" label="Tabella"
@update:model-value="tools.setCookie('myv_' + prop_mytable, myvertical) "/>
:val="costanti.VISUTABLE_SCHEDA_USER" slabel="Scheda"
@update:model-value="tools.setCookie('myv_' + prop_mytable, myvertical) "/>-->
<q-radio v-if="$q.screen.gt.xs" v-model="myvertical" :val="0" label="Tabella"/>
</div>
</template>
@@ -357,8 +560,8 @@
<div v-if="props.row && shared_consts.TABLES_WITH_DATE.includes(tablesel)">
<div v-if="props.row.dateTimeStart && (tools.getstrVeryShortDate(props.row.dateTimeStart) !== actual)" class="actualdate">
<span style="display: none">{{actual = tools.getstrVeryShortDate(props.row.dateTimeStart)}}</span>
<q-chip class="text-center shadow-5 glossy bg-orange" icon="fas fa-calendar-day">{{tools.getstrDateLong(props.row.dateTimeStart) }}</q-chip>
<span style="display: none">{{ actual = tools.getstrVeryShortDate(props.row.dateTimeStart) }}</span>
<q-chip class="text-center shadow-5 glossy bg-orange" icon="fas fa-calendar-day">{{ tools.getstrDateLong(props.row.dateTimeStart) }}</q-chip>
</div>
</div>
@@ -611,7 +814,7 @@
label="Campi Avanzati" @click="showfilteradv = !showfilteradv"></q-btn>
</div>-->
<div
v-if="showColCheck(col, tools.TIPOVIS_EDIT_RECORD, false) && col.foredit">
v-if="showColCheck(col, tools.TIPOVIS_EDIT_RECORD, false) && col.foredit" class="tdclass">
<div>
<CMyPopupEdit
:table="mytable"

View File

@@ -35,7 +35,6 @@
</div>
<!--:title="t(mycol.label_trans)"-->
<div v-for="(mycol, index) of col" :key="index">
<div
v-if="(mycol.visible && (tools.checkIfShowField(mycol, tools.TIPOVIS_SHOW_RECORD, false, tools.getValue(myrec, mycol.field, mycol.subfield))))">

View File

@@ -57,6 +57,8 @@ export default defineComponent({
verdana: 'Verdana'
})
const showtools = ref(false)
const toolbarcomp = ref([
['left', 'center', 'right', 'justify'],
['bold', 'italic', 'underline', 'strike'],
@@ -172,6 +174,8 @@ export default defineComponent({
myvalue.value = ''
else
myvalue.value = props.value
showtools.value = tools.getCookie('showtools', '0') === '1'
}
function onPaste (evt: any) {
@@ -213,6 +217,7 @@ export default defineComponent({
tools,
onPaste,
editorRef,
showtools,
}
}
})

View File

@@ -16,7 +16,9 @@
spellcheck="false"
>
<q-btn rounded size="sm" color="primary">
<q-toggle v-model="showtools" :label="showtools ? $t('editor.hidetool') : $t('editor.showtool')" @click="tools.setCookie('showtools', showtools ? '1' : '0')"></q-toggle>
<br>
<q-btn v-if="showtools" rounded size="sm" color="primary">
<q-icon name="colorize" class="cursor-pointer">
<q-popup-proxy>
<q-color v-model="mycolor" @change="setcolor"></q-color>
@@ -30,7 +32,7 @@
toolbar-text-color="white"
toolbar-toggle-color="yellow-8"
toolbar-bg="primary"
:toolbar="toolbarcomp"
:toolbar="showtools ? toolbarcomp : []"
:fonts="myfonts"
@update:model-value="changeval"
@paste="onPaste"

View File

@@ -16,7 +16,6 @@ import { CAccomodation } from '../CAccomodation'
import { tools } from '@store/Modules/tools'
import { costanti } from '@costanti'
// @ts-ignore
// import VueTelInput from 'vue3-tel-input'
// import 'vue3-tel-input/dist/vue3-tel-input.css'
@@ -27,6 +26,7 @@ import MixinUsers from '@/mixins/mixin-users'
import { toolsext } from '@store/Modules/toolsext'
import { shared_consts } from '@/common/shared_vuejs'
export default defineComponent({
name: 'CMyPopupEdit',
emits: ['showandsave', 'update:row', 'show', 'save', 'annulla'],

View File

@@ -54,7 +54,7 @@
<div v-else-if="col.fieldtype === costanti.FieldType.username_chip">
<div class="q-ma-xs">
<q-btn v-if="col.tipovisu === costanti.TipoVisu.LINK && myvalue"
type="a" rounded size="md"
rounded size="md"
:class="{disabled: disable }"
color="white" text-color="blue" :icon="`img:`+userStore.getImgUserByUsername(myvalue)"
:to="col.link.replace(col.name, myvalue)"

View File

@@ -1,7 +1,7 @@
<!--suppress ALL -->
<template>
<div class="q-py-xs centermydiv cardrec" :style="`max-width: `+ (tools.getwidth($q) - 20) +`px; ` + ($q.screen.lt.sm ? (`min-width: `+ (tools.getwidth($q) - 20) +`px;`) : ``)">
<div class="q-py-xs centermydiv cardrec"
:style="`max-width: `+ (tools.getwidth($q) - 20) +`px; ` + ($q.screen.lt.sm ? (`min-width: `+ (tools.getwidth($q) - 20) +`px;`) : ``)">
<q-item v-if="myrec" clickable v-ripple class="shadow-2 q-btn--rounded bg-teal-1">
@@ -12,11 +12,14 @@
<q-icon :name="fieldsTable.getIconByAdType(myrec.adType)" color="white"
class="q-ml-xs"/>
</q-badge>
<q-avatar size="60px">
<q-img :src="tools.getFullFileName(myrec.photos, table, myrec.username, '')" :alt="myrec.descr"
img-class="imgprofile" height="60px"/>
</q-avatar>
</q-item-section>
<q-item-section v-else avatar @click="naviga(`/my/` + myrec.username)">
<q-badge v-if="showBadge()" class="q-my-xs self-center" :color="fieldsTable.getColByAdType(myrec.adType)">
@@ -30,13 +33,16 @@
</q-item-section>
<q-item-section @click="navigaExt(myrec)">
<q-item-label class="full-width">
<span v-for="(rec, ind) of myrec.recSkill" :key="ind"> <q-chip
dense
class="text-center shadow-5 glossy bg-blue chipmodif">{{ rec.descr }}</q-chip></span>
<span v-for="(rec, ind) of myrec.myskill" :key="ind"> <q-chip
dense
class="text-center shadow-5 glossy bg-green chipmodif">{{ rec.descr }}</q-chip></span>
<q-item-label lines="1" class="full-width" >
<span v-for="(rec, ind) of tools.getArrSubSector(table, myrec)" :key="ind">
<q-chip dense class="text-center shadow-5 glossy text-white bg-green">{{ rec.descr }}</q-chip>
</span>
<span>
<span v-for="(rec, ind) of tools.getArrSector(table, myrec)" :key="ind">
<q-chip dense class="text-center shadow-5 glossy text-white bg-blue">{{ rec.descr }}</q-chip></span>
</span>
<!--<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>-->
@@ -45,7 +51,7 @@
</q-item-label>
<q-item-label lines="1" style="text-align: right" class="text_user_city">
<span class="text-weight-bold">{{ myrec.username }}</span> -
<span v-for="(rec, ind) of myrec.mycities" :key="ind"><span v-if="ind > 0">, </span>{{ rec.comune }}</span>
<span v-for="(rec, ind) of myrec.mycities" :key="ind"><span v-if="ind > 0">, </span>{{ rec.comune }} ({{ rec.prov }})</span>
</q-item-label>
</q-item-section>

View File

@@ -323,7 +323,12 @@ export default defineComponent({
if (!arrtempOpt.value.includes(myidkey)){
let myobj: any = {}
myobj[props.col.remote_key] = myidkey
myobj[props.col.remote_field] = myrec[props.col.remote_field]
if (props.col.remote_field === 'comune' && !!myrec['prov']) {
myobj[props.col.remote_field] = myrec[props.col.remote_field] + ' (' + myrec['prov'] + ')'
} else {
myobj[props.col.remote_field] = myrec[props.col.remote_field]
}
arrtempOpt.value.push(myobj)
}
}

View File

@@ -68,90 +68,67 @@
</div>
<div v-else-if="!isalreadyReg" class="q-gutter-sm">
<div v-else-if="!isalreadyReg" class="q-gutter-sm q-mt-sm">
<q-input
v-if="showaportador && signup.aportador_solidario !== tools.APORTADOR_NONE"
bg-color="lightblue"
:readonly="true"
v-model="signup.aportador_solidario"
rounded outlined
@blur="v$.aportador_solidario.$touch"
:error="v$.aportador_solidario.$error"
:error-message="tools.errorMsg('aportador_solidario', v$.aportador_solidario)"
maxlength="20"
debounce="1000"
<div v-if="signup.username === 'undefined'">
<br>
Vai su <b>BOT RISO</b> Telegram ed imposta l'Username di Telegram.<br><br>
<q-btn rounded color="primary" icon="fab fa-telegram" label="Apri BOT"
type="a"
:href="tools.getLinkBotTelegram()" target="_blank"></q-btn>
<br><br>
:label="$t('reg.aportador_solidario')">
<template v-slot:prepend>
<q-icon name="person"/>
</template>
</q-input>
<!--<q-input
v-model="signup.email"
rounded outlined
@blur="v$.email.$touch"
@update:model-value="changeemail()"
:error="v$.email.$invalid"
:error-message="tools.errorMsg( 'email', v$.email)"
maxlength="50"
debounce="2000"
:label="$t('reg.email')">
<template v-slot:prepend>
<q-icon name="email"/>
</template>
</q-input> -->
<q-input
v-model="signup.username"
:readonly="tools.getAskToVerifyReg()"
rounded outlined
@blur="v$.username.$touch"
@update:model-value="changeusername"
:error="v$.username.$error"
@keydown.space="(event) => event.preventDefault()"
maxlength="20"
debounce="1000"
:error-message="tools.errorMsg( 'username', v$.username) || (isalreadyReg ? 'L\'Username è gia stato registrato!' : '')"
:label="$t('reg.username_reg')">
<template v-slot:prepend>
<q-icon name="person"/>
</template>
</q-input>
<q-input
v-model="signup.email"
rounded outlined
@update:model-value="changeemail()"
maxlength="50"
debounce="3000"
:rules="[ myRuleEmail ]"
lazy-rules
:label="$t('reg.email_reg')">
<template v-slot:prepend>
<q-icon name="email"/>
</template>
</q-input>
<div v-if="show_namesurname">
</div>
<div v-else>
<q-input
v-model="signup.name"
v-if="showaportador && signup.aportador_solidario !== tools.APORTADOR_NONE"
bg-color="lightblue"
:readonly="true"
v-model="signup.aportador_solidario"
rounded outlined
@blur="v$.name.$touch"
:error="v$.name.$error"
maxlength="30"
@blur="v$.aportador_solidario.$touch"
:error="v$.aportador_solidario.$error"
:error-message="tools.errorMsg('aportador_solidario', v$.aportador_solidario)"
maxlength="20"
debounce="1000"
:error-message="tools.errorMsg( 'name', v$.name)"
:label="$t('reg.name')">
:label="$t('reg.aportador_solidario')">
<template v-slot:prepend>
<q-icon name="person"/>
</template>
</q-input>
<!--<q-input
v-model="signup.email"
rounded outlined
@blur="v$.email.$touch"
@update:model-value="changeemail()"
:error="v$.email.$invalid"
:error-message="tools.errorMsg( 'email', v$.email)"
maxlength="50"
debounce="2000"
:label="$t('reg.email')">
<template v-slot:prepend>
<q-icon name="email"/>
</template>
</q-input> -->
<q-input
v-model="signup.username"
:readonly="tools.getAskToVerifyReg()"
rounded outlined
@blur="v$.username.$touch"
@update:model-value="changeusername"
:error="v$.username.$error"
@keydown.space="(event) => event.preventDefault()"
maxlength="20"
debounce="1000"
:error-message="tools.errorMsg( 'username', v$.username) || (isalreadyReg ? 'L\'Username è gia stato registrato!' : '')"
:label="$t('reg.username_reg')">
<template v-slot:prepend>
<q-icon name="person"/>
@@ -160,145 +137,180 @@
</q-input>
<q-input
v-model="signup.surname"
v-model="signup.email"
rounded outlined
:error="v$.surname.$error"
@blur="v$.surname.$touch"
maxlength="30"
debounce="1000"
:error-message="tools.errorMsg( 'surname', v$.surname)"
:label="$t('reg.surname')">
@update:model-value="changeemail()"
maxlength="50"
debounce="3000"
:rules="[ myRuleEmail ]"
lazy-rules
:label="$t('reg.email_reg')">
<template v-slot:prepend>
<q-icon name="person"/>
<q-icon name="email"/>
</template>
</q-input>
</div>
<div v-if="show_namesurname">
<q-input
v-model="signup.name"
rounded outlined
@blur="v$.name.$touch"
:error="v$.name.$error"
maxlength="30"
debounce="1000"
:error-message="tools.errorMsg( 'name', v$.name)"
:label="$t('reg.name')">
<q-input
v-model="signup.password"
type="password"
rounded outlined
@blur="v$.password.$touch"
:error="v$.password.$error"
:error-message="`${tools.errorMsg( 'password', v$.password)}`"
maxlength="30"
debounce="1000"
:label="$t('reg.password_reg')">
<template v-slot:prepend>
<q-icon name="person"/>
</template>
<template v-slot:prepend>
<q-icon name="vpn_key"/>
</template>
</q-input>
</q-input>
<q-input
v-model="signup.surname"
rounded outlined
:error="v$.surname.$error"
@blur="v$.surname.$touch"
maxlength="30"
debounce="1000"
:error-message="tools.errorMsg( 'surname', v$.surname)"
:label="$t('reg.surname')">
<q-input
v-model="signup.repeatPassword"
type="password"
maxlength="30"
rounded outlined
@blur="v$.repeatPassword.$touch"
:error="v$.repeatPassword.$error"
:error-message="`${tools.errorMsg( 'repeatpassword', v$.repeatPassword)}`"
<template v-slot:prepend>
<q-icon name="person"/>
</template>
:label="$t('reg.repeatPassword')">
</q-input>
<template v-slot:prepend>
<q-icon name="vpn_key"/>
</template>
</div>
</q-input>
<q-input
v-model="signup.password"
type="password"
rounded outlined
@blur="v$.password.$touch"
:error="v$.password.$error"
:error-message="`${tools.errorMsg( 'password', v$.password)}`"
maxlength="30"
debounce="1000"
:label="$t('reg.password_reg')">
<q-input
v-if="shownationality"
v-model="countryname"
:readonly="true"
rounded outlined
<template v-slot:prepend>
<q-icon name="vpn_key"/>
</template>
debounce="1000"
:label="$t('reg.nationality')">
</q-input>
<template v-slot:prepend>
<!--<vue-country-code
@onSelect="selectcountry"
:preferredCountries="tools.getprefCountries"
:dropdownOptions="{ disabledDialCode: true }"
>
<q-input
v-model="signup.repeatPassword"
type="password"
maxlength="30"
rounded outlined
@blur="v$.repeatPassword.$touch"
:error="v$.repeatPassword.$error"
:error-message="`${tools.errorMsg( 'repeatpassword', v$.repeatPassword)}`"
</vue-country-code>-->
</template>
:label="$t('reg.repeatPassword')">
</q-input>
<template v-slot:prepend>
<q-icon name="vpn_key"/>
</template>
<!--<vue-tel-input
v-if="showcell"
@country-changed="intcode_change()"
:value="signup.profile.cell"
:placeholder="$t('reg.cell')"
maxlength="20"
:enabledCountryCode="true"
inputClasses="clCell"
wrapperClasses="clCellCode">
</vue-tel-input>-->
</q-input>
<div class="text-center">
<q-btn label="Mostra Privacy" @click="showpolicy = true"></q-btn>
</div>
<q-input
v-if="shownationality"
v-model="countryname"
:readonly="true"
rounded outlined
<q-dialog v-model="showpolicy">
<q-card class="dialog_card">
<q-toolbar class="bg-primary text-white">
<q-toolbar-title>
Privacy Policy
</q-toolbar-title>
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
</q-toolbar>
<q-card-section class="inset-shadow">
<PagePolicy
owneremail="info@riso.app"
SiteName="Riso.app"
ownerDataName="RISO"
managerData="Paolo Arena"
includeData="recapiti (indirizzo email, telefono (facoltativo))"
url="riso.app"
lastdataupdate="12/03/2022"
country="Italia"
debounce="1000"
:label="$t('reg.nationality')">
<template v-slot:prepend>
<!--<vue-country-code
@onSelect="selectcountry"
:preferredCountries="tools.getprefCountries"
:dropdownOptions="{ disabledDialCode: true }"
>
</PagePolicy>
</q-card-section>
</q-card>
</q-dialog>
</vue-country-code>-->
</template>
<q-checkbox
v-model="signup.terms"
color="secondary"
@blur="v$.terms.$touch"
:error="v$.terms.$error"
:error-message="`${tools.errorMsg( 'terms', v$.terms)}`"
:label="$t('reg.terms')">
</q-input>
</q-checkbox>
<!--<vue-tel-input
v-if="showcell"
@country-changed="intcode_change()"
:value="signup.profile.cell"
:placeholder="$t('reg.cell')"
maxlength="20"
:enabledCountryCode="true"
inputClasses="clCell"
wrapperClasses="clCellCode">
</vue-tel-input>-->
<q-checkbox
v-if="showadultcheck"
v-model="iamadult"
color="secondary"
:label="$t('reg.onlyadult')">
</q-checkbox>
<div class="text-center">
<q-btn label="Mostra Privacy" @click="showpolicy = true"></q-btn>
</div>
<q-dialog v-model="showpolicy">
<q-card class="dialog_card">
<q-toolbar class="bg-primary text-white">
<q-toolbar-title>
Privacy Policy
</q-toolbar-title>
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
</q-toolbar>
<q-card-section class="inset-shadow">
<PagePolicy
owneremail="info@riso.app"
SiteName="Riso.app"
ownerDataName="RISO"
managerData="Paolo Arena"
includeData="recapiti (indirizzo email, telefono (facoltativo))"
url="riso.app"
lastdataupdate="12/03/2022"
country="Italia"
>
</PagePolicy>
</q-card-section>
</q-card>
</q-dialog>
<q-checkbox
v-model="signup.terms"
color="secondary"
@blur="v$.terms.$touch"
:error="v$.terms.$error"
:error-message="`${tools.errorMsg( 'terms', v$.terms)}`"
:label="$t('reg.terms')">
</q-checkbox>
<q-checkbox
v-if="showadultcheck"
v-model="iamadult"
color="secondary"
:label="$t('reg.onlyadult')">
</q-checkbox>
<div v-if="showadultcheck">
<br>
</div>
<div class="wrapper">
<q-btn rounded size="lg" color="positive" @click="submitOk" :disabled='!allowSubmit()'
:label="$t('reg.submit')">
</q-btn>
</div>
<br/><br/><br/>
<div v-if="showadultcheck">
<br>
</div>
<div class="wrapper">
<q-btn rounded size="lg" color="positive" @click="submitOk" :disabled='!allowSubmit()'
:label="$t('reg.submit')">
</q-btn>
</div>
<br/><br/><br/>
</div>
</div>

View File

@@ -9,7 +9,7 @@
:prop_colkey="prop_colkey"
:col_title="col_title"
:col_footer="col_footer"
:vertical="-1"
:vertical="costanti.VISUTABLE_LISTA"
:choose_visutype="!visuinpage"
:butt_modif_new="!visuinpage"
nodataLabel="Nessun dato presente"