versione 0.3.16:

- Aggiunto bottone "Scambio Ospitalità" (nuova tabella)
This commit is contained in:
Paolo Arena
2022-05-06 19:51:33 +02:00
parent 171b99c34d
commit 200ac47035
25 changed files with 322 additions and 68 deletions

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.3.15"
APP_VERSION="0.3.16"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.3.15"
APP_VERSION="0.3.16"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.3.15"
APP_VERSION="0.3.16"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -525,6 +525,17 @@ const baseroutes: IListRoutes[] = [
inmenu: false,
infooter: false,
},
{
active: true,
order: 135,
path: '/myhosps/:idHosp',
materialIcon: '',
name: 'pages.myhosps2',
component: () => import('@/views/user/mypagehosp/mypagehosp.vue'),
meta: { requiresAuth: true },
inmenu: false,
infooter: false,
},
{
active: true,
order: 400,

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.3.15"
APP_VERSION="0.3.16"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="12"
DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.3.15"
APP_VERSION="0.3.16"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.3.15"
APP_VERSION="0.3.16"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,6 +1,6 @@
{
"name": "riso",
"version": "0.3.15",
"version": "0.3.16",
"description": "Riso",
"productName": "Riso",
"author": "Paolo Arena",

View File

@@ -105,7 +105,7 @@ export const shared_consts = {
TABLES_UPDATE_LASTIFIED: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'mybots'],
TABLES_FINDER: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'mygroups'],
TABLES_VISU_CMYSRECCARD: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'mygroups'],
TABLES_SHOW_ADTYPE: ['myskills', 'mygoods', 'myhosps'],
TABLES_SHOW_ADTYPE: ['myskills', 'mygoods'],
TABLES_VISU_LISTA_USER: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'users'],
@@ -209,15 +209,35 @@ export const shared_consts = {
TypeAccom: [
{
value: 1,
label: 'Letto matrimoniale',
label: 'Letti matrimoniali',
},
{
value: 2,
label: 'Letto singolo',
label: 'Letti singoli',
},
{
value: 3,
label: 'Divano-letto',
label: 'Divani-letto',
},
{
value: 4,
label: 'Almaca',
},
{
value: 5,
label: 'sul materasso',
},
{
value: 6,
label: 'sul tappeto',
},
{
value: 7,
label: 'sacco a pelo',
},
{
value: 8,
label: 'Culla',
},
],
@@ -234,6 +254,22 @@ export const shared_consts = {
value: 3,
label: 'Soggiorno',
},
{
value: 4,
label: 'in camper',
},
{
value: 5,
label: 'in tenda',
},
{
value: 6,
label: 'in giardino',
},
{
value: 7,
label: 'all\'aperto',
},
],
@@ -305,6 +341,41 @@ export const shared_consts = {
},
],
Preferences: [
{
value: 1,
label: 'Si accettano bambini',
},
{
value: 2,
label: 'Si accettano cani',
},
{
value: 3,
label: 'Si accettano gatti',
},
{
value: 4,
label: 'E\' consentito fumare in casa',
},
{
value: 5,
label: 'Accessibile con sedia a rotelle',
},
{
value: 6,
label: 'Parcheggio gratuito nella proprietà',
},
{
value: 7,
label: 'Wi-fi disponibile',
},
{
value: 8,
label: 'Sono permessi soggiorni a lungo termine',
},
],
Regions: [
{
value: 'ABR',
@@ -700,6 +771,11 @@ export const shared_consts = {
return (trovatorec) ? trovatorec.label : ''
},
getLabelByValueAndArr(value: number, array: any) {
const trovatorec = array.find((rec: any) => rec.value === value)
return (trovatorec) ? trovatorec.label : ''
},
fieldsUserToChange() {
return ['_id', 'username', 'group', 'email', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'notask_verif', 'verified_by_aportador', 'trust_modified', 'img', 'ipaddr', 'lasttimeonline', 'profile', 'news_on']
},

View File

@@ -27,7 +27,7 @@ $grayshadow: #555;
}
.barwidth{
.barwidth {
width: 250px !important;
}
@@ -56,10 +56,23 @@ $grayshadow: #555;
}
.my-card-gallery-view {
width: 100px;
height: 100px;
padding: 0.25rem 0.25rem;
margin: auto;
}
.accom_type{
font-size: 1rem;
font-weight: bold;
margin-right: 4px;
padding-top: 10px;
}
.accom_location{
font-size: 1rem;
padding-top: 10px;
margin-right: 4px;
font-style: italic;
}

View File

@@ -8,6 +8,8 @@ import { tools } from '@store/Modules/tools'
import { shared_consts } from '@src/common/shared_vuejs'
import { useGlobalStore } from '@store/globalStore'
import { costanti } from '@costanti'
import { CMySelect } from '../CMySelect'
import { CTitleBanner } from '../CTitleBanner'
export default defineComponent({
name: 'CAccomodation',
@@ -27,12 +29,12 @@ export default defineComponent({
},
title: String,
mylist: {
type: Object as PropType<IAccomodation[] | string | undefined | null>,
type: [Array, String, undefined, null] as PropType<IAccomodation[] | string | undefined | null>,
required: true,
},
},
emits: ['showandsave'],
components: { },
components: { CMySelect, CTitleBanner },
setup(props, { emit }) {
const $q = useQuasar()
const { t } = useI18n()
@@ -41,7 +43,7 @@ export default defineComponent({
const displayGall = ref(false)
const listobj = ref(<IImgGallery[]>[])
const listobj = ref(<IAccomodation[]>[])
const maximizedToggle = ref(true)
@@ -66,21 +68,16 @@ export default defineComponent({
})
function created() {
// console.log('created cgallery')
console.log('created CAccomodation', props.mylist)
if (isValid(props.mylist)) {
// @ts-ignore
let myarr: any = props.mylist
listobj.value = []
if (Array.isArray(myarr)) {
myarr.forEach((pic: any) => {
if (pic.imagefile) {
listobj.value.push(pic)
}
})
listobj.value = myarr
}
} else {
listobj.value = [
]
listobj.value = []
}
}
@@ -100,7 +97,7 @@ export default defineComponent({
function getlist() {
if (listobj.value)
// return listobj.value.slice().sort((a: any, b: any) => a.order! - b.order!)
return listobj.value
return listobj.value.filter((rec) => rec.num > 0)
else
return null
}
@@ -144,7 +141,7 @@ export default defineComponent({
}
function save() {
console.log('CGallery save', listobj.value)
console.log('CAccomodation save', listobj.value)
if (listobj.value.length > 0) {
emit('showandsave', listobj.value)
} else {
@@ -156,6 +153,17 @@ export default defineComponent({
return ''
}
function add_newbed() {
const rec: IAccomodation = {
type: 2,
location: 2,
num: 1,
}
listobj.value.push(rec)
save()
}
onMounted(created)
return {
@@ -174,6 +182,7 @@ export default defineComponent({
isListImgValid,
costanti,
shared_consts,
add_newbed,
}
}
})

View File

@@ -1,25 +1,65 @@
<template>
<!--<div class="q-pa-md items-start " style="display: inline-flex; width: 800px;"> -->
1) Accom:
<div v-for="(myaccom, index) in getlist()" :key="index">
myaccom: {{ myaccom}}
<div class="bordo_stondato_blu">
<CTitleBanner class="column" title="Tipi di ospitalità"></CTitleBanner>
<CMySelect
:label="$t('hosps.accomodation.type')" v-model:value="myaccom.type"
optval="value"
optlab="label"
:options="shared_consts.TypeAccom" :useinput="false">
</CMySelect>
<div class="">
<q-btn
v-if="isInModif"
rounded label="Aggiungi Letti" color="positive" @click="add_newbed()">
</q-btn>
<CMySelect
:label="$t('hosps.accomodation.location')" v-model:value="myaccom.location"
optval="value"
optlab="label"
:options="shared_consts.LocationAccom" :useinput="false">
</CMySelect>
<div v-for="(myaccom, index) in getlist()" :key="index">
<div v-if="isInModif" class="row justify-center bordo_stondato_small">
<div>
<CMySelect
v-if="myaccom.num"
:label="$t('hosps.accomodation.num')"
v-model:value="myaccom.num"
optval="value"
optlab="label"
:sola_lettura="!isInModif"
:options="shared_consts.People" :useinput="false"
>
</CMySelect>
</div>
<div>
<CMySelect
v-if="myaccom.type"
:label="$t('hosps.accomodation.type')"
v-model:value="myaccom.type"
optval="value"
optlab="label"
:sola_lettura="!isInModif"
:options="shared_consts.TypeAccom" :useinput="false">
</CMySelect>
</div>
<div>
<CMySelect
v-if="myaccom.location"
:label="$t('hosps.accomodation.location')"
v-model:value="myaccom.location"
optval="value"
optlab="label"
:sola_lettura="!isInModif"
:options="shared_consts.LocationAccom" :useinput="false">
</CMySelect>
<q-btn v-if="isInModif && myaccom.num > 0" flat round color="red" icon="fas fa-trash-alt" @click="deleteRec(myaccom)"></q-btn>
</div>
</div>
<div v-else class="row justify-start q-px-xs q-ma-xs">
<div class="accom_num">{{ myaccom.num }}</div>
<div class="accom_type">
{{ shared_consts.getLabelByValueAndArr(myaccom.type, shared_consts.TypeAccom) }}
</div>
<div>
<div class="accom_location"> ({{shared_consts.getLabelByValueAndArr(myaccom.location, shared_consts.LocationAccom) }})</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script lang="ts" src="./CAccomodation.ts">
@@ -28,3 +68,4 @@
<style lang="scss" scoped>
@import './CAccomodation.scss';
</style>

View File

@@ -504,18 +504,6 @@ export default defineComponent({
]
searchList_Hosp.value = [
{
label: 'Stato',
table: 'statusSkills',
key: 'idStatusSkill',
value: 0,
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'statusSkills', []),
type: costanti.FieldType.multiselect,
filter: null,
useinput: false,
icon: 'mood',
filteradv: false,
},
{
label: 'Regione',
table: 'regions',
@@ -567,7 +555,7 @@ export default defineComponent({
icon: 'flag',
},
{
label: 'Numero Massimo di Ospiti',
label: 'Max. Ospiti',
table: toolsext.TABPEOPLE,
key: 'numMaxPeopleHosp',
type: costanti.FieldType.select,
@@ -576,7 +564,19 @@ export default defineComponent({
arrvalue: [],
filter: null,
useinput: false,
icon: 'flag',
icon: 'fas fa-users',
},
{
label: 'Preferenze',
table: toolsext.TABPREF,
key: 'preferences',
type: costanti.FieldType.multiselect,
value: tools.getCookie(tools.COOK_SEARCH + 'preferences', costanti.FILTER_TUTTI),
addall: false,
arrvalue: [],
filter: null,
useinput: false,
icon: 'fas fa-asterisk',
},
{
label: 'In cambio di',
@@ -1049,6 +1049,7 @@ export default defineComponent({
idCity: 1,
note: 1,
website: 1,
link_maplocation: 1,
descr: 1,
date_created: 1,
date_updated: 1,

View File

@@ -6,6 +6,7 @@ import { CProfile } from '@/components/CProfile'
import { CDateTime } from '@/components/CDateTime'
import { CMyPage } from '@/components/CMyPage'
import { CMyFieldRec } from '@/components/CMyFieldRec'
import { CAccomodation } from '@/components/CAccomodation'
import { tools } from '@store/Modules/tools'
import { useUserStore } from '@store/UserStore'
import { useGlobalStore } from '@store/globalStore'
@@ -19,7 +20,7 @@ import { colCitys, fieldsTable } from '@store/Modules/fieldsTable'
export default defineComponent({
name: 'CMyCardPopup',
components: { CProfile, CTitleBanner, CMyFieldDb, CDateTime, CMyPage, CMyFieldRec },
components: { CProfile, CTitleBanner, CMyFieldDb, CDateTime, CMyPage, CMyFieldRec, CAccomodation },
props: {
table: {
type: String,
@@ -83,6 +84,14 @@ export default defineComponent({
return tools.copyStringToClipboard($q, self.location.host + tools.getPathByTable(props.table, myrec.value._id), true)
}
function showBadge() {
if (shared_consts.TABLES_SHOW_ADTYPE.includes(props.table)) {
return true
}
return false
}
onMounted(mounted)
return {
@@ -100,6 +109,7 @@ export default defineComponent({
toolsext,
col,
condividipag,
showBadge,
}
}
})

View File

@@ -25,7 +25,7 @@
alt="immagine bene"></q-img>
</div>
<div class="text-center">
<div v-if="showBadge()" class="text-center">
<q-chip :icon="fieldsTable.getIconByAdType(myrec.adType)"
:color="fieldsTable.getColByAdType(myrec.adType)"
text-color="white">{{
@@ -50,6 +50,11 @@
{{ tools.getValue(myrec, mycol.field, mycol.subfield) }}
</div>
</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') }}
</div>
</div>
<div v-else-if="mycol.name === 'dateTimeStart'" class="text-center cal">
<div v-if="myrec.dateTimeStart" class="cal__when">
@@ -62,11 +67,18 @@
}}</span> al <span class="datafine">{{ tools.getstrVeryShortDate(myrec.dateTimeEnd) }}</span>
</span>--->
</div>
<div v-else-if="mycol.name === 'accomodation'">
<CAccomodation
v-if="!!myrec.accomodation"
:mylist="myrec.accomodation"
:isInModif="false"
:edit="false"
:canModify="false">
</CAccomodation>
</div>
<div v-else-if="mycol.name === 'dateTimeEnd'">
</div>
<CMyFieldRec
v-else
:table="table"

View File

@@ -369,6 +369,15 @@ export default defineComponent({
list: []
}
}
}else if (col.value.fieldtype === costanti.FieldType.listobj) {
if (myvalue.value === '' || myvalue.value === undefined) {
// console.log('set default myvalue.value ')
myvalue.value = [{
type: 0, // Letto matrimoniale / letto singolo / divano-letto / almaca / a terra sul tappeto (per sacco a pelo)
location: 0, // in camera privata / in camera condivisa / in soggiorno / in camper / in tenda / in giardino / all'aperto
num: 0,
}]
}
}
// console.log('myvalue.value', myvalue.value)
myvalueprec.value = myvalue.value
@@ -457,7 +466,7 @@ export default defineComponent({
function Savedb(newVal: any, valinitial: any) {
console.log('Savedb')
console.log('Savedb', newVal)
if (col.value.fieldtype === costanti.FieldType.boolean) {
// console.log('myvalue', myvalue, newVal, myvalueprec)
@@ -475,6 +484,10 @@ export default defineComponent({
myvalue.value = newVal
}
if (col.value.fieldtype === costanti.FieldType.listobj) {
myvalue.value.accomodation = newVal
}
// console.log('Savedb', newVal)
emit('showandsave', props.row, props.mycol, newVal, valinitial)

View File

@@ -5,7 +5,7 @@
<q-item v-if="myrec" clickable v-ripple class="shadow-2 q-btn--rounded bg-teal-1">
<q-item-section v-if="(shared_consts.TABLES_VISU_IMG.includes(table)) && (myrec.photos.length > 0)" avatar
<q-item-section v-if="(shared_consts.TABLES_VISU_IMG.includes(table)) && (myrec.photos && myrec.photos.length > 0)" avatar
@click="cmdExt(costanti.CMD_SHOW_PAGE, myrec)">
<q-badge v-if="showBadge()" class="q-my-xs self-center" :color="fieldsTable.getColByAdType(myrec.adType)">
{{ fieldsTable.getValByTabAndId(table, 'adType', myrec.adType) }}

View File

@@ -878,7 +878,8 @@ $heightBtn: 100%;
.combowidth {
min-width: 190px;
@media (max-width: 450px) {
min-width: 250px;
min-width: 40px;
white-space: nowrap;
}
}
@@ -972,3 +973,26 @@ $heightBtn: 100%;
.regione{
}
.bordo_stondato_small{
margin: 4px;
border-radius: 1rem;
padding-left: 2px;
padding-right: 2px;
padding-top: 2px;
padding-bottom: 2px;
border: solid 2px #49b502;
}
.accom_num, .accom_maxosp {
font-size: 1.25rem;
background-color: green;
font-weight: bold;
color: white;
margin-right: 10px;
padding: 10px;
}
.accom_maxosp {
background-color: blue !important;
}

View File

@@ -25,6 +25,7 @@ const msg_website_it = {
profile2: 'ProfiloU',
mypage2: 'mypage2',
myservice2: 'myservice2',
myhosps2: 'myhosps2',
mygood2: 'mygood2',
test: 'Test',
projects: 'Progetti',

View File

@@ -420,7 +420,7 @@ const baseroutes: IListRoutes[] = [
active: true,
order: 15,
path: '/hosps',
materialIcon: 'fas fa-house-user',
materialIcon: 'fas fa-bed',
name: 'mypages.hosp',
component: () => import('@/root/hosp/hosp.vue'),
meta: { requiresAuth: true },
@@ -537,6 +537,17 @@ const baseroutes: IListRoutes[] = [
inmenu: false,
infooter: false,
},
{
active: true,
order: 135,
path: '/myhosps/:idHosp',
materialIcon: '',
name: 'pages.myhosps2',
component: () => import('@/views/user/mypagehosp/mypagehosp.vue'),
meta: { requiresAuth: true },
inmenu: false,
infooter: false,
},
{
active: true,
order: 132,

View File

@@ -418,6 +418,7 @@ const msg_it = {
email: 'Email',
email_reg: 'la tua Email',
website: 'Sito Web',
link_maplocation: 'Link posizione su mappa',
intcode_cell: 'Prefisso Int.',
cell: 'Cellulare',
cellreg: 'Cellulare con cui ti eri registrato',
@@ -960,8 +961,11 @@ const msg_it = {
numMaxPeopleHosp: 'Numero Massimo di Ospiti',
accomodation: {
title: 'Tipo di Ospitalità',
type: 'Tipo'
}
location: 'Spazio',
type: 'Tipo',
num: 'Num',
},
preferences: 'Preferenze',
},
},

View File

@@ -60,7 +60,7 @@ export const costanti = {
title: 'Scambio Ospitalità',
strsingolo: 'Scambio Ospitalità',
to: '/hosps',
icon: 'fas fa-taxi',
icon: 'fas fa-bed',
color: 'lime-6',
textcolor: '',
hint: '',

View File

@@ -988,6 +988,18 @@ export const colmyHosp = [
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView,
sortable: false,
}),
AddCol({
name: 'preferences',
label_trans: 'hosps.preferences',
fieldtype: costanti.FieldType.multiselect,
jointable: toolsext.TABPREF,
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
noshowlabel: true,
icon: 'fas fa-asterisk',
//icon: 'fas fa-hands-helping',
isadvanced_field: false,
sortable: false,
}),
AddCol({
name: 'idCity',
@@ -1043,6 +1055,11 @@ export const colmyHosp = [
sortable: false,
}),
//**ADDFIELD_MYBACHECAS
AddCol({
name: 'link_maplocation', label_trans: 'reg.link_maplocation', isadvanced_field: true, fieldtype: costanti.FieldType.link,
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
sortable: false,
}),
AddCol({
name: 'website', label_trans: 'reg.website', isadvanced_field: true, fieldtype: costanti.FieldType.link,
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
@@ -2918,6 +2935,15 @@ export const fieldsTable = {
colicon: 'icon',
noshow: true,
},
{
value: toolsext.TABPREF,
label: 'Preferenze',
columns: colTableGeneric,
colkey: 'value',
collabel: 'label',
colicon: 'icon',
noshow: true,
},
],
}

View File

@@ -88,6 +88,7 @@ export const toolsext = {
TABTYPEHOSP: 'typehosps',
TABTYPEACCOM: 'typeaccoms',
TABLOCACCOM: 'locaccoms',
TABPREF: 'hosps_preferences',
TABPEOPLE: 'people',
SERVKEY_VERS: 'vers',

View File

@@ -1551,6 +1551,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === toolsext.TABPEOPLE) myarr = shared_consts.People
else if (table === toolsext.TABTYPEACCOM) myarr = shared_consts.TypeAccom
else if (table === toolsext.TABLOCACCOM) myarr = shared_consts.LocationAccom
else if (table === toolsext.TABPREF) myarr = shared_consts.Preferences
else myarr = this.getListByTable(table)
if (costanti.TABLES_ARRAY.includes(table)) {