Circuits OK
Accounts Ok Movements OK
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
||||
import { computed, defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { ICircuit, IImgGallery, IUserFields, IUserProfile, IFriends } from 'model'
|
||||
import { useCircuitStore } from '@store/CircuitStore'
|
||||
|
||||
import { ICircuit, IImgGallery, IUserFields, IUserProfile, IFriends, IAccount } from 'model'
|
||||
import { costanti } from '@costanti'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
@@ -8,12 +10,13 @@ import { useQuasar } from 'quasar'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { CUserNonVerif } from '@/components/CUserNonVerif'
|
||||
import { CSaldo } from '@/components/CSaldo'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyCircuit',
|
||||
emits: ['setCmd'],
|
||||
components: {CUserNonVerif},
|
||||
components: {CUserNonVerif, CSaldo},
|
||||
props: {
|
||||
mycircuit: {
|
||||
type: Object as PropType<ICircuit | null>,
|
||||
@@ -34,12 +37,17 @@ export default defineComponent({
|
||||
setup(props, { emit }) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const circuitStore = useCircuitStore()
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const $router = useRouter()
|
||||
const $route = useRoute()
|
||||
|
||||
const circuit = ref(<ICircuit | null>null)
|
||||
const account = computed(() => circuit.value ? userStore.getAccountByCircuitId(circuit.value._id) : null )
|
||||
|
||||
const qtarem = computed(() => account.value ? circuitStore.getRemainingCoinsToSend(account.value) : 0)
|
||||
const saldo = computed(() => account.value ? account.value.saldo : 0)
|
||||
|
||||
const table = ref(toolsext.TABCIRCUITS)
|
||||
|
||||
@@ -88,6 +96,11 @@ export default defineComponent({
|
||||
tools,
|
||||
table,
|
||||
myusername,
|
||||
circuitStore,
|
||||
t,
|
||||
account,
|
||||
qtarem,
|
||||
saldo,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div v-if="tools.isUserOk()">
|
||||
<div v-if="circuit">
|
||||
<q-item class="q-my-sm" clickable>
|
||||
<q-item class="q-my-sm bordo_stondato_circuiti" clickable>
|
||||
<q-item-section avatar @click="naviga(tools.getPathByTableAndRec(table, circuit))">
|
||||
<q-avatar size="60px">
|
||||
<q-img :src="getImgCircuit(circuit)" :alt="circuit.name" img-class="imgprofile" height="60px"/>
|
||||
@@ -9,40 +9,35 @@
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section @click="naviga(tools.getPathByTableAndRec(table, circuit))">
|
||||
<q-item-label><strong>{{ circuit.name }}</strong> ({{ circuit.subname }})
|
||||
<q-item-label><strong>{{ circuit.name }}</strong> <span v-if="circuit.subname"> ({{ circuit.subname }})</span>
|
||||
</q-item-label>
|
||||
<q-item-label v-if="circuit.longdescr" caption lines="3"><em>{{ circuit.longdescr }}</em></q-item-label>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section side v-if="visu === costanti.MY_CIRCUITS">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable icon="fas fa-user-minus" v-close-popup
|
||||
@click="tools.setCmd($q, shared_consts.CIRCUITCMD.REMOVE_FROM_MYLIST, myusername(), '', circuit.NAME)">
|
||||
<q-item-section>{{ $t('circuit.remove_from_mylist') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list v-if="tools.iAmAdminCircuit(circuit.name)" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.CIRCUITCMD.DELETE, myusername(), '', circuit.name)">
|
||||
<q-item-section>{{ $t('circuit.delete') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
<q-item-label lines="1">
|
||||
<CSaldo
|
||||
:symbol="circuit.symbol"
|
||||
:color="circuit.color"
|
||||
:saldo="saldo"
|
||||
:qtarem="qtarem"
|
||||
>
|
||||
</CSaldo>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
|
||||
|
||||
<q-item-section side v-if="visu === costanti.USER_CIRCUITS">
|
||||
<q-item-label>
|
||||
<q-btn rounded :icon="userStore.IsMyCircuitByName(circuit.name) ? `fas fa-ellipsis-h` : `fas fa-user`">
|
||||
<q-menu>
|
||||
<q-list v-if="(!userStore.IsMyCircuitByName(circuit.name) && !userStore.IsAskedCircuitByName(circuit.name) && !userStore.IsRefusedCircuitByName(circuit.name))" style="min-width: 200px">
|
||||
<q-list
|
||||
v-if="(!userStore.IsMyCircuitByName(circuit.name) && !userStore.IsAskedCircuitByName(circuit.name) && !userStore.IsRefusedCircuitByName(circuit.name))"
|
||||
style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.CIRCUITCMD.REQ, myusername(), true, circuitname)">
|
||||
<q-item-section>{{ $t('circuit.ask') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list v-else-if="(!userStore.IsMyCircuitByName(circuit.name) && userStore.IsAskedCircuitByName(circuit.name) && !userStore.IsRefusedCircuitByName(circuit.name))" style="min-width: 200px">
|
||||
<q-list
|
||||
v-else-if="(!userStore.IsMyCircuitByName(circuit.name) && userStore.IsAskedCircuitByName(circuit.name) && !userStore.IsRefusedCircuitByName(circuit.name))"
|
||||
style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.CIRCUITCMD.REQ, myusername(), false, circuit.name)">
|
||||
<q-item-section>{{ $t('shared.refuse_ask') }}</q-item-section>
|
||||
</q-item>
|
||||
@@ -108,5 +103,5 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CMyCircuit.scss';
|
||||
@import './CMyCircuit.scss';
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user