- pagine admin: Accounts, Movements e Circuits.
- add change min e max range circuiti (per tutti i record).
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.5.63"
|
||||
APP_VERSION="0.5.66"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.5.63"
|
||||
APP_VERSION="0.5.66"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.5.63"
|
||||
APP_VERSION="0.5.66"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.5.63"
|
||||
APP_VERSION="0.5.66"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.5.63"
|
||||
APP_VERSION="0.5.66"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="14"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1242,7 +1242,7 @@ export const shared_consts = {
|
||||
|
||||
CIRCUIT_PARAMS: {
|
||||
SCOPERTO_MIN_GRP: 200,
|
||||
SCOPERTO_MAX_GRP: 500,
|
||||
SCOPERTO_MAX_GRP: 400,
|
||||
},
|
||||
|
||||
FontsInstalled: [
|
||||
|
||||
@@ -81,12 +81,45 @@
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.username_chip">
|
||||
<div class="">
|
||||
<span v-if="col.extrafield && (col.tipovisu !== costanti.TipoVisu.LINK || (col.tipovisu === costanti.TipoVisu.LINK && userStore.getImgByProfile(row, true, col)))">
|
||||
<span
|
||||
v-if="
|
||||
col.extrafield &&
|
||||
(col.tipovisu !== costanti.TipoVisu.LINK ||
|
||||
(col.tipovisu === costanti.TipoVisu.LINK &&
|
||||
userStore.getImgByProfile(row, true, col)))
|
||||
"
|
||||
>
|
||||
<span class="extrafield">{{ $t(col.extrafield) }}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="!col.extrafield || (col.extrafield && (col.tipovisu !== costanti.TipoVisu.LINK || (col.tipovisu === costanti.TipoVisu.LINK && userStore.getImgByProfile(row, true, col))))"
|
||||
class="q-ma-xs chip_shadow">
|
||||
<div v-if="canModify">
|
||||
<q-input
|
||||
:type="
|
||||
col.fieldtype === costanti.FieldType.crypted
|
||||
? 'password'
|
||||
: 'text'
|
||||
"
|
||||
:maxlength="col.maxlength ? col.maxlength : undefined"
|
||||
:minlength="col.minlength ? col.minlength : undefined"
|
||||
v-model="myvalue"
|
||||
@update:model-value="changevalRec"
|
||||
:label="col.visulabel ? $t(col.label_trans) : ''"
|
||||
:autogrow="col.fieldtype !== costanti.FieldType.crypted"
|
||||
@keyup.enter.stop
|
||||
autofocus
|
||||
>
|
||||
</q-input>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
!col.extrafield ||
|
||||
(col.extrafield &&
|
||||
(col.tipovisu !== costanti.TipoVisu.LINK ||
|
||||
(col.tipovisu === costanti.TipoVisu.LINK &&
|
||||
userStore.getImgByProfile(row, true, col))))
|
||||
"
|
||||
class="q-ma-xs chip_shadow"
|
||||
>
|
||||
<div
|
||||
v-if="
|
||||
(col.tipovisu === costanti.TipoVisu.LINK ||
|
||||
@@ -975,6 +1008,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.password">
|
||||
<div v-if="isInModif">
|
||||
<q-input
|
||||
@@ -1323,6 +1357,23 @@
|
||||
>
|
||||
</CMyToggleList>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.username_chip">
|
||||
<q-input
|
||||
:type="
|
||||
col.fieldtype === costanti.FieldType.crypted
|
||||
? 'password'
|
||||
: 'text'
|
||||
"
|
||||
:maxlength="col.maxlength ? col.maxlength : undefined"
|
||||
:minlength="col.minlength ? col.minlength : undefined"
|
||||
v-model="scope.value"
|
||||
:label="col.visulabel ? $t(col.label_trans) : ''"
|
||||
:autogrow="col.fieldtype !== costanti.FieldType.crypted"
|
||||
@keyup.enter.stop
|
||||
autofocus
|
||||
>
|
||||
</q-input>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
col.fieldtype === costanti.FieldType.star5 ||
|
||||
|
||||
@@ -86,8 +86,8 @@ export default defineComponent({
|
||||
//$router.push(link)
|
||||
}
|
||||
|
||||
function getNameToShow(user: IUserFields) {
|
||||
return userStore.getNameToShow(user)
|
||||
function getNameToShow(user: IUserFields, col = null) {
|
||||
return userStore.getNameToShow(user, col)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -69,6 +69,8 @@ export default defineComponent({
|
||||
|
||||
const groupSel = ref(<IMyGroup | null | undefined>null)
|
||||
|
||||
const datasaved = ref(<any>null)
|
||||
|
||||
const circuittoload = ref(<ICircuit | undefined>undefined)
|
||||
const circuitloaded = ref(<ICircuit>{})
|
||||
const circuitdest = ref(<ICircuit | undefined>undefined)
|
||||
@@ -101,6 +103,12 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
watch(() => tipoConto.value, (newval, oldval) => {
|
||||
|
||||
if (tipoConto.value === costanti.AccountType.COLLECTIVE_ACCOUNT) {
|
||||
if (arrGroupsList.value.length >= 1)
|
||||
from_groupname.value = arrGroupsList.value[0]
|
||||
}
|
||||
|
||||
aggiorna()
|
||||
})
|
||||
|
||||
@@ -122,9 +130,18 @@ export default defineComponent({
|
||||
groupSel.value = null
|
||||
from_contocom.value = ''
|
||||
accountloaded.value = null
|
||||
|
||||
if (!circuittoload.value || (circuittoload.value && circuittoload.value.name !== circuitsel.value)) {
|
||||
circuittoload.value = circuitStore.listcircuits.find((rec: ICircuit) => rec.name === circuitsel.value)
|
||||
|
||||
if (circuittoload.value) {
|
||||
await userStore.loadCircuit(circuittoload.value.path, '').then(({ data, status }: { data: any, status: number }) => {
|
||||
datasaved.value = data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (datasaved.value) {
|
||||
try {
|
||||
arrTypesAccounts.value = [
|
||||
{
|
||||
@@ -134,8 +151,8 @@ export default defineComponent({
|
||||
]
|
||||
|
||||
|
||||
if (!!data.circuit) {
|
||||
circuitloaded.value = data.circuit
|
||||
if (!!datasaved.value.circuit) {
|
||||
circuitloaded.value = datasaved.value.circuit
|
||||
|
||||
if (tipoConto.value === costanti.AccountType.USER) {
|
||||
accountloaded.value = userStore.getAccountByCircuitId(circuitloaded.value._id)
|
||||
@@ -155,6 +172,12 @@ export default defineComponent({
|
||||
|
||||
if (groupsListAdmin.value) {
|
||||
for (const group of groupsListAdmin.value) {
|
||||
let aggiungi = true
|
||||
|
||||
if (props.to_group && props.to_group.groupname === group.groupname)
|
||||
aggiungi = false
|
||||
|
||||
if (aggiungi)
|
||||
arrGroupsList.value.push({ label: group.groupname, value: group.groupname });
|
||||
}
|
||||
}
|
||||
@@ -167,7 +190,7 @@ export default defineComponent({
|
||||
})
|
||||
}
|
||||
|
||||
if (tools.iCanSendCoinsSuperUserCircuit(circuitsel.value)) {
|
||||
if (tools.iCanSendCoinsSuperUserCircuit(circuitsel.value) && (!props.to_contocom)) {
|
||||
arrTypesAccounts.value.push({
|
||||
label: t('circuit.contocom'),
|
||||
value: costanti.AccountType.COMMUNITY_ACCOUNT,
|
||||
@@ -211,7 +234,6 @@ export default defineComponent({
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
</q-toolbar>
|
||||
<q-card-section class="q-pa-xs inset-shadow">
|
||||
<q-select
|
||||
v-if="!circuitname"
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
rounded
|
||||
outlined
|
||||
@@ -23,6 +24,9 @@
|
||||
label="Circuito"
|
||||
>
|
||||
</q-select>
|
||||
<div v-else>
|
||||
Circuito: {{circuitname}}
|
||||
</div>
|
||||
|
||||
<q-banner
|
||||
rounded
|
||||
@@ -220,24 +224,21 @@
|
||||
</q-card-section>
|
||||
<q-card-actions align="center">
|
||||
<q-btn
|
||||
v-if="circuitloaded"
|
||||
:disable="
|
||||
qtyRef
|
||||
? qtyRef.hasError ||
|
||||
v-if="circuitloaded && (qtyRef
|
||||
? !(qtyRef.hasError ||
|
||||
!circuitloaded.transactionsEnabled ||
|
||||
(tipoConto === costanti.AccountType.USER &&
|
||||
to_user &&
|
||||
from_username === to_user.username) ||
|
||||
(tipoConto === costanti.AccountType.COLLECTIVE_ACCOUNT &&
|
||||
!from_groupname) ||
|
||||
(tipoConto === costanti.AccountType.COLLECTIVE_ACCOUNT &&
|
||||
(tipoConto === costanti.AccountType.COLLECTIVE_ACCOUT &&
|
||||
to_group &&
|
||||
from_groupname &&
|
||||
to_group.groupname === from_groupname) ||
|
||||
(tipoConto === costanti.AccountType.COMMUNITY_ACCOUNT &&
|
||||
!from_contocom)
|
||||
: false
|
||||
"
|
||||
!from_contocom))
|
||||
: true)"
|
||||
:label="
|
||||
$t('circuit.sendcoinsto', {
|
||||
qty,
|
||||
|
||||
@@ -61,6 +61,8 @@ const msg_website_it = {
|
||||
SignUp3: 'Reg',
|
||||
SignUp4: 'Reg',
|
||||
SignUp5: 'Reg',
|
||||
SignUp6: 'Registrati',
|
||||
SignUp7: 'Registra',
|
||||
SignUpBot: 'Registrati con Telegram',
|
||||
SignIn: 'Login',
|
||||
status: 'Statistiche',
|
||||
|
||||
@@ -380,6 +380,7 @@ export interface IMetaTags {
|
||||
|
||||
export interface ICircuitState {
|
||||
listcircuits: ICircuit[]
|
||||
listaccounts: IAccount[]
|
||||
}
|
||||
|
||||
export interface ISelector {
|
||||
@@ -1134,7 +1135,10 @@ export interface IMovVisu {
|
||||
}
|
||||
|
||||
export interface IAccount {
|
||||
_id: string
|
||||
username: string
|
||||
contocom: string
|
||||
groupname: string
|
||||
circuitId: string
|
||||
circuit: ICircuit[]
|
||||
name: string
|
||||
|
||||
@@ -16,11 +16,14 @@ export default defineComponent({
|
||||
|
||||
const arrfilterand: any = ref([])
|
||||
|
||||
function mounted() {
|
||||
async function mounted() {
|
||||
if (tools.appid() === tools.IDAPP_RISO) {
|
||||
arrfilterand.value = [
|
||||
]
|
||||
}
|
||||
|
||||
await tools.loadAccounts()
|
||||
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
@@ -122,7 +122,7 @@ function getRoutesAd(site: ISites) {
|
||||
active: true,
|
||||
order: 10,
|
||||
path: '/admin/ris/circuitslist',
|
||||
materialIcon: 'fas fa-users',
|
||||
materialIcon: 'fas fa-coins',
|
||||
name: 'otherpages.admin.circuitslist',
|
||||
component: () => import('@/rootgen/admin/circuitsList/circuitsList.vue'),
|
||||
inmenu: true,
|
||||
@@ -230,7 +230,7 @@ function getRoutesAd(site: ISites) {
|
||||
path: '/admin/ris',
|
||||
order: 60,
|
||||
faIcon: 'fa fa-list-alt',
|
||||
materialIcon: 'fas fa-users',
|
||||
materialIcon: 'fas fa-coins',
|
||||
name: 'otherpages.admin.monete',
|
||||
routes2: routes_ris,
|
||||
inmenu: false,
|
||||
@@ -556,6 +556,17 @@ function getRoutesAd(site: ISites) {
|
||||
infooter: false,
|
||||
separator: false
|
||||
},
|
||||
{
|
||||
active: site.confpages && site.confpages.enableReg && (!site.confpages.enabledRegNeedTelegram || site.confpages.enableRegMultiChoice),
|
||||
order: 1002,
|
||||
path: '/registrati',
|
||||
materialIcon: 'how_to_reg',
|
||||
name: 'pages.SignUp7',
|
||||
component: () => import('@/views/login/signup_noteleg/signup_noteleg.vue'),
|
||||
inmenu: false,
|
||||
infooter: false,
|
||||
separator: false
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 1001,
|
||||
@@ -567,6 +578,17 @@ function getRoutesAd(site: ISites) {
|
||||
infooter: false,
|
||||
separator: false
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 1002,
|
||||
path: '/registrati/:invited',
|
||||
materialIcon: 'how_to_reg',
|
||||
name: 'pages.SignUp6',
|
||||
component: () => import('@/views/login/signup/signup.vue'),
|
||||
inmenu: false,
|
||||
infooter: false,
|
||||
separator: false
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 1001,
|
||||
|
||||
@@ -1268,6 +1268,7 @@ const msg_it = {
|
||||
transaction_suspended: 'Transazioni sospese',
|
||||
choosecontocom: 'Scegli il tuo Conto Collettivo',
|
||||
contocom: 'Conto Comunitario',
|
||||
contocoll: 'Conto Collettivo',
|
||||
user: 'Utente',
|
||||
sender: 'Mittente',
|
||||
dest: 'Destinatario',
|
||||
|
||||
@@ -23,7 +23,8 @@ import globalroutines from '../globalroutines/index'
|
||||
|
||||
export const useCircuitStore = defineStore('CircuitStore', {
|
||||
state: (): ICircuitState => ({
|
||||
listcircuits: []
|
||||
listcircuits: [],
|
||||
listaccounts: [],
|
||||
}),
|
||||
|
||||
getters: {},
|
||||
@@ -72,6 +73,23 @@ export const useCircuitStore = defineStore('CircuitStore', {
|
||||
return this.listcircuits.find((rec: ICircuit) => rec.name === circuitname)
|
||||
},
|
||||
|
||||
getCircuitByCircuitId(circuitId: string): ICircuit | null | undefined {
|
||||
return this.listcircuits.find((rec: ICircuit) => rec._id === circuitId)
|
||||
},
|
||||
|
||||
getNameByCircuitId(circuitId: string): string {
|
||||
const circuit = this.getCircuitByCircuitId(circuitId);
|
||||
return circuit && circuit.name ? circuit.name : ''
|
||||
},
|
||||
|
||||
getCircuitsLabelValue(): any {
|
||||
let arr = []
|
||||
for (const circ of this.listcircuits) {
|
||||
arr.push({label: circ.name, value: circ._id})
|
||||
}
|
||||
return arr
|
||||
},
|
||||
|
||||
getCircuitByPath(circuitpath: string): ICircuit | null {
|
||||
const ris = this.listcircuits.find((rec: ICircuit) => rec.path === circuitpath)
|
||||
return ris ? ris : null
|
||||
@@ -99,6 +117,26 @@ export const useCircuitStore = defineStore('CircuitStore', {
|
||||
return false
|
||||
},
|
||||
|
||||
getAccountByCircuitId(circuitId: string): any {
|
||||
if (this.listaccounts) {
|
||||
return this.listaccounts.find((rec: IAccount) => rec.circuitId === circuitId)
|
||||
}
|
||||
return null
|
||||
},
|
||||
getAccountsListNameValue(): any[] {
|
||||
let arr = []
|
||||
|
||||
if (this.listaccounts) {
|
||||
for (const acc of this.listaccounts) {
|
||||
let chi = acc.username ? acc.username : (acc.groupname ? 'Collettivo: ' + acc.groupname : 'Comunitario: ' + acc.contocom)
|
||||
if (acc.circuitId) {
|
||||
chi = '[' + this.getNameByCircuitId(acc.circuitId) + '] ' + chi
|
||||
}
|
||||
arr.push({label: chi, value: acc._id})
|
||||
}
|
||||
}
|
||||
return arr
|
||||
},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
@@ -18,7 +18,7 @@ export const costanti = {
|
||||
},
|
||||
|
||||
ENABLE_FRIENDS: false,
|
||||
ENABLE_CONTI_COMUNITARI: true,
|
||||
ENABLE_CONTI_COLLETTIVI: true,
|
||||
|
||||
AccountType: {
|
||||
USER: 0,
|
||||
|
||||
@@ -2880,7 +2880,7 @@ export const colTableCircuitComplete = [
|
||||
]
|
||||
|
||||
export const colTableCircuit = [
|
||||
// AddCol({ name: 'groupnameId', label_trans: 'circuit.groupnameId', fieldtype: costanti.FieldType.select, jointable: 'mygroups' }), // da togliere poi
|
||||
AddCol({ name: '_id', label_trans: 'circuit.Id' }), // da togliere poi
|
||||
AddCol({
|
||||
name: 'name', label_trans: 'circuit.name',
|
||||
required: true,
|
||||
@@ -2986,9 +2986,36 @@ export const colTableCircuit = [
|
||||
]
|
||||
|
||||
export const colmyUserCircuit = [
|
||||
AddCol({ name: 'circuitId', label_trans: 'account.circuitId', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'userId', label_trans: 'account.users', fieldtype: costanti.FieldType.select, jointable: 'users' }),
|
||||
AddCol({ name: 'name', label_trans: 'circuit.name' }),
|
||||
AddCol({
|
||||
name: 'circuitId', label_trans: 'account.circuitId',
|
||||
fieldtype: costanti.FieldType.select,
|
||||
jointable: 'listcircuits',
|
||||
}),
|
||||
AddCol({ name: 'username', label_trans: 'account.users', fieldtype: costanti.FieldType.username_chip,
|
||||
tipovisu: costanti.TipoVisu.LINK }),
|
||||
|
||||
AddCol({
|
||||
name: 'contocom',
|
||||
label_trans: 'movement.accountFromComId',
|
||||
foredit: false,
|
||||
tipovisu: costanti.TipoVisu.LINK,
|
||||
fieldtype: costanti.FieldType.username_chip,
|
||||
link: '/circuits/contocom',
|
||||
noshowlabel: true,
|
||||
tipoconto: costanti.AccountType.COMMUNITY_ACCOUNT,
|
||||
}),
|
||||
|
||||
AddCol({
|
||||
name: 'groupname',
|
||||
label_trans: 'circuit.contocoll',
|
||||
foredit: false,
|
||||
tipovisu: costanti.TipoVisu.LINK,
|
||||
fieldtype: costanti.FieldType.username_chip,
|
||||
link: '/circuits/groupname',
|
||||
noshowlabel: true,
|
||||
tipoconto: costanti.AccountType.COLLECTIVE_ACCOUNT,
|
||||
}),
|
||||
|
||||
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 }),
|
||||
@@ -3022,8 +3049,10 @@ export const colTableNotifCoins = [
|
||||
|
||||
export const colTableMovement = [
|
||||
AddCol({ name: 'transactionDate', label_trans: 'movement.transactionDate', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({ name: 'accountFromId', label_trans: 'movement.accountFromId', fieldtype: costanti.FieldType.string, required: true }),
|
||||
AddCol({ name: 'accountToId', label_trans: 'movement.accountToId', fieldtype: costanti.FieldType.string, required: true }),
|
||||
AddCol({ name: 'accountFromId', label_trans: 'movement.accountFromId', fieldtype: costanti.FieldType.select,
|
||||
required: true, jointable: 'listaccounts', }),
|
||||
AddCol({ name: 'accountToId', label_trans: 'movement.accountToId', fieldtype: costanti.FieldType.select,
|
||||
required: true, jointable: 'listaccounts' }),
|
||||
AddCol({ name: 'amount', label_trans: 'movement.amount', fieldtype: costanti.FieldType.number, required: true }),
|
||||
AddCol({ name: 'causal', label_trans: 'movement.causal' }),
|
||||
AddCol({ name: 'causal_table', label_trans: 'movement.causal_table' }),
|
||||
@@ -3423,6 +3452,30 @@ export const fieldsTable = {
|
||||
collabel: 'username',
|
||||
noshow: true,
|
||||
},
|
||||
{
|
||||
value: 'circuits',
|
||||
label: 'Circuiti',
|
||||
columns: colTableCircuit,
|
||||
colkey: '_id',
|
||||
collabel: 'name',
|
||||
noshow: true,
|
||||
},
|
||||
{
|
||||
value: 'listcircuits',
|
||||
label: 'Lista Circuiti',
|
||||
columns: colTableGeneric,
|
||||
colkey: 'value',
|
||||
collabel: 'label',
|
||||
noshow: true,
|
||||
},
|
||||
{
|
||||
value: 'listaccounts',
|
||||
label: 'Lista Account',
|
||||
columns: colTableGeneric,
|
||||
colkey: 'value',
|
||||
collabel: 'label',
|
||||
noshow: true,
|
||||
},
|
||||
{
|
||||
value: 'visibility',
|
||||
label: 'Visibilità Permessi',
|
||||
@@ -3710,13 +3763,6 @@ export const fieldsTable = {
|
||||
colkey: 'value',
|
||||
collabel: 'label',
|
||||
},
|
||||
{
|
||||
value: 'circuits',
|
||||
label: 'Circuiti',
|
||||
columns: colTableCircuit,
|
||||
colkey: '_id',
|
||||
collabel: 'name',
|
||||
},
|
||||
{
|
||||
value: toolsext.TABTYPEHOSP,
|
||||
label: 'Tipo Ospitalità',
|
||||
|
||||
@@ -7173,6 +7173,23 @@ export const tools = {
|
||||
return []
|
||||
},
|
||||
|
||||
async loadAccounts() {
|
||||
const userStore = useUserStore()
|
||||
const circuitStore = useCircuitStore()
|
||||
// Carica il profilo di quest'utente
|
||||
|
||||
await userStore.loadAllAccounts().then((ris) => {
|
||||
// console.log('ris', ris)
|
||||
if (ris) {
|
||||
|
||||
circuitStore.listaccounts = ris.listaccounts ? ris.listaccounts : []
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
return false
|
||||
},
|
||||
|
||||
async loadrecProfile() {
|
||||
|
||||
const userStore = useUserStore()
|
||||
@@ -7560,6 +7577,7 @@ export const tools = {
|
||||
return myemail.search(/hotmail/i) !== -1
|
||||
|| myemail.search(/outlook/i) !== -1
|
||||
|| myemail.search(/live.it/i) !== -1
|
||||
|| myemail.search(/live.com/i) !== -1
|
||||
|| myemail.search(/microsoft/i) !== -1
|
||||
},
|
||||
// || myemail.search(/yahoo/i) !== -1
|
||||
|
||||
@@ -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) {
|
||||
if (myrec.hasOwnProperty('descr'))
|
||||
return myrec.descr
|
||||
else if (myrec.hasOwnProperty('groupname'))
|
||||
return myrec.groupname
|
||||
} else if (tipoconto === costanti.AccountType.COMMUNITY_ACCOUNT) {
|
||||
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) => {
|
||||
|
||||
@@ -254,6 +254,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
let ris: any = []
|
||||
|
||||
const calendarStore = useCalendarStore()
|
||||
const circuitStore = useCircuitStore()
|
||||
const userStore = useUserStore()
|
||||
const messageStore = useMessageStore()
|
||||
const notifStore = useNotifStore()
|
||||
@@ -285,6 +286,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
else if (table === 'departments') ris = state.departments
|
||||
else if (table === 'sharewithus') ris = state.sharewithus
|
||||
else if (table === 'paymenttypes') ris = state.paymenttypes
|
||||
else if (table === 'circuits') ris = circuitStore.listcircuits
|
||||
else if (table === 'listcircuits') ris = circuitStore.getCircuitsLabelValue()
|
||||
else if (table === 'listaccounts') ris = circuitStore.getAccountsListNameValue()
|
||||
else if (table === 'bookings')
|
||||
return calendarStore.bookedevent
|
||||
else if (table === 'users')
|
||||
@@ -491,6 +495,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
infooter: true,
|
||||
}
|
||||
|
||||
// console.log('Sito Online? ', toolsext.sito_online(false))
|
||||
|
||||
if (!toolsext.sito_online(false)) {
|
||||
static_data.routes = [sito_offline, last]
|
||||
} else {
|
||||
@@ -519,8 +525,26 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
if (!$router.hasRoute(route.name)) {
|
||||
$router.addRoute(route)
|
||||
}
|
||||
|
||||
if (route.routes2) {
|
||||
for (const route2 of route.routes2) {
|
||||
if (!$router.hasRoute(route2.name)) {
|
||||
$router.addRoute(route2)
|
||||
}
|
||||
|
||||
if (route2.routes2) {
|
||||
for (const route3 of route2.routes2) {
|
||||
if (!$router.hasRoute(route3.name)) {
|
||||
$router.addRoute(route3)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
if (!tools.sito_online(false)) {
|
||||
$router.replace('/sito_offline')
|
||||
}
|
||||
@@ -1458,6 +1482,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
calendarStore.contribtype = (res.data.contribtype) ? res.data.contribtype : []
|
||||
|
||||
circuitStore.listcircuits = (res.data.listcircuits) ? res.data.listcircuits : []
|
||||
circuitStore.listaccounts = (res.data.listaccounts) ? res.data.listaccounts : []
|
||||
|
||||
this.settings = (res.data.settings) ? [...res.data.settings] : []
|
||||
this.disciplines = (res.data.disciplines) ? [...res.data.disciplines] : []
|
||||
@@ -1483,7 +1508,6 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
this.mygroups = (res.data.mygroups) ? [...res.data.mygroups] : []
|
||||
this.adtypes = (res.data.adtypes) ? [...res.data.adtypes] : []
|
||||
this.adtypegoods = (res.data.adtypegoods) ? [...res.data.adtypegoods] : []
|
||||
circuitStore.listcircuits = (res.data.listcircuits) ? [...res.data.listcircuits] : []
|
||||
|
||||
// console.log('res.data.cart', res.data.cart)
|
||||
|
||||
@@ -1750,7 +1774,13 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
if (costanti.TABLES_ARRAY.includes(table)) {
|
||||
const newarr = []
|
||||
for (const value of myarr) {
|
||||
newarr.push({ value, label: value })
|
||||
let label = value
|
||||
if (table === 'mygroups')
|
||||
label = value.descr
|
||||
else if (table === 'circuits')
|
||||
label = value.name
|
||||
|
||||
newarr.push({ value, label })
|
||||
}
|
||||
|
||||
myarr = newarr
|
||||
|
||||
@@ -9,6 +9,7 @@ import { useUserStore } from '@store/UserStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { costanti } from '@costanti'
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Dbop',
|
||||
@@ -24,11 +25,17 @@ export default defineComponent({
|
||||
const date_start = ref(new Date())
|
||||
const col = ref(0)
|
||||
const placca = ref('')
|
||||
const valmin = ref(200)
|
||||
const valmax = ref(400)
|
||||
const defmin = ref(shared_consts.CIRCUIT_PARAMS.SCOPERTO_MIN_GRP)
|
||||
const defmax = ref(shared_consts.CIRCUIT_PARAMS.SCOPERTO_MAX_GRP)
|
||||
const defpersmin = ref(100)
|
||||
const defpersmax = ref(200)
|
||||
const search_username = ref('')
|
||||
const replace_username = ref('')
|
||||
const incaricamento = ref(false)
|
||||
|
||||
function EseguiFunz(miafunz: string, search_username?: string, replace_username?: string) {
|
||||
function EseguiFunz(miafunz: string, search_username?: string, replace_username?: string, valmin?: number, valmax?: number) {
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
@@ -51,6 +58,8 @@ export default defineComponent({
|
||||
numpersone: numpersone,
|
||||
search_username,
|
||||
replace_username,
|
||||
valmin: valmin,
|
||||
valmax: valmax,
|
||||
}
|
||||
|
||||
incaricamento.value = true
|
||||
@@ -82,7 +91,13 @@ export default defineComponent({
|
||||
tools,
|
||||
costanti,
|
||||
search_username,
|
||||
replace_username
|
||||
replace_username,
|
||||
valmin,
|
||||
valmax,
|
||||
defmin,
|
||||
defmax,
|
||||
defpersmin,
|
||||
defpersmax,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,23 +1,27 @@
|
||||
<template>
|
||||
<div>
|
||||
<CTitleBanner title="Operazioni su DB:"></CTitleBanner>
|
||||
<div class="row justify-center q-gutter-sm q-list--bordered center_img" style="max-width: 600px">
|
||||
<div
|
||||
class="row justify-center q-gutter-sm q-list--bordered center_img"
|
||||
style="max-width: 600px"
|
||||
>
|
||||
<CMyFieldDb
|
||||
title="SITO_ONLINE"
|
||||
mykey="SITO_ONLINE"
|
||||
:serv="false"
|
||||
:type="costanti.FieldType.boolean">
|
||||
:type="costanti.FieldType.boolean"
|
||||
>
|
||||
</CMyFieldDb>
|
||||
<br>
|
||||
<br />
|
||||
|
||||
<CMyFieldDb
|
||||
title="ABILITA CRONTAB (1 ora)"
|
||||
mykey="CRONTAB"
|
||||
:serv="false"
|
||||
:type="costanti.FieldType.boolean">
|
||||
:type="costanti.FieldType.boolean"
|
||||
>
|
||||
</CMyFieldDb>
|
||||
<br>
|
||||
|
||||
<br />
|
||||
|
||||
<!--
|
||||
<div class="row">
|
||||
@@ -203,101 +207,196 @@
|
||||
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="Correggi Tabella Hours con userId" color="negative"
|
||||
@click="EseguiFunz('CorreggiTabHours')"></q-btn>
|
||||
<br>
|
||||
label="Correggi Tabella Hours con userId"
|
||||
color="negative"
|
||||
@click="EseguiFunz('CorreggiTabHours')"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="setVerifiedByAportadorToALL" color="negative"
|
||||
@click="EseguiFunz('setVerifiedByAportadorToALL')"></q-btn>
|
||||
<br>
|
||||
label="setVerifiedByAportadorToALL"
|
||||
color="negative"
|
||||
@click="EseguiFunz('setVerifiedByAportadorToALL')"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="1. Cancella Tabelle (Sectors, SectorGoods, Skills, Goods)" color="negative"
|
||||
@click="EseguiFunz('emptyTabCatServiziBeni')"></q-btn>
|
||||
<br>
|
||||
label="1. Cancella Tabelle (Sectors, SectorGoods, Skills, Goods)"
|
||||
color="negative"
|
||||
@click="EseguiFunz('emptyTabCatServiziBeni')"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="1. Cancella e Ricrea tutte le Tabelle (Sector, Skill, SubSkill, Contribtype, AdType)" color="negative"
|
||||
@click="EseguiFunz('emptyDbSkill')"></q-btn>
|
||||
<br>
|
||||
label="1. Cancella e Ricrea tutte le Tabelle (Sector, Skill, SubSkill, Contribtype, AdType)"
|
||||
color="negative"
|
||||
@click="EseguiFunz('emptyDbSkill')"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="1. Cancella e Ricrea le Tabelle (City, Province)" color="negative"
|
||||
@click="EseguiFunz('ricreaTabCitiesProvinces')"></q-btn>
|
||||
<br>
|
||||
label="1. Cancella e Ricrea le Tabelle (City, Province)"
|
||||
color="negative"
|
||||
@click="EseguiFunz('ricreaTabCitiesProvinces')"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="2. Popola Tutte le Tabelle vuote (o incomplete)" color="negative"
|
||||
@click="EseguiFunz('PopulateTables')"></q-btn>
|
||||
<br>
|
||||
label="2. Popola Tutte le Tabelle vuote (o incomplete)"
|
||||
color="negative"
|
||||
@click="EseguiFunz('PopulateTables')"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="copyFrom1To14" color="negative"
|
||||
@click="EseguiFunz('copyFrom1To14')"></q-btn>
|
||||
<br>
|
||||
label="copyFrom1To14"
|
||||
color="negative"
|
||||
@click="EseguiFunz('copyFrom1To14')"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="Rewrite Cities Table" color="negative"
|
||||
@click="EseguiFunz('RewriteCitiesTable')"></q-btn>
|
||||
<br>
|
||||
label="Rewrite Cities Table"
|
||||
color="negative"
|
||||
@click="EseguiFunz('RewriteCitiesTable')"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="Rewrite Levels Table" color="negative"
|
||||
@click="EseguiFunz('RewriteLevelsTable')"></q-btn>
|
||||
<br>
|
||||
label="Rewrite Levels Table"
|
||||
color="negative"
|
||||
@click="EseguiFunz('RewriteLevelsTable')"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="Rewrite Provinces Table" color="negative"
|
||||
@click="EseguiFunz('RewriteProvincesTable')"></q-btn>
|
||||
<br>
|
||||
label="Rewrite Provinces Table"
|
||||
color="negative"
|
||||
@click="EseguiFunz('RewriteProvincesTable')"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="Rewrite ContribType" color="negative"
|
||||
@click="EseguiFunz('RewriteContribType')"></q-btn>
|
||||
<br>
|
||||
label="Rewrite ContribType"
|
||||
color="negative"
|
||||
@click="EseguiFunz('RewriteContribType')"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-input v-model="search_username" label="Username Search" style="width: 300px;"></q-input>
|
||||
<q-input v-model="replace_username" label="Username Replace" style="width: 300px;"></q-input>
|
||||
<q-input
|
||||
v-model="search_username"
|
||||
label="Username Search"
|
||||
style="width: 300px"
|
||||
></q-input>
|
||||
<q-input
|
||||
v-model="replace_username"
|
||||
label="Username Replace"
|
||||
style="width: 300px"
|
||||
></q-input>
|
||||
|
||||
<q-btn
|
||||
label="Replace Username" color="primary"
|
||||
@click="EseguiFunz('ReplaceUsername', search_username, replace_username)"></q-btn>
|
||||
<br>
|
||||
label="Replace Username"
|
||||
color="primary"
|
||||
@click="
|
||||
EseguiFunz('ReplaceUsername', search_username, replace_username)
|
||||
"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="Create Account Circuits" color="primary"
|
||||
@click="EseguiFunz('CreateAccountCircuits', search_username, replace_username)"></q-btn>
|
||||
<br>
|
||||
label="Create Account Circuits"
|
||||
color="primary"
|
||||
@click="
|
||||
EseguiFunz('CreateAccountCircuits', search_username, replace_username)
|
||||
"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-input
|
||||
v-model="valmin"
|
||||
label="Fiducia Concessa"
|
||||
style="width: 300px"
|
||||
></q-input>
|
||||
<q-input v-model="valmax" label="Max Qta" style="width: 300px"></q-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="Imposta Min e Max per TUTTI i Conti Personali"
|
||||
color="primary"
|
||||
@click="EseguiFunz('ImpostaMinMaxPersonali', '', '', valmin, valmax)"
|
||||
></q-btn>
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="Imposta Min e Max per TUTTI i Conti Comunitari"
|
||||
color="primary"
|
||||
@click="EseguiFunz('ImpostaMinMaxComunitari', '', '', valmin, valmax)"
|
||||
></q-btn>
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="Imposta Min e Max per TUTTI i Conti Collettivi"
|
||||
color="primary"
|
||||
@click="EseguiFunz('ImpostaMinMaxCollettivi', '', '', valmin, valmax)"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-input
|
||||
v-model="defpersmin"
|
||||
label="DEFAULT Fiducia Concessa"
|
||||
style="width: 300px"
|
||||
></q-input>
|
||||
<q-input v-model="defpersmax" label="DEFAULT Max Qta" style="width: 300px"></q-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="Imposta Min e Max per i Circuiti Personali di DEFAULT"
|
||||
color="primary"
|
||||
@click="EseguiFunz('ImpostaDefMinMaxPersonali', '', '', defpersmin, defpersmax)"
|
||||
></q-btn>
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-input
|
||||
v-model="defmin"
|
||||
label="DEFAULT Fiducia Concessa"
|
||||
style="width: 300px"
|
||||
></q-input>
|
||||
<q-input v-model="defmax" label="DEFAULT Max Qta" style="width: 300px"></q-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="Imposta Min e Max per i Circuiti Collettivi di DEFAULT"
|
||||
color="primary"
|
||||
@click="EseguiFunz('ImpostaDefMinMaxCollettivi', '', '', defmin, defmax)"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
|
||||
<q-field
|
||||
stack-label
|
||||
dense
|
||||
>
|
||||
<q-field stack-label dense>
|
||||
<template v-slot:control>
|
||||
<div class="self-center full-width no-outline text-center" tabindex="0">{{ ris }}</div>
|
||||
<div class="self-center full-width no-outline text-center" tabindex="0">
|
||||
{{ ris }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</q-field>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" src="./dbop.ts">
|
||||
|
||||
@@ -221,11 +221,10 @@
|
||||
></q-tab>
|
||||
<q-tab
|
||||
v-if="
|
||||
costanti.ENABLE_CONTI_COMUNITARI &&
|
||||
tools.iAmAdminCircuit(circuit.name)
|
||||
costanti.ENABLE_CONTI_COLLETTIVI
|
||||
"
|
||||
:label="t('circuit.conticollettivi')"
|
||||
name="gruppicom"
|
||||
name="gruppicollettivi"
|
||||
icon="fas fa-users"
|
||||
></q-tab>
|
||||
<q-tab
|
||||
@@ -243,7 +242,7 @@
|
||||
</q-tabs>
|
||||
|
||||
<q-tab-panels v-model="tabcircuit" animated>
|
||||
<q-tab-panel name="gruppicom">
|
||||
<q-tab-panel name="gruppicollettivi">
|
||||
<div class="row justify-center">
|
||||
<q-btn rounded icon="fas fa-user-plus" class="text-center">
|
||||
<q-menu>
|
||||
@@ -260,6 +259,7 @@
|
||||
<q-item-section>
|
||||
<q-btn
|
||||
v-if="
|
||||
userStore.IsMyCircuitByName(circuit.name) &&
|
||||
group.groupname &&
|
||||
!circuitStore.IsAskedCircuitByNameAndGroup(
|
||||
circuit.name,
|
||||
@@ -703,8 +703,7 @@
|
||||
>
|
||||
</CSaldo>
|
||||
</span>
|
||||
<div class=""
|
||||
v-if="tools.iAmAdminCircuit(circuit.name)">
|
||||
<div class="">
|
||||
<q-btn
|
||||
icon="fas fa-coins"
|
||||
color="green"
|
||||
@@ -952,6 +951,7 @@
|
||||
<div v-if="showsendCoinTo">
|
||||
<CSendCoins
|
||||
:showprop="showsendCoinTo"
|
||||
:circuitname="circuit.name"
|
||||
:to_contocom="circuit.path"
|
||||
@close="showsendCoinTo = false"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user