Circuit go on...

This commit is contained in:
paoloar77
2022-08-30 17:00:32 +02:00
parent a3c904c2ac
commit 1f414e19ea
24 changed files with 360 additions and 183 deletions

View File

@@ -35,7 +35,7 @@ export default defineComponent({
const animation = ref('fade')
const name = computed(() => $route.params.name ? $route.params.name.toString() : '')
const path = computed(() => $route.params.path ? $route.params.path.toString() : '')
const idnotif = computed(() => $route.query.idnotif ? $route.query.idnotif.toString() : '')
const filtroutente = ref(<any[]>[])
@@ -58,6 +58,11 @@ export default defineComponent({
const cities = ref(<ICity[]>[])
watch(() => path.value, (to: any, from: any) => {
loadCircuit()
})
function profile() {
return userStore.my.profile
}
@@ -68,12 +73,11 @@ export default defineComponent({
async function loadCircuit() {
// Carica il profilo di quest'utente
if (name.value) {
await userStore.loadCIrcuit(name.value, idnotif.value).then(({ data, status }: {data: any, status: number}) => {
if (path.value) {
await userStore.loadCIrcuit(path.value, idnotif.value).then(({ data, status }: {data: any, status: number}) => {
console.log('data', data)
if (data) {
circuit.value = data.circuit
cities.value = data.cities
notifStore.setAsRead(idnotif.value)
users_in_circuit.value = data.users_in_circuit
} else {
@@ -90,23 +94,18 @@ export default defineComponent({
}
}
watch(() => name.value, (to: any, from: any) => {
loadCircuit()
})
async function mounted() {
loading.value = true
await loadCircuit()
searchList.value = []
filtercustom.value = [{ 'profile.mycircuits': { $elemMatch: {name: {$eq: name.value }} } } ]
filtercustom.value = [{ 'profile.listUserAccounts': { $elemMatch: {circuitId: {$eq: path.value }} } } ]
arrfilterand.value = []
filtercustom_rich.value = []
//++TODO: sistemare la filtercustom ... richieste...
}
function getImgGrp() {
function getImgCircuit() {
if (circuit.value)
return userStore.getImgByCircuit(circuit.value)
else
@@ -157,7 +156,8 @@ export default defineComponent({
function extraparams_refused() {
return {
querytype: shared_consts.QUERYTYPE_REFUSED_USER_CIRCUIT,
myid: circuit.value ? circuit.value._id : '',
}
}
@@ -181,7 +181,7 @@ export default defineComponent({
costanti,
circuit,
shared_consts,
getImgGrp,
getImgCircuit,
checkifShow,
filtroutente,