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

@@ -28,6 +28,7 @@ export const costanti = {
SHOW_USERINFO: 1,
SHOW_GROUPINFO: 5,
SHOW_MOVEMENTS: 8,
SHOW_MYCARD: 10,
MAINCARDS: [
@@ -273,9 +274,16 @@ export const costanti = {
username_chip: 12000,
link: 12500,
listobj: 13000,
label: 14000,
},
TypeMov: {
Nessuno: 0,
Entrata: 1,
Uscita: -1,
},
FieldTypeArr: [
{ label: 'Boolean', value: 1 },
{ label: 'Date', value: 2 },

View File

@@ -54,6 +54,7 @@ function AddCol(params: IColGridTable) {
visibleif: (params.visibleif === undefined) ? 0 : params.visibleif,
visib_field: (params.visib_field === undefined) ? '' : params.visib_field,
visib_value: (params.visib_value === undefined) ? '' : params.visib_value,
visulabel: (params.visulabel === undefined) ? true : params.visulabel,
align: (params.align === undefined) ? 'left' : params.align,
field: (params.field === undefined) ? params.name : params.field,
subfield: (params.subfield === undefined) ? '' : params.subfield,
@@ -517,6 +518,38 @@ export const colSubSkills = [
*/
export const colmyMovement = [
// AddCol({ name: '_id', label_trans: 'reg.id' }),
AddCol({ name: 'transactionDate', label_trans: 'movement.transactionDate', fieldtype: costanti.FieldType.date }),
AddCol({
name: 'userfrom.username',
label_trans: 'reg.username',
field: 'userfrom',
subfield: 'username',
foredit: false,
tipovisu: costanti.TipoVisu.LINK,
fieldtype: costanti.FieldType.username_chip,
link: '/my/userfrom.username',
noshowlabel: true,
}),
AddCol({
name: 'userto.username',
label_trans: 'reg.username',
field: 'userto',
subfield: 'username',
foredit: false,
tipovisu: costanti.TipoVisu.LINK,
fieldtype: costanti.FieldType.username_chip,
link: '/my/userto.username',
noshowlabel: true,
}),
AddCol({ name: 'amount', label_trans: 'movement.amount',
fieldtype: costanti.FieldType.string, required: true, tipovisu: costanti.TipoVisu.TESTO_BORDATO }),
AddCol({ name: 'causal', label_trans: 'movement.causal', tipovisu: costanti.TipoVisu.TESTO_BORDATO }),
]
export const colmyUserPeople = [
// AddCol({ name: '_id', label_trans: 'reg.id' }),
AddCol({ name: 'username', label_trans: 'reg.username_short' }),
@@ -2402,6 +2435,7 @@ export const colTableCircuitComplete = [
AddCol({ name: 'compara_euro', label_trans: 'circuit.compara_euro', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'valuta_per_euro', label_trans: 'circuit.valuta_per_euro', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'fido_scoperto_default', label_trans: 'circuit.fido_scoperto_default', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'qta_max_default', label_trans: 'circuit.qta_max_default', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'data_costituz', label_trans: 'circuit.data_costituz', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'deperimento', label_trans: 'circuit.deperimento', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'freq_deper', label_trans: 'circuit.freq_deper' }),
@@ -2411,7 +2445,13 @@ export const colTableCircuitComplete = [
AddCol({ name: 'mese_deper', label_trans: 'circuit.mese_deper', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'ultimo_deper', label_trans: 'circuit.ultimo_deper', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'durata_deper', label_trans: 'circuit.durata_deper', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'img_logo', label_trans: 'circuit.img_logo' }),
AddCol({
name: 'photos',
label_trans: 'skill.photos',
fieldtype: costanti.FieldType.listimages,
jointable: '',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView,
}),
AddCol({
name: 'admins',
label_trans: 'shared.admins',
@@ -2434,6 +2474,7 @@ export const colTableCircuitComplete = [
sortable: true,
showWhen: 0
}),
AddCol(ModifRec),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
@@ -2441,9 +2482,10 @@ export const colTableCircuitComplete = [
export const colTableCircuit = [
AddCol({ name: 'groupnameId', label_trans: 'circuit.groupnameId', fieldtype: costanti.FieldType.select, jointable: 'mygroups' }), // da togliere poi
AddCol({ name: 'name', label_trans: 'circuit.name',
required: true,
maxlength: 40,
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage }),
AddCol({ name: 'path', label_trans: 'circuit.path' }),
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InView }),
AddCol({ name: 'path', label_trans: 'circuit.path', required: true }),
AddCol({ name: 'subname', label_trans: 'circuit.subname' }),
AddCol({ name: 'longdescr', label_trans: 'circuit.descr', fieldtype: costanti.FieldType.html }),
AddCol({ name: 'systemUserId', label_trans: 'circuit.systemUserId', fieldtype: costanti.FieldType.select, jointable: 'users', }),
@@ -2462,10 +2504,21 @@ export const colTableCircuit = [
sortable: true,
showWhen: 0
}),
AddCol({ name: 'nome_valuta', label_trans: 'circuit.nome_valuta' }),
AddCol({ name: 'nome_valuta', label_trans: 'circuit.nome_valuta', required: true }),
AddCol({ name: 'symbol', label_trans: 'circuit.symbol' }),
AddCol({ name: 'fido_scoperto_default', label_trans: 'circuit.fido_scoperto_default',
fieldtype: costanti.FieldType.number, required: true, visulabel: true }),
AddCol({ name: 'qta_max_default', label_trans: 'circuit.qta_max_default',
fieldtype: costanti.FieldType.number, required: true, visulabel: true }),
AddCol({ name: 'data_costituz', label_trans: 'circuit.data_costituz', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'img_logo', label_trans: 'circuit.img_logo' }),
AddCol({
name: 'photos',
label_trans: 'skill.photos',
fieldtype: costanti.FieldType.listimages,
jointable: '',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView,
}),
AddCol(ModifRec),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
@@ -2475,6 +2528,8 @@ export const colmyUserCircuit = [
AddCol({ name: 'userId', label_trans: 'account.users', fieldtype: costanti.FieldType.select, jointable: 'users', }),
AddCol({ name: 'name', label_trans: 'circuit.name' }),
AddCol({ name: 'deperibile', label_trans: 'account.deperibile', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'fidoConcesso', label_trans: 'account.fidoConcesso', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'qta_maxConcessa', label_trans: 'account.qta_maxConcessa', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'importo_iniziale', label_trans: 'account.importo_iniziale', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'saldo', label_trans: 'account.saldo', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'deleted', label_trans: 'reg.deleted', fieldtype: costanti.FieldType.boolean }),
@@ -3079,6 +3134,13 @@ export const fieldsTable = {
colkey: 'groupname',
collabel: 'groupname',
},
{
value: 'movements',
label: 'Movimenti',
columns: colmyMovement,
colkey: '_id',
collabel: 'transactionDate',
},
{
value: 'shippings',
label: 'Spedizione',

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]