From f79c3b1d7715a670cf3b94ef3eeb01db52e32584 Mon Sep 17 00:00:00 2001 From: Surya Paolo Date: Thu, 2 Feb 2023 02:52:27 +0100 Subject: [PATCH] fix nametoshow --- src/store/UserStore.ts | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/store/UserStore.ts b/src/store/UserStore.ts index e5457ac4..6efc25d6 100755 --- a/src/store/UserStore.ts +++ b/src/store/UserStore.ts @@ -337,7 +337,7 @@ export const useUserStore = defineStore('UserStore', { value = row[col.name] } let tipoconto = costanti.AccountType.USER - if (row.hasOwnProperty(col.tipoconto) && col.tipoconto) { + if (col.hasOwnProperty('tipoconto') && col.tipoconto) { tipoconto = col.tipoconto } let img = '' @@ -366,9 +366,14 @@ export const useUserStore = defineStore('UserStore', { if (!reale) img = 'images/noimg-user.svg' - if (col.tipoconto === costanti.AccountType.COLLECTIVE_ACCOUNT) { + let tipoconto = costanti.AccountType.USER + if (col.hasOwnProperty('tipoconto') && col.tipoconto) { + tipoconto = col.tipoconto + } + + if (tipoconto === costanti.AccountType.COLLECTIVE_ACCOUNT) { img = this.getImgByGroupname(myrec.groupname) - } else if (col.tipoconto === costanti.AccountType.COMMUNITY_ACCOUNT) { + } else if (tipoconto === costanti.AccountType.COMMUNITY_ACCOUNT) { img = this.getImgByCircuitpath(myrec.path) } else { if (myrec.profile && myrec.profile.img) { @@ -568,7 +573,12 @@ export const useUserStore = defineStore('UserStore', { let name = '' let myrec = this.getRecByCol(user, col) - if (col.tipoconto === costanti.AccountType.USER) { + let tipoconto = costanti.AccountType.USER + if (col && col.hasOwnProperty('tipoconto')) { + tipoconto = col.tipoconto + } + + if (tipoconto === costanti.AccountType.USER) { if (!!myrec.name) name = myrec.name + ' ' if (!!myrec.surname) @@ -580,9 +590,9 @@ export const useUserStore = defineStore('UserStore', { if (col && col.field === 'extrarec' && !name) { name = myrec.dest } - } else if (col.tipoconto === costanti.AccountType.COLLECTIVE_ACCOUNT) { + } else if (tipoconto === costanti.AccountType.COLLECTIVE_ACCOUNT) { return myrec.descr - } else if (col.tipoconto === costanti.AccountType.COMMUNITY_ACCOUNT) { + } else if (tipoconto === costanti.AccountType.COMMUNITY_ACCOUNT) { return myrec.name }