Members, Circuits
This commit is contained in:
@@ -26,9 +26,7 @@ export const useCircuitStore = defineStore('CircuitStore', {
|
||||
listcircuits: []
|
||||
}),
|
||||
|
||||
getters: {
|
||||
|
||||
},
|
||||
getters: {},
|
||||
|
||||
actions: {
|
||||
getRemainingCoinsToSend(account: IAccount) {
|
||||
@@ -52,6 +50,24 @@ export const useCircuitStore = defineStore('CircuitStore', {
|
||||
return 0
|
||||
},
|
||||
|
||||
getCircuitClass(circuit: ICircuit) {
|
||||
if (circuit.status === shared_consts.CIRCUIT_STATUS.FASE3_MONETA_ABILITATA)
|
||||
return 'circuito_abilitato'
|
||||
else if (circuit.status === shared_consts.CIRCUIT_STATUS.FASE2_ORGANIZZAZIONE)
|
||||
return 'circuito_fase_2'
|
||||
else if (circuit.status === shared_consts.CIRCUIT_STATUS.FASE1_CREAZIONE_GRUPPO)
|
||||
return 'circuito_in_creazione'
|
||||
},
|
||||
|
||||
getColorCircuitClass(circuit: ICircuit) {
|
||||
if (circuit.status === shared_consts.CIRCUIT_STATUS.FASE3_MONETA_ABILITATA)
|
||||
return 'green'
|
||||
else if (circuit.status === shared_consts.CIRCUIT_STATUS.FASE2_ORGANIZZAZIONE)
|
||||
return 'orange'
|
||||
else if (circuit.status === shared_consts.CIRCUIT_STATUS.FASE1_CREAZIONE_GRUPPO)
|
||||
return 'red'
|
||||
},
|
||||
|
||||
async loadCircuits() {
|
||||
return Api.SendReq('/users/circuits', 'POST', null)
|
||||
.then((res) => {
|
||||
|
||||
@@ -212,6 +212,7 @@ export const costanti = {
|
||||
CMD_DELETE: 1,
|
||||
CMD_MODIFY: 2,
|
||||
CMD_SHOW_PAGE: 3,
|
||||
CMD_OPEN_PAGE: 4,
|
||||
|
||||
SHOW_ALL: 50,
|
||||
|
||||
|
||||
@@ -2605,6 +2605,12 @@ export const colTableCircuit = [
|
||||
AddCol({ name: 'regulation', label_trans: 'circuit.regulation', fieldtype: costanti.FieldType.html, required: true }),
|
||||
AddCol({ name: 'deperimento', label_trans: 'circuit.deperimento', fieldtype: costanti.FieldType.boolean, disable: true }),
|
||||
AddCol({ name: 'transactionsEnabled', label_trans: 'circuit.transactionsEnabled', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'status', label_trans: 'circuit.status',
|
||||
fieldtype: costanti.FieldType.select,
|
||||
jointable: 'statuscircuit',
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
||||
}
|
||||
),
|
||||
AddCol({ name: 'data_costituz', label_trans: 'circuit.data_costituz', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({
|
||||
name: 'photos',
|
||||
@@ -2649,6 +2655,7 @@ export const colTableNotifCoins = [
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView,
|
||||
}),
|
||||
AddCol({ name: 'extrarec.qty', field: 'extrarec', subfield: 'qty', label_trans: 'movement.amount', fieldtype: costanti.FieldType.currency }),
|
||||
AddCol({ name: 'extrarec.causal', field: 'extrarec', subfield: 'causal', label_trans: 'movement.causal', tipovisu: costanti.TipoVisu.TESTO_BORDATO }),
|
||||
|
||||
]
|
||||
|
||||
@@ -3016,6 +3023,15 @@ export const fieldsTable = {
|
||||
colicon: 'icon',
|
||||
noshow: true,
|
||||
},
|
||||
{
|
||||
value: 'statuscircuit',
|
||||
label: 'Stato Circuito',
|
||||
columns: colTableGeneric,
|
||||
colkey: 'value',
|
||||
collabel: 'label',
|
||||
colicon: 'icon',
|
||||
noshow: true,
|
||||
},
|
||||
{
|
||||
value: 'pub_to_share',
|
||||
label: 'Visibilità',
|
||||
|
||||
@@ -3717,6 +3717,16 @@ export const tools = {
|
||||
return mystr.replace(/\s+/g, '')
|
||||
},
|
||||
|
||||
removespaces_slash(mystr: string) {
|
||||
mystr = mystr.replace(/\s+/g, '')
|
||||
mystr = mystr.replace(/\//g, '')
|
||||
mystr = mystr.replace(/:/g, '')
|
||||
mystr = mystr.replace(/./g, '')
|
||||
mystr = mystr.replace(/,/g, '')
|
||||
mystr = mystr.replace(/'/g, '')
|
||||
return mystr
|
||||
},
|
||||
|
||||
copyStringToClipboard(myq: any, mystr: string, show: boolean) {
|
||||
|
||||
copyToClipboard(mystr).then(() => {
|
||||
@@ -5899,6 +5909,7 @@ export const tools = {
|
||||
color: '#ff5500',
|
||||
deperimento: false,
|
||||
transactionsEnabled: false,
|
||||
status: shared_consts.CIRCUIT_STATUS.FASE1_CREAZIONE_GRUPPO,
|
||||
symbol: 'RIS',
|
||||
fido_scoperto_default: 100,
|
||||
qta_max_default: 200,
|
||||
@@ -5966,13 +5977,16 @@ export const tools = {
|
||||
},
|
||||
|
||||
getFullFileName(arrimage: IImgGallery[], table: string, username: string, groupname: string) {
|
||||
console.log('arrimage', arrimage)
|
||||
|
||||
if (shared_consts.TABLES_DIRECTORY_A_PARTE.includes(table)) {
|
||||
return `upload/${table}/` + groupname + '/' + arrimage[0].imagefile
|
||||
} else if (shared_consts.TABLES_DIRECTORY_SINGLE_IMG.includes(table)) {
|
||||
return `upload/${table}/` + groupname + '/' + arrimage[0].imagefile
|
||||
} else {
|
||||
console.log('username', username, 'table', table)
|
||||
if (arrimage && arrimage.length > 0) {
|
||||
return 'upload/profile/' + username + '/' + table + '/' + arrimage[0].imagefile
|
||||
return `upload/profile/${username}/${table}` + arrimage[0].imagefile
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
|
||||
@@ -1495,11 +1495,13 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
}
|
||||
},
|
||||
|
||||
getValueByTableSingle(table: string, val: any) {
|
||||
getValueByTableSingle(table: string, val: any, lab?: any) {
|
||||
if (table) {
|
||||
const mylist = this.getTableJoinByName(table)
|
||||
const key = fieldsTable.getKeyByTable(table)
|
||||
const collab = fieldsTable.getLabelByTable(table)
|
||||
let collab = lab
|
||||
if (!lab)
|
||||
collab = fieldsTable.getLabelByTable(table)
|
||||
|
||||
// console.table(mylist)
|
||||
let risultato = ''
|
||||
@@ -1622,6 +1624,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
else if (table === 'visibility') myarr = shared_consts.Visibility
|
||||
else if (table === 'pub_to_share') myarr = shared_consts.Pub_to_Share
|
||||
else if (table === 'visibilGroup') myarr = shared_consts.VisibilGroup
|
||||
else if (table === 'statuscircuit') myarr = shared_consts.StatusCircuit
|
||||
else if (table === 'lang') myarr = shared_consts.Lang
|
||||
else if (table === 'regions') myarr = shared_consts.Regions
|
||||
else if (table === 'shippings') myarr = shared_consts.Shippings
|
||||
|
||||
Reference in New Issue
Block a user