- se annuncio cancellato (mostra avviso)
This commit is contained in:
@@ -87,6 +87,7 @@ export default defineComponent({
|
|||||||
const $router = useRouter()
|
const $router = useRouter()
|
||||||
|
|
||||||
const contextDay = ref(<any>null)
|
const contextDay = ref(<any>null)
|
||||||
|
const ismounted = ref(false)
|
||||||
|
|
||||||
const usersList = ref(<any>{ show: false, title: '', list: [], loadfromDb: false, tipofavbook: 0 })
|
const usersList = ref(<any>{ show: false, title: '', list: [], loadfromDb: false, tipofavbook: 0 })
|
||||||
const bookedList = ref(<any>{ show: false, title: '', list: [], loadfromDb: false, tipofavbook: 0 })
|
const bookedList = ref(<any>{ show: false, title: '', list: [], loadfromDb: false, tipofavbook: 0 })
|
||||||
@@ -143,7 +144,7 @@ export default defineComponent({
|
|||||||
state: EState.Creating,
|
state: EState.Creating,
|
||||||
})
|
})
|
||||||
|
|
||||||
const myrec = ref(<any>{})
|
const myrec = ref(<any>null)
|
||||||
const col = ref(<IColGridTable>{})
|
const col = ref(<IColGridTable>{})
|
||||||
|
|
||||||
const idnotif = computed(() => $route.query.idnotif ? $route.query.idnotif.toString() : '')
|
const idnotif = computed(() => $route.query.idnotif ? $route.query.idnotif.toString() : '')
|
||||||
@@ -187,13 +188,14 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function load() {
|
async function load() {
|
||||||
|
console.log('load')
|
||||||
// Carica il record
|
// Carica il record
|
||||||
if (props.idRec) {
|
if (props.idRec) {
|
||||||
await userStore.loadGeneric(props.table, props.idRec, idnotif.value).then((ris) => {
|
await userStore.loadGeneric(props.table, props.idRec, idnotif.value).then((ris) => {
|
||||||
// console.log('myrec', myrec)
|
// console.log('myrec', myrec)
|
||||||
myrec.value = ris
|
myrec.value = ris
|
||||||
notifStore.setAsRead(idnotif.value)
|
if (ris)
|
||||||
|
notifStore.setAsRead(idnotif.value)
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -203,7 +205,8 @@ export default defineComponent({
|
|||||||
await userStore.loadGeneric(props.table, props.prop_myrec._id, idnotif.value).then((ris) => {
|
await userStore.loadGeneric(props.table, props.prop_myrec._id, idnotif.value).then((ris) => {
|
||||||
// console.log('myrec', myrec)
|
// console.log('myrec', myrec)
|
||||||
myrec.value = ris
|
myrec.value = ris
|
||||||
notifStore.setAsRead(idnotif.value)
|
if (ris)
|
||||||
|
notifStore.setAsRead(idnotif.value)
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -212,16 +215,19 @@ export default defineComponent({
|
|||||||
clicca(costanti.TIPOFAVBOOK.SEEN, true, myrec.value._id)
|
clicca(costanti.TIPOFAVBOOK.SEEN, true, myrec.value._id)
|
||||||
|
|
||||||
col.value = fieldsTable.getArrColsByTable(props.table)
|
col.value = fieldsTable.getArrColsByTable(props.table)
|
||||||
|
|
||||||
|
ismounted.value = true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(() => props.idRec, (to: any, from: any) => {
|
watch(() => props.idRec, (to: any, from: any) => {
|
||||||
load()
|
if (ismounted.value)
|
||||||
|
load()
|
||||||
})
|
})
|
||||||
|
|
||||||
async function mounted() {
|
async function mounted() {
|
||||||
load()
|
await load()
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateCard() {
|
function updateCard() {
|
||||||
@@ -708,6 +714,7 @@ export default defineComponent({
|
|||||||
smallHeight,
|
smallHeight,
|
||||||
toggleShowScheda,
|
toggleShowScheda,
|
||||||
showInMap,
|
showInMap,
|
||||||
|
ismounted,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1041,6 +1041,16 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else-if="ismounted && !myrec">
|
||||||
|
<br /><br />
|
||||||
|
<q-banner rounded class="q-ma-md q-pa-md bg-negative text-white">
|
||||||
|
<div class="text-h6 text-center">
|
||||||
|
Pagina non trovata<br />
|
||||||
|
Probabilmente l'annuncio è stato cancellato
|
||||||
|
</div>
|
||||||
|
</q-banner>
|
||||||
|
<br /><br />
|
||||||
|
</div>
|
||||||
|
|
||||||
<q-dialog v-model="usersList.loadfromDb">
|
<q-dialog v-model="usersList.loadfromDb">
|
||||||
<q-card class="dialog_card">
|
<q-card class="dialog_card">
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ export const useNotifStore = defineStore('NotifStore', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async updateNotifDataFromServer({ username, lastdataread }: { username: string, lastdataread: Date }) {
|
async updateNotifDataFromServer({ username, lastdataread }: { username: string, lastdataread: Date }) {
|
||||||
// console.log('updateNotifDataFromServer', username, lastdataread)
|
console.log('updateNotifDataFromServer', username, lastdataread)
|
||||||
|
|
||||||
return Api.SendReq(`/sendnotif/${username}/${lastdataread}/${process.env.APP_ID}`, 'GET', null)
|
return Api.SendReq(`/sendnotif/${username}/${lastdataread}/${process.env.APP_ID}`, 'GET', null)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|||||||
@@ -515,7 +515,7 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
else
|
else
|
||||||
arrout = tools.getCommon([...this.my.profile.mycircuits], [...user.profile.mycircuits], 'circuitname')
|
arrout = tools.getCommon([...this.my.profile.mycircuits], [...user.profile.mycircuits], 'circuitname')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// controlla che il circuito sia Abilitato e Territoriale !
|
// controlla che il circuito sia Abilitato e Territoriale !
|
||||||
for (const circuitname of arrout) {
|
for (const circuitname of arrout) {
|
||||||
@@ -1697,7 +1697,7 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
return res.data
|
return res.data
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.error('err', error)
|
console.error('err', error)
|
||||||
return {}
|
return null
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -1872,11 +1872,11 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
} else {
|
} else {
|
||||||
msg = t('db.recupdated')
|
msg = t('db.recupdated')
|
||||||
tools.showPositiveNotif($q, msg)
|
tools.showPositiveNotif($q, msg)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tools.showPositiveNotif($q, msg)
|
tools.showPositiveNotif($q, msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
tools.showNegativeNotif($q, t('db.recfailed'))
|
tools.showNegativeNotif($q, t('db.recfailed'))
|
||||||
|
|||||||
Reference in New Issue
Block a user