Circuits...

Circuits Fido e Max Qta
Fixed error eslint: 7.0.0 is OK
This commit is contained in:
Paolo Arena
2022-09-11 11:45:13 +02:00
parent 0332059c8f
commit d28050e71f
35 changed files with 1862 additions and 1435 deletions

View File

@@ -12,7 +12,7 @@ import {
ITodo,
IUserFields,
Privacy,
TipoVisu, IGroup, IMySkill, IMyBacheca, IImgGallery, IMsgGlobParam, IUserExport, ISpecialField, IAccount, IMyCircuit, ISendCoin,
TipoVisu, IGroup, IMySkill, IMyBacheca, IImgGallery, IMsgGlobParam, IUserExport, ISpecialField, IAccount, IMyCircuit, ISendCoin, IMovement, IMovVisu,
} from '@model'
import { addToDate } from '@quasar/quasar-ui-qcalendar'
@@ -5259,7 +5259,7 @@ export const tools = {
})
},
sendCoinsByCircuit($q: any, circuit: ICircuit, sendcoinrec: ISendCoin) {
sendCoinsByCircuit($q: any, circuit: ICircuit, sendcoinrec: ISendCoin): any {
const userStore = useUserStore()
@@ -5280,13 +5280,12 @@ export const tools = {
title: t('db.domanda')
}).onOk(() => {
userStore.setCircuitCmd($q, t, username, sendcoinrec.circuitname, shared_consts.CIRCUITCMD.SENDCOINS_REQ, true, sendcoinrec)
return userStore.setCircuitCmd($q, t, username, sendcoinrec.circuitname, shared_consts.CIRCUITCMD.SENDCOINS_REQ, true, sendcoinrec)
.then((res: any) => {
if (res) {
tools.showPositiveNotif($q, t('circuit.coins_sendrequest_sent'))
} else {
tools.showNegativeNotif($q, t('db.coins_sendrequest_failed'))
tools.showNegativeNotif($q, t('circuit.coins_sendrequest_failed'))
}
})
})
@@ -5408,7 +5407,7 @@ export const tools = {
const userStore = useUserStore()
$q.dialog({
message: domanda ? domanda : t('db.domanda_removerecord', { circuitname }),
message: domanda ? domanda : t('circuit.domanda_removecircuit', { circuitname }),
ok: { label: t('dialog.yes'), push: true },
cancel: { label: t('dialog.cancel') },
title: t('db.domanda')
@@ -6263,6 +6262,22 @@ export const tools = {
return common
},
isTypeByRecMov(rec: IMovVisu) {
const userStore = useUserStore()
let type = costanti.TypeMov.Nessuno
if (userStore.my.username === rec.userfrom.username) {
type = rec.amount > 0 ? costanti.TypeMov.Uscita : (rec.amount < 0 ? costanti.TypeMov.Entrata : costanti.TypeMov.Nessuno)
} else if (userStore.my.username === rec.userto.username) {
type = rec.amount > 0 ? costanti.TypeMov.Entrata : (rec.amount < 0 ? costanti.TypeMov.Uscita : costanti.TypeMov.Nessuno)
}
return type
},
isEntrataByRecMov(rec: IMovVisu) {
return this.isTypeByRecMov(rec) === costanti.TypeMov.Entrata
},
// getLocale() {
// if (navigator.languages && navigator.languages.length > 0) {
// return navigator.languages[0]