PASSAGGIO A VITE !
AGG. 1.1.23
This commit is contained in:
@@ -1,24 +1,26 @@
|
||||
import { computed, defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
||||
import type { PropType } from 'vue';
|
||||
import { computed, defineComponent, onMounted, ref, watch } from 'vue'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useCircuitStore } from '@store/CircuitStore'
|
||||
|
||||
import { ICircuit, IImgGallery, IUserFields, IUserProfile, IFriends, IAccount, IMyCircuit, IMyGroup } from 'model'
|
||||
import type { ICircuit, IMyCircuit, IMyGroup } from 'model';
|
||||
import { IImgGallery, IUserFields, IUserProfile, IFriends, IAccount } from 'model'
|
||||
import { costanti } from '@costanti'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { tools } from '@tools'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { CUserNonVerif } from '@/components/CUserNonVerif'
|
||||
import { CSaldo } from '@/components/CSaldo'
|
||||
import { CTitleBanner } from '@/components/CTitleBanner'
|
||||
import { CUserNonVerif } from '@src/components/CUserNonVerif'
|
||||
import { CSaldo } from '@src/components/CSaldo'
|
||||
import { CTitleBanner } from '@src/components/CTitleBanner'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyCircuit',
|
||||
emits: ['setCmd'],
|
||||
components: {CUserNonVerif, CSaldo, CTitleBanner},
|
||||
components: { CUserNonVerif, CSaldo, CTitleBanner },
|
||||
props: {
|
||||
mycircuit: {
|
||||
type: Object as PropType<ICircuit | null>,
|
||||
@@ -63,7 +65,7 @@ export default defineComponent({
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const circuit = ref(<IMyCircuit | ICircuit | null>null)
|
||||
const account = computed(() => circuit.value ? userStore.getAccountByCircuitId(circuit.value._id) : null )
|
||||
const account = computed(() => circuit.value ? userStore.getAccountByCircuitId(circuit.value._id) : null)
|
||||
|
||||
const qtarem = computed(() => account.value ? circuitStore.getRemainingCoinsToSend(account.value) : 0)
|
||||
const saldo_pend = computed(() => account.value ? account.value.saldo_pend : 0)
|
||||
@@ -80,6 +82,18 @@ export default defineComponent({
|
||||
mounted()
|
||||
})
|
||||
|
||||
function getNameCircuit() {
|
||||
if (circuit.value) {
|
||||
if (tools.existProp(circuit.value, 'name')) {
|
||||
return tools.getProp(circuit.value, 'name')
|
||||
} else if (tools.existProp(circuit.value, 'circuitname')) {
|
||||
return tools.getProp(circuit.value, 'circuitname')
|
||||
}
|
||||
}
|
||||
|
||||
return ''
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
groupnameSel.value = props.prop_groupnameSel
|
||||
if (!props.mycircuit) {
|
||||
@@ -91,9 +105,8 @@ export default defineComponent({
|
||||
circuit.value = props.mycircuit
|
||||
}
|
||||
}
|
||||
if (circuit.value && circuit.value.hasOwnProperty('circuitname')) {
|
||||
// @ts-ignore
|
||||
const rectofind = circuitStore.listcircuits.find((circ: ICircuit) => circ.name === circuit.value.circuitname!)
|
||||
if (circuit.value) {
|
||||
const rectofind = circuitStore.listcircuits.find((circ: ICircuit) => circ.name === getNameCircuit())
|
||||
if (rectofind) {
|
||||
// console.log('rectofind', rectofind)
|
||||
circuit.value = rectofind
|
||||
@@ -118,14 +131,10 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function getRegulation(reg: string) {
|
||||
let strreg = reg + ''
|
||||
const strreg = reg + ''
|
||||
if (!reg) {
|
||||
let name = ''
|
||||
if (circuit.value!.hasOwnProperty('name')) {
|
||||
// @ts-ignore
|
||||
name = circuit.value!.name
|
||||
}
|
||||
const mystringa = t('circuit.regolamento', {nomecircuito: name})
|
||||
let name = getNameCircuit()
|
||||
const mystringa = t('circuit.regolamento', { nomecircuito: name })
|
||||
return mystringa
|
||||
} else {
|
||||
return reg
|
||||
|
||||
Reference in New Issue
Block a user