- Statistiche

- Menu e Sottomenu
- Lista ultimi Movimenti
This commit is contained in:
Surya Paolo
2024-09-26 02:14:50 +02:00
parent 4ac0acc2f3
commit 4c9e5ae991
101 changed files with 2215 additions and 9516 deletions

View File

@@ -0,0 +1,89 @@
import { defineComponent, ref, computed, PropType, toRef, onMounted } from 'vue'
import { useUserStore } from '@store/UserStore'
import { useRouter } from 'vue-router'
import { useGlobalStore } from '@store/globalStore'
import { useI18n } from '@/boot/i18n'
import { CMyImgUser } from '@/components/CMyImgUser'
import { CCurrencyValue } from '@/components/CCurrencyValue'
import { tools } from '@store/Modules/tools'
import { IMovQuery, IMovement } from '@src/model'
import { shared_consts } from '@src/common/shared_vuejs'
export default defineComponent({
name: 'CMovements',
components: { CMyImgUser, CCurrencyValue },
props: {
numcol: {
type: Number,
required: false,
default: 3
},
},
setup(props, { emit }) {
const userStore = useUserStore()
const $router = useRouter()
const globalStore = useGlobalStore()
const { t } = useI18n();
const datastat = ref(<any>{})
const mylist = computed(() => {
if (globalStore.datastat)
return globalStore.datastat.last_transactions
else
return []
})
async function mounted() {
}
function getFromToStr(mov: any) {
let mystr = ''
if (mov) {
mystr += mov.str
}
return mystr
}
function navigabyMov(mov: IMovQuery, from: boolean) {
let link = ''
if (from) {
if (mov.tipocontofrom === shared_consts.AccountType.USER) {
link = `/my/` + mov.userfrom.username
} else if (mov.tipocontofrom === shared_consts.AccountType.COLLECTIVE_ACCOUNT) {
link = tools.getPathByGroup(mov.groupfrom)
} else if (mov.tipocontofrom === shared_consts.AccountType.COMMUNITY_ACCOUNT) {
link = '' // mov.contocomfrom.name
}
} else {
if (mov.tipocontoto === shared_consts.AccountType.USER) {
link = `/my/` + mov.userto.username
} else if (mov.tipocontoto === shared_consts.AccountType.COLLECTIVE_ACCOUNT) {
link = tools.getPathByGroup(mov.groupto)
} else if (mov.tipocontoto === shared_consts.AccountType.COMMUNITY_ACCOUNT) {
link = ''
}
}
$router.push(link)
}
onMounted(() => {
mounted()
})
return {
userStore,
tools,
mylist,
getFromToStr,
t,
navigabyMov,
}
}
})