- Fare LISTA MOVIMENTI più comprensibile

- Grafica Circuiti
This commit is contained in:
Surya Paolo
2024-10-02 03:46:40 +02:00
parent 1424060813
commit e29de7e0f6
47 changed files with 937 additions and 291 deletions

View File

@@ -5,22 +5,29 @@ import { useGlobalStore } from '@store/globalStore'
import { useI18n } from '@/boot/i18n'
import { CMyImgUser } from '@/components/CMyImgUser'
import { CSingleMovement } from '@/components/CSingleMovement'
import { CCurrencyValue } from '@/components/CCurrencyValue'
import { tools } from '@store/Modules/tools'
import { IMovQuery, IMovement } from '@src/model'
import { IMovQuery, IMovVisu, IMovement } from '@src/model'
import { shared_consts } from '@src/common/shared_vuejs'
export default defineComponent({
name: 'CMovements',
components: { CMyImgUser, CCurrencyValue },
components: { CMyImgUser, CCurrencyValue, CSingleMovement },
props: {
numcol: {
type: Number,
required: false,
default: 3
},
username: {
type: String,
required: false,
default: ''
},
},
emits: ['loaded'],
setup(props, { emit }) {
const userStore = useUserStore()
@@ -28,16 +35,60 @@ export default defineComponent({
const globalStore = useGlobalStore()
const { t } = useI18n();
const datastat = ref(<any>{})
const numtransaz = ref(0)
const prectransaz = ref(0)
const tab = ref('tutti')
const mylist = computed(() => {
if (globalStore.datastat)
return globalStore.datastat.last_transactions
else
if (globalStore.datastat || userStore.my.profile) {
let arrtransaz: any = []
if (props.username) {
numtransaz.value = userStore.my.profile.last_my_transactions!.length
arrtransaz = userStore.my.profile.last_my_transactions
} else {
if (globalStore.datastat) {
numtransaz.value = globalStore.datastat.last_transactions!.length
arrtransaz = globalStore.datastat.last_transactions
}
}
if (prectransaz.value !== numtransaz.value) {
emit('loaded', { numtransaz: numtransaz.value })
prectransaz.value = numtransaz.value
}
return arrtransaz
} else
return []
})
const getInviati = computed(() => {
if (props.username && mylist.value) {
const list = mylist.value.filter((rec: IMovVisu) => {
return (props.username && (rec.userfrom && (rec.userfrom.username === props.username)))
})
return list
}
})
const getRicevuti = computed(() => {
if (props.username && mylist.value) {
const list = mylist.value.filter((rec: IMovVisu) => {
return (props.username && (rec.userto && (rec.userto.username === props.username)))
})
return list
}
return []
})
async function mounted() {
numtransaz.value = 0
prectransaz.value = 0
emit('loaded', { numtransaz: 0 })
}
@@ -77,13 +128,18 @@ export default defineComponent({
mounted()
})
return {
userStore,
getInviati,
getRicevuti,
tools,
mylist,
getFromToStr,
t,
navigabyMov,
numtransaz,
tab,
}
}
})