- Visu Saldo su Home

- SendRisTo
- Movimenti conto Comunitario
- Profilo
This commit is contained in:
Surya Paolo
2023-03-17 19:07:43 +01:00
parent 37c2f08510
commit af04e022eb
35 changed files with 393 additions and 98 deletions

View File

@@ -148,6 +148,10 @@ export default defineComponent({
return { sortBy: 'numMembers', descending: true, page: 1, rowsNumber: 20, rowsPerPage: 20 }
else if (props.table === toolsext.TABUSER)
return userStore.getMypaginationMembers()
else if (shared_consts.TABLES_ORDER_DATE_UPDATED.includes(props.table))
return { sortBy: 'date_created', descending: true, page: 1, rowsNumber: 0, rowsPerPage: 10 } // date_updated
else if (shared_consts.TABLES_ORDER_DESCR.includes(props.table))
return { sortBy: 'desc', descending: false, page: 1, rowsNumber: 0, rowsPerPage: 10 }
return { sortBy: 'date_created', descending: true, page: 1, rowsNumber: 20, rowsPerPage: 20 }
})

View File

@@ -49,7 +49,7 @@
:nodataLabel="noMsgRecord"
:prop_search="true"
:finder="true"
labelElemFind="circuiti trovati"
labelElemFind="trovati"
:choose_visutype="visuType"
:butt_modif_new="true && !noButtAdd"
noresultLabel="Il filtro selezionato non ha trovato nessun risultato"

View File

@@ -364,6 +364,7 @@ export default defineComponent({
const myvertical = ref(props.vertical)
const ordinam = ref('')
const ordinam_desc = ref(false)
const valoriopt = computed(() => (item: any, addall: boolean, addnone: boolean) => {
@@ -429,8 +430,8 @@ export default defineComponent({
watch(() => ordinam.value, (to: any, from: any) => {
if (pagination.value.sortBy !== ordinam.value) {
tools.setCookie('s_ordinam_' + props.prop_mytable, ordinam.value)
pagination.value.sortBy = ordinam.value
refresh()
// pagination.value.sortBy = getObjSort(ordinam.value, ordinam_desc.value)
// refresh()
}
})
@@ -616,25 +617,33 @@ export default defineComponent({
return precorder ? precorder : 1;
}
// emulate ajax call
// SELECT * FROM ... WHERE...LIMIT...
async function fetchFromServer(startRow: any, endRow: any, param_myfilter: any, param_myfilterand: any, sortBy: any, descending: any) {
// console.log('fetchFromServer')
function getObjSort(sortBy: any, descending: any) {
let myobj: any = {}
if (sortBy) {
let arrsort = sortBy.split(',');
let arrdescending = (descending && descending.length > 0) ? descending.split(',') : [];
if (arrsort) {
sortBy = sortBy + ''
descending = descending + ''
let arrsort = (sortBy && sortBy.indexOf(',') > 0) ? sortBy.split(',') : [];
let arrdescending = (descending && descending.lenght > 1 && descending.indexOf(',') > 0) ? descending.split(',') : [];
if (arrsort.length > 0) {
for (let i = 0; i < arrsort.length; i++) {
let field = arrsort[i].trim()
myobj[field] = (tools.isArray(arrdescending) && (arrdescending.length > [i])) ? parseInt(arrdescending[i].trim()) : 1;
myobj[field] = getOrderByField(field, myobj[field])
let risdesc = (tools.isArray(arrdescending) && (arrdescending.length > i)) ? parseInt(arrdescending[i].trim()) : 1;
myobj[field] = getOrderByField(field, risdesc)
}
} else {
myobj[sortBy] = getOrderByField(sortBy, descending ? -1 : 1)
}
}
console.log('myobj', myobj)
return myobj
}
// emulate ajax call
// SELECT * FROM ... WHERE...LIMIT...
async function fetchFromServer(startRow: any, endRow: any, param_myfilter: any, param_myfilterand: any, sortBy: any, descending: any) {
// console.log('fetchFromServer')
let myobj = getObjSort(sortBy, descending)
// console.log('sortBy', sortBy)
const filtersearch: any[] = []
@@ -982,11 +991,12 @@ export default defineComponent({
// don't forfunction to update local pagination object
pagination.value.page = page
pagination.value.rowsPerPage = rowsPerPage
pagination.value.sortBy = sortBy
pagination.value.sortBy = getObjSort(sortBy, descending)
ordinam.value = sortBy
ordinam_desc.value = descending
pagination.value.descending = descending
console.log('pagination', pagination)
// console.log('pagination', pagination)
// ...and turn of loading indicator
loading.value = false
@@ -1001,8 +1011,10 @@ export default defineComponent({
const myfilternow = myfilter.value
const myfilterandnow = myfilterand.value
if (ordinam.value)
if (ordinam.value) {
sortBy = ordinam.value
descending = ordinam_desc.value
}
savefilter()
@@ -1054,8 +1066,9 @@ export default defineComponent({
// don't forfunction to update local pagination object
pagination.value.page = page
pagination.value.rowsPerPage = rowsPerPage
pagination.value.sortBy = sortBy
pagination.value.sortBy = getObjSort(sortBy, descending)
ordinam.value = sortBy
ordinam_desc.value = descending
pagination.value.descending = descending
// console.log('pagination', pagination)
@@ -1436,7 +1449,6 @@ export default defineComponent({
tablesel.value = tools.getCookie('tablesel', tablesel.value)
}
myfilterand.value = props.filterdef
// myfiltercustom.value = props.filtercustom
// console.log('tablesel', tablesel)
@@ -1448,7 +1460,16 @@ export default defineComponent({
tablesel.value = mytable.value
}
ordinam.value = tools.getCookie('s_ordinam_' + tablesel.value, null)
if (!shared_consts.TABLES_ORDER_DATE_UPDATED.includes(tablesel.value) &&
!shared_consts.TABLES_ORDER_DESCR.includes(tablesel.value)) {
console.log('get cookie)')
let v1 = tools.getCookie('s_ordinam_' + tablesel.value, null)
if (v1)
ordinam.value = v1
let v2 = tools.getCookie('s_ordinam_des_' + tablesel.value, null)
if (v2)
ordinam_desc.value = v2
}
// console.log('2) tablesel', tablesel.value)
@@ -2239,6 +2260,7 @@ export default defineComponent({
userStore,
doSort,
ordinam,
ordinam_desc,
}
}
})

View File

@@ -86,7 +86,7 @@
col.extrafield &&
(col.tipovisu !== costanti.TipoVisu.LINK ||
(col.tipovisu === costanti.TipoVisu.LINK &&
userStore.getImgByProfile(row, true, col)))
myvalue))
"
>
<span class="extrafield">{{ $t(col.extrafield) }}</span>
@@ -115,8 +115,7 @@
!col.extrafield ||
(col.extrafield &&
(col.tipovisu !== costanti.TipoVisu.LINK ||
(col.tipovisu === costanti.TipoVisu.LINK &&
userStore.getImgByProfile(row, true, col))))
(col.tipovisu === costanti.TipoVisu.LINK && myvalue)))
"
class="q-ma-xs chip_shadow"
>

View File

@@ -21,6 +21,7 @@ import { useRoute, useRouter } from 'vue-router'
import { useCircuitStore } from '@store/CircuitStore'
const STEP_NAME_SURNAME = 2
const STEP_FOTO = 5
export default defineComponent({
name: 'CMyProfileTutorial',
@@ -103,6 +104,15 @@ export default defineComponent({
userStore.savenoNameSurname(true)
}
}
if (step.value === STEP_FOTO + 1) {
let index = step.value
if (userStore.my.profile.img) {
// foto esistente
userStore.savenoFoto(false)
} else {
userStore.savenoFoto(true)
}
}
})
@@ -224,6 +234,8 @@ export default defineComponent({
if (contact.value)
filtroutente.value = [{ userId: contact.value._id }]
userStore.my.profile.stepTutorial = getFirstStepToFill()
step.value = userStore.my.profile.stepTutorial ? userStore.my.profile.stepTutorial : 1
if (step.value > numstep.value)
step.value = numstep.value
@@ -234,7 +246,6 @@ export default defineComponent({
userStore.my.profile.stepTutorial = 1
}
userStore.my.profile.stepTutorial = getFirstStepToFill()
}

View File

@@ -13,7 +13,6 @@
clcolor="text-white"
myclass="myshad"
:canopen="!completed()"
:header="step < numstep"
>
<q-slide-transition>
<div v-show="step < numstep">
@@ -192,7 +191,7 @@
dense
size="md"
:label="$t('dialog.vai')"
@click="step = getFirstStepToFill()"
@click="step = 1"
>
</q-btn>
</div>

View File

@@ -27,4 +27,7 @@
.text_title{
color: blue;
@media (prefers-color-scheme: dark) {
color: white;
}
}

View File

@@ -28,3 +28,6 @@
.text_title{
color: blue;
}
.text_title_dark{
color: white;
}

View File

@@ -26,7 +26,7 @@
<!--<span class="dateevent" v-if="myrec.dateTimeStart">dal <span class="datainizio">{{tools.getstrVeryShortDate(myrec.dateStart) }}</span> al <span class="datafine">{{ tools.getstrVeryShortDate(myrec.dateEnd) }}</span>
</span>-->
</q-item-label>
<q-item-label v-if="myrec.title" lines="1" class="text_title">
<q-item-label v-if="myrec.title" lines="1" :class="($q.dark.isActive ? `text_title_dark`: `text_title`)">
<span class="text-weight-bold">{{ myrec.title }}</span>
</q-item-label>
<q-item-label lines="3" v-if="myrec.descr">{{ myrec.descr }}<br>

View File

@@ -54,6 +54,7 @@ export default defineComponent({
const color_border = ref('red')
const showingtooltip = ref(false)
const visuTransac = ref(false)
function created() {
// created
@@ -68,6 +69,7 @@ export default defineComponent({
colTableNotifCoins,
tools,
color_border,
visuTransac,
}
},
})

View File

@@ -9,54 +9,106 @@
:label="t('account.saldo')"
:paramTypeAccount="paramTypeAccount"
:myrecparam="account"
>
>
</CCurrencyValue>
<CCurrencyValue
v-else
:symbol="symbol"
:tips="t('account.saldo_tips', {fido: qtarem, symbol})"
:tips="t('account.saldo_tips', { fido: qtarem, symbol })"
:color="color"
v-model="saldo"
:valueextra="account && account.notifspending && account.notifspending.length > 0 ? `* `: ''"
:label="t('account.saldo') + ` (` + t('account.dispon') + `: ` + qtarem + `)`"
:valueextra="
account && account.notifspending && account.notifspending.length > 0
? `* `
: ''
"
:label="
t('account.saldo') + ` (` + t('account.dispon') + `: ` + qtarem + `)`
"
:paramTypeAccount="paramTypeAccount"
:myrecparam="account"
>
>
</CCurrencyValue>
<q-btn
v-if="
!small &&
account &&
account.notifspending &&
account.notifspending.length > 0
"
:label="$t('movement.viewpendingtransaction')"
@click="visuTransac = true"
icon="fas fa-info"
>
</q-btn>
<div v-if="!small && account && account.notifspending && account.notifspending.length > 0" :class="`text-h7 full-width`"
:style="(!$q.screen.lt.sm ? `min-width: 250px; ` : ``) + (color_border ? `border-color: ` + color_border + `!important;`: '')">
<div class="text-center text-h7-dense text-italic text-grey-14">
{{ t('movement.pendingtransaction') }}
</div>
<div v-for="(myrec, index) in account.notifspending" :key="myrec._id">
<q-card class="row justify-evenly items-center">
<span v-for="(mycol, indcol) of colTableNotifCoins" :key="indcol">
<div
class="col"
style="display: flex;"
v-if="(mycol.visible && (tools.checkIfShowField(mycol, tools.TIPOVIS_SHOW_RECORD, false, tools.getValue(myrec, mycol.field, mycol.subfield))))">
<span class="testo" v-if="mycol.name === 'datenotif'">{{ index + 1 }}°</span>
<CMyFieldRec
table="sendnotifs"
:id="myrec._id"
:rec="myrec"
:field="mycol.name"
:canEdit="false"
:canModify="false">
</CMyFieldRec>
<q-dialog v-model="visuTransac">
<q-card class="dialog_card">
<q-toolbar class="bg-primary text-white">
<q-toolbar-title class="text-h7">
{{ $t('movement.pendingtransaction') }}
</q-toolbar-title>
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
</q-toolbar>
<q-card-section class="inset-shadow">
<div
v-if="
!small &&
account &&
account.notifspending &&
account.notifspending.length > 0
"
:class="`text-h7 full-width`"
:style="
(!$q.screen.lt.sm ? `min-width: 250px; ` : ``) +
(color_border
? `border-color: ` + color_border + `!important;`
: '')
"
>
<div class="text-center text-h7-dense text-italic text-grey-14">
{{ t('movement.pendingtransaction') }}
</div>
</span>
</q-card>
</div>
</div>
<div v-for="(myrec, index) in account.notifspending" :key="myrec._id">
<q-card class="row justify-evenly items-center">
<span v-for="(mycol, indcol) of colTableNotifCoins" :key="indcol">
<div
class="col"
style="display: flex"
v-if="
mycol.visible &&
tools.checkIfShowField(
mycol,
tools.TIPOVIS_SHOW_RECORD,
false,
tools.getValue(myrec, mycol.field, mycol.subfield)
)
"
>
<span class="testo" v-if="mycol.name === 'datenotif'"
>{{ index + 1 }}°</span
>
<CMyFieldRec
table="sendnotifs"
:id="myrec._id"
:rec="myrec"
:field="mycol.name"
:canEdit="false"
:canModify="false"
>
</CMyFieldRec>
</div>
</span>
</q-card>
</div>
</div>
</q-card-section>
</q-card>
</q-dialog>
</template>
<script lang="ts" src="./CSaldo.ts">

View File

@@ -1,4 +1,4 @@
import { computed, defineComponent, PropType, ref } from 'vue'
import { computed, defineComponent, PropType, ref, watch } from 'vue'
import { ICalcStat, IOperators } from '../../model'
import { useUserStore } from '../../store/UserStore'
@@ -11,13 +11,14 @@ import { costanti, IMainCard } from '@store/Modules/costanti'
import { CMyUser } from '../CMyUser'
import { CMyGroup } from '../CMyGroup'
import { CUserInfoAccount } from '../CUserInfoAccount'
import { tools } from '@store/Modules/tools'
import { useQuasar } from 'quasar'
export default defineComponent({
name: 'CSendRISTo',
props: {},
components: { CMyUser, CMyGroup },
components: { CMyUser, CMyGroup, CUserInfoAccount },
setup(props) {
const userStore = useUserStore()
@@ -33,6 +34,9 @@ export default defineComponent({
const tipoConto = ref(costanti.AccountType.USER)
const loading = ref(false)
const circuitpath = computed(() => userStore.my.profile.last_circuitpath)
const contact = computed(() => userStore.my)
const arrTypesAccounts = ref(<any>[
{
@@ -84,6 +88,8 @@ export default defineComponent({
tipoConto,
updateUserListRIS,
loading,
contact,
circuitpath,
}
},
})

View File

@@ -1,5 +1,11 @@
<template>
<div class="row text-center justify-evenly items-center">
<CUserInfoAccount
:user="contact"
:circuitpath="circuitpath"
:admin="false"
:onlysaldo="true"
/>
<div class="q-mb-sm">
<q-btn
icon="fas fa-upload"

View File

@@ -23,6 +23,7 @@
:noaut="noaut"
:hidetitleIfEmpty="true"
:labelBtnAddExtra="`Aggiungi ` + title"
:prop_pagination="tools.getPagination()"
:margin_right="30">
</CGridTableRec>

View File

@@ -18,7 +18,7 @@ import { useCircuitStore } from '@store/CircuitStore'
export default defineComponent({
name: 'CUserInfoAccount',
emits: ['setCmd'],
components: {CUserNonVerif, CSaldo, CSendCoins, CCurrencyValue, CCurrencyV2 },
components: { CUserNonVerif, CSaldo, CSendCoins, CCurrencyValue, CCurrencyV2 },
props: {
user: {
type: Object as PropType<IUserFields>,
@@ -29,11 +29,21 @@ export default defineComponent({
required: false,
default: '',
},
circuitpath: {
type: String,
required: false,
default: '',
},
admin: {
type: Boolean,
required: false,
default: false,
},
onlysaldo: {
type: Boolean,
required: false,
default: false,
},
account: {
type: Object as PropType<IAccount>,
required: false,
@@ -48,7 +58,7 @@ export default defineComponent({
const { t } = useI18n()
const $router = useRouter()
const myaccount = ref(<IAccount|undefined>undefined)
const myaccount = ref(<IAccount | undefined>undefined)
const circuitStore = useCircuitStore()
@@ -60,13 +70,28 @@ export default defineComponent({
mounted()
})
watch(() => tools.isUserOk(), (newval, oldval) => {
if (userStore.isUserOk()) {
mounted()
}
})
function mounted() {
circuit.value = circuitStore.getCircuitByName(props.circuitname)
if (props.circuitname)
circuit.value = circuitStore.getCircuitByName(props.circuitname)
else if (props.circuitpath) {
circuit.value = circuitStore.getCircuitByPath(props.circuitpath)
}
if (props.account) {
myaccount.value = props.account
} else {
myaccount.value = props.user.account
if (props.user.account) {
myaccount.value = props.user.account
} else {
if (circuit.value)
myaccount.value = userStore.getAccountByCircuitId(circuit.value._id)
}
}
}

View File

@@ -1,6 +1,6 @@
<template>
<div v-if="myaccount && circuit">
<q-card-section>
<q-card-section v-if="!onlysaldo">
<div class="text-h6">{{ t('groups.infoaccount') }}</div>
</q-card-section>
@@ -16,7 +16,7 @@
>
</CSaldo>
<q-card-section>
<q-card-section v-if="!onlysaldo">
<div v-if="myaccount.date_created" class="container">
<q-icon name="fas fa-lightbulb" class="iconcirc"></q-icon>
{{