- pagine admin: Accounts, Movements e Circuits.

- add change min e max range circuiti (per tutti i record).
This commit is contained in:
Surya Paolo
2023-02-06 22:58:18 +01:00
parent 0234e2323a
commit 5c2b28939b
24 changed files with 560 additions and 180 deletions

View File

@@ -467,13 +467,27 @@ export const useUserStore = defineStore('UserStore', {
return tools.getCommonAllRecord([...this.my.profile.handshake], [...myuser.profile.handshake], 'username')
},
getAccountByCircuitId(circuitId: string): any {
if (this.my.profile.useraccounts) {
return this.my.profile.useraccounts.find((rec: IAccount) => rec.circuitId === circuitId)
}
return null
},
getAccountsListNameValue(): any[] {
let arr = []
const circuitStore = useCircuitStore()
if (this.my.profile.useraccounts) {
for (const acc of this.my.profile.useraccounts) {
let chi = acc.username ? acc.username : (acc.groupname ? acc.groupname : acc.contocom)
if (acc.circuit) {
chi += ' (' + circuitStore.getNameByCircuitId(acc.circuitId) + ')'
}
arr.push({label: chi, value: acc._id})
}
}
return arr
},
IsRefusedCircuitByName(circuitname: string): boolean {
if (this.my.profile.refused_circuits)
@@ -482,7 +496,6 @@ export const useUserStore = defineStore('UserStore', {
return false
},
getImgByCircuit(circ: ICircuit | null): string {
try {
@@ -500,7 +513,6 @@ export const useUserStore = defineStore('UserStore', {
return this.getImgByCircuit(mycirc)
},
getImgByGroup(group: IMyGroup | null): string {
try {
@@ -607,9 +619,15 @@ export const useUserStore = defineStore('UserStore', {
name = myrec.dest
}
} else if (tipoconto === costanti.AccountType.COLLECTIVE_ACCOUNT) {
return myrec.descr
if (myrec.hasOwnProperty('descr'))
return myrec.descr
else if (myrec.hasOwnProperty('groupname'))
return myrec.groupname
} else if (tipoconto === costanti.AccountType.COMMUNITY_ACCOUNT) {
return myrec.name
if (myrec.hasOwnProperty('name'))
return myrec.name
else if (myrec.hasOwnProperty('contocom'))
return myrec.contocom
}
return name
@@ -1413,6 +1431,16 @@ export const useUserStore = defineStore('UserStore', {
},
async loadAllAccounts() {
return Api.SendReq('/account/loadall', 'POST', null)
.then((res) => {
return res.data
}).catch((error) => {
return {}
})
},
async setFriendsCmd($q: any, t: any, usernameOrig: string, usernameDest: string, cmd: number, value: any) {
return Api.SendReq('/users/friends/cmd', 'POST', { usernameOrig, usernameDest, cmd, value })
.then((res) => {