Aggiornamenti Flotta, Nave, Dashboard, Tabelle, Popupmenu
This commit is contained in:
@@ -61,6 +61,7 @@ export default class CMyDashboard extends MixinUsers {
|
||||
public ind_order_ingr: number = -1
|
||||
public myrigaattuale: number = 0
|
||||
public mycolattuale: number = 0
|
||||
public upgrade_graduatorie: boolean = false
|
||||
public dashboard: IDashboard = {
|
||||
myself: DefaultUser,
|
||||
aportador: DefaultUser,
|
||||
@@ -136,6 +137,8 @@ export default class CMyDashboard extends MixinUsers {
|
||||
|
||||
this.loading = true
|
||||
|
||||
this.upgrade_graduatorie = tools.getValDb('UPDATE_GRAD', false, false)
|
||||
|
||||
UserStore.actions.getDashboard({ username: this.myusername })
|
||||
.then((ris) => {
|
||||
this.dashboard = ris
|
||||
@@ -144,7 +147,7 @@ export default class CMyDashboard extends MixinUsers {
|
||||
this.invitante_username = this.dashboard.myself.username
|
||||
|
||||
this.myrigaattuale = this.dashboard.lastnave.riga
|
||||
this.mycolattuale = this.dashboard.lastnave.col
|
||||
this.mycolattuale = this.dashboard.lastnave.col + 8
|
||||
|
||||
this.loading = false
|
||||
})
|
||||
@@ -250,11 +253,13 @@ export default class CMyDashboard extends MixinUsers {
|
||||
}
|
||||
|
||||
public colordono(mianave) {
|
||||
if (mianave.made_gift) {
|
||||
if (mianave.made_gift)
|
||||
return 'green'
|
||||
} else {
|
||||
else if (!!mianave.date_made_gift)
|
||||
return 'blue'
|
||||
else
|
||||
return 'grey'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public getposizioneattuale(mianave, totali) {
|
||||
@@ -273,7 +278,7 @@ export default class CMyDashboard extends MixinUsers {
|
||||
})
|
||||
this.shownuovoviaggio = false
|
||||
}
|
||||
|
||||
|
||||
public addNuovoImbarco() {
|
||||
this.NuovoImbarco(this.dashboard.myself.username, this.invitante_username)
|
||||
}
|
||||
@@ -288,7 +293,15 @@ export default class CMyDashboard extends MixinUsers {
|
||||
|
||||
public getnuminvperc(index, myrec) {
|
||||
|
||||
return myrec.invattivi / 2 * 100
|
||||
let val1 = Math.round((myrec.numinvitatiattiviTot - myrec.numNaviEntrato * 2) - (myrec.indimbarco - 1) * 2)
|
||||
if (val1 < 0)
|
||||
val1 = 0
|
||||
|
||||
let valmax = val1;
|
||||
if (valmax < 2)
|
||||
valmax = 2
|
||||
|
||||
return val1 / valmax * 100
|
||||
}
|
||||
|
||||
public getcolorinvitati(index, myrec) {
|
||||
@@ -355,7 +368,14 @@ export default class CMyDashboard extends MixinUsers {
|
||||
}
|
||||
|
||||
public getvalstrinv(posiz) {
|
||||
return Math.round((posiz.numinvitatiattiviTot - posiz.numNaviEntrato * 2) - (posiz.indimbarco - 1) * 2) + '/' + Math.round((posiz.numinvitatiTot - posiz.numNaviEntrato * 2) - (posiz.indimbarco - 1) * 2)
|
||||
let val1 = Math.round((posiz.numinvitatiattiviTot - posiz.numNaviEntrato * 2) - (posiz.indimbarco - 1) * 2)
|
||||
let val2 = Math.round((posiz.numinvitatiTot - posiz.numNaviEntrato * 2) - (posiz.indimbarco - 1) * 2)
|
||||
if (val1 < 0)
|
||||
val1 = 0
|
||||
if (val2 < 0)
|
||||
val2 = 0
|
||||
|
||||
return val1 + '/' + val2
|
||||
}
|
||||
|
||||
public isprovvisoria(mianave) {
|
||||
@@ -379,6 +399,14 @@ export default class CMyDashboard extends MixinUsers {
|
||||
tools.saveFieldToServer(this, 'navi', mianave._id, mydata)
|
||||
}
|
||||
|
||||
public change_mynote_imbarco(mioimbarco) {
|
||||
|
||||
const mydata = {
|
||||
note: mioimbarco.note
|
||||
}
|
||||
tools.saveFieldToServer(this, 'listaingressos', mioimbarco._id, mydata)
|
||||
}
|
||||
|
||||
public getNaveSognatoreStr(mianave) {
|
||||
const mynavedest = tools.getfirstnaveSognatore(mianave.riga, mianave.col)
|
||||
const ris = mynavedest.riga + '.' + mynavedest.col
|
||||
@@ -440,7 +468,19 @@ export default class CMyDashboard extends MixinUsers {
|
||||
return val - tools.getRiganave(mianave.riga) + 1
|
||||
}
|
||||
|
||||
public getposiz(posiz) {
|
||||
|
||||
if (posiz.posiz === 100000) {
|
||||
return '-----'
|
||||
} else {
|
||||
return posiz.posiz + ' su ' + posiz.totposiz + '°'
|
||||
}
|
||||
}
|
||||
|
||||
public getcolornave(mianave) {
|
||||
if (this.isprovvisoria(mianave)) {
|
||||
return 'grey'
|
||||
}
|
||||
if (mianave.num_tess % 2 !== 0)
|
||||
return 'blue'
|
||||
else
|
||||
|
||||
@@ -159,8 +159,15 @@
|
||||
<q-spinner-gears size="50px" color="primary"/>
|
||||
</div>
|
||||
|
||||
<div v-if="upgrade_graduatorie">
|
||||
<CRequisiti :statebool="false"
|
||||
msgTrue=""
|
||||
msgFalse="Aggiornamento in Corso - Updating in Progress - Reload Page Please">
|
||||
</CRequisiti>
|
||||
|
||||
<div v-if="!!dashboard && dashboard.myself && !loading">
|
||||
</div>
|
||||
|
||||
<div v-if="!!dashboard && dashboard.myself && !loading & !upgrade_graduatorie">
|
||||
<div>
|
||||
<div v-if="!Completato9Req && !HasNave">
|
||||
<CTitleBanner icon="person" :canopen="true" class="q-pa-xs text-center"
|
||||
@@ -183,11 +190,14 @@
|
||||
clcolor="text-white"
|
||||
mystyle="" myclass="myshad" canopen="true">
|
||||
<div class="row justify-between items-center" style="text-align: center;">
|
||||
<div class="col-3 ">
|
||||
<div class="col-2 ">
|
||||
{{ $t('dashboard.posizione') }}
|
||||
</div>
|
||||
<div class="col-1 ">
|
||||
<q-icon color="blue" name="fas fa-ship"></q-icon>
|
||||
</div>
|
||||
<div class="col-2 ">
|
||||
{{ $t('dashboard.data') }}
|
||||
{{ $t('dashboard.data_rich') }}
|
||||
</div>
|
||||
<div class="col-3 ">
|
||||
{{ $t('dashboard.invitante') }}
|
||||
@@ -206,12 +216,13 @@
|
||||
<!--<div class="col-2">
|
||||
<div class="posizione_imbarco">{{ index }}</div>
|
||||
</div>-->
|
||||
<div class="col-3">
|
||||
<div class="posizione_imbarco">{{ mioimbarco.posiz.posiz }}° su {{
|
||||
mioimbarco.posiz.totposiz }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="posizione_imbarco">{{getposiz(mioimbarco.posiz) }}</div>
|
||||
</div>
|
||||
<div class="col-1 text-center">
|
||||
<div class="boldhigh">{{ mioimbarco.navestr }}</div>
|
||||
</div>
|
||||
<div class="col-2 text-center">
|
||||
<div>{{ tools.getstrshortDate(mioimbarco.date_added) }}</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
@@ -247,6 +258,26 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="full-width">
|
||||
<q-item>
|
||||
<q-item-section avatar>
|
||||
<q-icon size="sm" name="fas fa-heart" color="red"></q-icon>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>
|
||||
|
||||
<q-input v-model="mioimbarco.note" :label="$t('reg.my_dream')"
|
||||
rounded outlined
|
||||
debounce="1000"
|
||||
autogrow
|
||||
dense
|
||||
style="font-size:0.75rem;"
|
||||
@input="change_mynote_imbarco(mioimbarco)">
|
||||
</q-input>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -339,7 +370,8 @@
|
||||
icon="fas fa-ship">
|
||||
{{ $t('dashboard.nave_in_partenza') + ' ' + datagiftchat(mianave) }}
|
||||
</q-chip>
|
||||
<q-chip v-if="datagiftchat(mianave) !== datanave(mianave)" class="glossy q-mx-md" color="blue" text-color="white"
|
||||
<q-chip v-if="datagiftchat(mianave) !== datanave(mianave)" class="glossy q-mx-md" color="blue"
|
||||
text-color="white"
|
||||
icon="fas fa-ship">
|
||||
{{ $t('dashboard.nave_in_chiusura') + ' ' + datanave(mianave) }}
|
||||
</q-chip>
|
||||
@@ -417,7 +449,16 @@
|
||||
<div v-if="mianave.made_gift">
|
||||
<q-chip class="glossy"
|
||||
size="md"
|
||||
text-color="green"
|
||||
color="green"
|
||||
text-color="white"
|
||||
icon="fas fa-gift">
|
||||
{{ $t('steps.dono') + ' ' + $t('dashboard.dono_ricevuto_2') }} !
|
||||
</q-chip>
|
||||
</div>
|
||||
<div v-else-if="!!mianave.date_made_gift">
|
||||
<q-chip class=""
|
||||
size="md"
|
||||
text-color="blue"
|
||||
color="white"
|
||||
icon="fas fa-gift">
|
||||
{{ $t('dashboard.ho_effettuato_il_dono') }}
|
||||
@@ -426,7 +467,7 @@
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item v-if="mianave.num_tess % 2 !== 0">
|
||||
<q-item v-if="(mianave.num_tess % 2 !== 0) && !isprovvisoria(mianave)">
|
||||
<q-item-section avatar>
|
||||
<q-icon size="sm" name="fas fa-heart" color="red"></q-icon>
|
||||
</q-item-section>
|
||||
@@ -546,7 +587,8 @@
|
||||
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
|
||||
</q-toolbar>
|
||||
<q-card-section class="inset-shadow" style="padding: 4px !important;">
|
||||
<CMyRequirement :id_listaingr="id_listaingr" :myseluser="seluser" :showregalainv="getIfregalareInvitati(seluser, showregalainv)"
|
||||
<CMyRequirement :id_listaingr="id_listaingr" :myseluser="seluser"
|
||||
:showregalainv="getIfregalareInvitati(seluser, showregalainv)"
|
||||
:mydashboard="dashboard" :mydownline="downline" :notitle="false" @aggiorna="aggiorna"
|
||||
:ind_order_ingr="ind_order_ingr">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user