ver 0.5.71:
- Info Conto - Admin: poter modificare Fido e QtaMax, sia per i Conti Collettivi sia per gli Utenti.
This commit is contained in:
@@ -7,13 +7,14 @@ import { tools } from '@store/Modules/tools'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { CSendCoins } from '@/components/CSendCoins'
|
||||
import { CSaldo } from '@/components/CSaldo'
|
||||
import { CUserInfoAccount } from '@/components/CUserInfoAccount'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { useCircuitStore } from '@store/CircuitStore'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyUser',
|
||||
components: { CSendCoins, CSaldo },
|
||||
components: { CSendCoins, CSaldo, CUserInfoAccount },
|
||||
emits: ['setCmd'],
|
||||
props: {
|
||||
mycontact: {
|
||||
@@ -71,6 +72,8 @@ export default defineComponent({
|
||||
const $router = useRouter()
|
||||
const $route = useRoute()
|
||||
|
||||
const showAccountInfo = ref(false)
|
||||
|
||||
const username = ref('')
|
||||
const showsendCoinTo = ref(false)
|
||||
|
||||
@@ -128,6 +131,7 @@ export default defineComponent({
|
||||
tools,
|
||||
showsendCoinTo,
|
||||
circuit,
|
||||
showAccountInfo,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -59,7 +59,9 @@
|
||||
<q-btn
|
||||
v-if="
|
||||
userStore.getMyCircuitsInCommonByUser(contact).length > 0 &&
|
||||
((contact.username !== userStore.my.username) || userStore.hoContiCollettiviDaAmministrare() || userStore.hoContiComunitariDaAmministrare())
|
||||
(contact.username !== userStore.my.username ||
|
||||
userStore.hoContiCollettiviDaAmministrare() ||
|
||||
userStore.hoContiComunitariDaAmministrare())
|
||||
"
|
||||
icon="fas fa-coins"
|
||||
color="green"
|
||||
@@ -74,15 +76,15 @@
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px"
|
||||
v-if="
|
||||
!userStore.IsHandShakeByMe(contact.username)
|
||||
">
|
||||
<q-list
|
||||
style="min-width: 150px"
|
||||
v-if="!userStore.IsHandShakeByMe(contact.username)"
|
||||
>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
tools.addToMyHandShake(
|
||||
tools.addToMyHandShake(
|
||||
$q,
|
||||
userStore.my.username,
|
||||
contact.username
|
||||
@@ -260,6 +262,14 @@
|
||||
{{ $t('groups.accept_group') }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="showAccountInfo = true">
|
||||
<q-item-section avatar>
|
||||
<q-icon name="fas fa-info" />
|
||||
</q-item-section>
|
||||
<q-item-section>{{
|
||||
$t('groups.infoaccount')
|
||||
}}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item
|
||||
@@ -397,6 +407,14 @@
|
||||
{{ $t('circuit.accept') }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="showAccountInfo = true">
|
||||
<q-item-section avatar>
|
||||
<q-icon name="fas fa-info" />
|
||||
</q-item-section>
|
||||
<q-item-section>{{
|
||||
$t('groups.infoaccount')
|
||||
}}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item
|
||||
@@ -493,7 +511,7 @@
|
||||
$q,
|
||||
contact.username,
|
||||
circuitname,
|
||||
'',
|
||||
''
|
||||
)
|
||||
"
|
||||
>
|
||||
@@ -594,7 +612,10 @@
|
||||
<q-menu>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item
|
||||
v-if="costanti.ENABLE_FRIENDS && !userStore.IsMyFriendByUsername(contact.username)"
|
||||
v-if="
|
||||
costanti.ENABLE_FRIENDS &&
|
||||
!userStore.IsMyFriendByUsername(contact.username)
|
||||
"
|
||||
clickable
|
||||
icon="fas fa-user-plus"
|
||||
v-close-popup
|
||||
@@ -656,7 +677,10 @@
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.FIND_PEOPLE || visu === costanti.HANDSHAKE">
|
||||
<q-item-section
|
||||
side
|
||||
v-else-if="visu === costanti.FIND_PEOPLE || visu === costanti.HANDSHAKE"
|
||||
>
|
||||
<q-item-label>
|
||||
<q-btn
|
||||
v-if="contact.username !== userStore.my.username"
|
||||
@@ -721,7 +745,10 @@
|
||||
}}</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-else-if="costanti.ENABLE_FRIENDS && userStore.IsMyFriendByUsername(contact.username)"
|
||||
v-else-if="
|
||||
costanti.ENABLE_FRIENDS &&
|
||||
userStore.IsMyFriendByUsername(contact.username)
|
||||
"
|
||||
style="min-width: 200px"
|
||||
clickable
|
||||
v-close-popup
|
||||
@@ -780,16 +807,20 @@
|
||||
"
|
||||
>
|
||||
<q-item-section avatar>
|
||||
<q-icon
|
||||
color="negative"
|
||||
name="fas fa-handshake-slash"
|
||||
/>
|
||||
<q-icon color="negative" name="fas fa-handshake-slash" />
|
||||
</q-item-section>
|
||||
<q-item-section>{{
|
||||
$t('handshake.remove_from_myhandshake')
|
||||
}}</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item clickable v-close-popup @click="showAccountInfo = true">
|
||||
<q-item-section avatar>
|
||||
<q-icon name="fas fa-info" />
|
||||
</q-item-section>
|
||||
<q-item-section>{{
|
||||
$t('groups.infoaccount')
|
||||
}}</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@@ -852,6 +883,21 @@
|
||||
>
|
||||
</CSendCoins>
|
||||
</div>
|
||||
<q-dialog v-model="showAccountInfo" full-height full-width>
|
||||
<q-card v-if="circuit">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title class="text-h7">
|
||||
{{ tools.getNomeUtenteByRecUser(contact) }}
|
||||
</q-toolbar-title>
|
||||
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
|
||||
</q-toolbar>
|
||||
<CUserInfoAccount
|
||||
:user="contact"
|
||||
:circuitname="circuitname"
|
||||
:admin="tools.iAmAdminCircuit(circuitname)"
|
||||
/>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CMyUser.ts">
|
||||
|
||||
25
src/components/CUserInfoAccount/CUserInfoAccount.scss
Executable file
25
src/components/CUserInfoAccount/CUserInfoAccount.scss
Executable file
@@ -0,0 +1,25 @@
|
||||
.myflex{
|
||||
display: flex;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.container{
|
||||
vertical-align: center;
|
||||
padding: 5px;
|
||||
font-size: 1.15rem;
|
||||
}
|
||||
|
||||
.element{
|
||||
font-weight: bold;
|
||||
vertical-align: center;
|
||||
padding: 5px;
|
||||
font-size: 1.15rem;
|
||||
}
|
||||
|
||||
|
||||
.title_param{
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
.iconcirc {
|
||||
margin-right: 4px;
|
||||
}
|
||||
117
src/components/CUserInfoAccount/CUserInfoAccount.ts
Executable file
117
src/components/CUserInfoAccount/CUserInfoAccount.ts
Executable file
@@ -0,0 +1,117 @@
|
||||
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { IMyGroup, IImgGallery, IUserFields, IUserProfile, IFriends, ICircuit, IAccount } from 'model'
|
||||
import { costanti } from '@costanti'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { CUserNonVerif } from '@/components/CUserNonVerif'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { CSaldo } from '@/components/CSaldo'
|
||||
import { CSendCoins } from '@/components/CSendCoins'
|
||||
import { CCurrencyValue } from '@/components/CCurrencyValue'
|
||||
import { CCurrencyV2 } from '@/components/CCurrencyV2'
|
||||
import { useCircuitStore } from '@store/CircuitStore'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CUserInfoAccount',
|
||||
emits: ['setCmd'],
|
||||
components: {CUserNonVerif, CSaldo, CSendCoins, CCurrencyValue, CCurrencyV2 },
|
||||
props: {
|
||||
user: {
|
||||
type: Object as PropType<IUserFields>,
|
||||
required: true,
|
||||
},
|
||||
circuitname: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
admin: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
account: {
|
||||
type: Object as PropType<IAccount>,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
|
||||
setup(props, { emit }) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const $router = useRouter()
|
||||
|
||||
const myaccount = ref(<IAccount|undefined>undefined)
|
||||
|
||||
const circuitStore = useCircuitStore()
|
||||
|
||||
const table = ref(toolsext.TABMYGROUPS)
|
||||
|
||||
const circuit = ref(<ICircuit | null | undefined>null)
|
||||
|
||||
watch(() => props.user, (newval, oldval) => {
|
||||
mounted()
|
||||
})
|
||||
|
||||
function mounted() {
|
||||
circuit.value = circuitStore.getCircuitByName(props.circuitname)
|
||||
|
||||
if (props.account) {
|
||||
myaccount.value = props.account
|
||||
} else {
|
||||
myaccount.value = props.user.account
|
||||
}
|
||||
}
|
||||
|
||||
function getImgGroup(group: IMyGroup) {
|
||||
return userStore.getImgByGroup(group)
|
||||
}
|
||||
|
||||
function naviga(path: string) {
|
||||
$router.push(path)
|
||||
}
|
||||
|
||||
function setCmd(cmd: number, myusername: string, value: any = '') {
|
||||
emit('setCmd', cmd, myusername, value)
|
||||
}
|
||||
|
||||
function myusername() {
|
||||
return userStore.my.username
|
||||
}
|
||||
|
||||
async function save(value: any) {
|
||||
console.log('save and mounted')
|
||||
await tools.loadCircuits()
|
||||
// ricarico
|
||||
mounted()
|
||||
|
||||
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
costanti,
|
||||
getImgGroup,
|
||||
naviga,
|
||||
setCmd,
|
||||
shared_consts,
|
||||
userStore,
|
||||
tools,
|
||||
table,
|
||||
myusername,
|
||||
circuit,
|
||||
circuitStore,
|
||||
t,
|
||||
myaccount,
|
||||
save,
|
||||
}
|
||||
},
|
||||
})
|
||||
99
src/components/CUserInfoAccount/CUserInfoAccount.vue
Executable file
99
src/components/CUserInfoAccount/CUserInfoAccount.vue
Executable file
@@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<div v-if="myaccount && circuit">
|
||||
<q-card-section>
|
||||
<div class="text-h6">{{ t('groups.infoaccount') }}</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-separator />
|
||||
|
||||
<CSaldo
|
||||
v-if="tools.isUserOk() && myaccount"
|
||||
:account="myaccount"
|
||||
:symbol="circuit.symbol"
|
||||
:color="circuit.color"
|
||||
:saldo="myaccount.saldo"
|
||||
:qtarem="myaccount ? circuitStore.getRemainingCoinsToSend(myaccount) : 0"
|
||||
>
|
||||
</CSaldo>
|
||||
|
||||
<q-card-section>
|
||||
<div v-if="myaccount.date_created" class="container">
|
||||
<q-icon name="fas fa-lightbulb" class="iconcirc"></q-icon>
|
||||
{{
|
||||
$t('shared.createddate', {
|
||||
date: tools.getstrDateYY(myaccount.date_created),
|
||||
})
|
||||
}}
|
||||
</div>
|
||||
<div
|
||||
v-if="
|
||||
!!myaccount.date_updated &&
|
||||
tools.getstrDate(myaccount.date_updated) !==
|
||||
tools.getstrDate(myaccount.date_created)
|
||||
"
|
||||
class="container"
|
||||
>
|
||||
<q-icon name="fas fa-pencil-alt" class="iconcirc"></q-icon>
|
||||
<span class="element">{{
|
||||
$t('shared.lastmodify', {
|
||||
date: tools.getstrDateYY(myaccount.date_updated),
|
||||
})
|
||||
}}</span>
|
||||
</div>
|
||||
|
||||
<div :class="$q.screen.lt.sm ? '' : 'row'">
|
||||
<div class="sezioni">
|
||||
<CCurrencyV2
|
||||
:symbol="tools.getSymbolByCircuit(circuit)"
|
||||
:color="tools.getColorByCircuit(circuit)"
|
||||
color_border="red"
|
||||
v-model="myaccount.fidoConcesso"
|
||||
icon="fas fa-battery-quarter"
|
||||
:label="t('circuit.fido_scoperto_default')"
|
||||
:tips="t('circuit.fido_scoperto_default_tips')"
|
||||
:paramTypeAccount="costanti.ParamTypeAccount.FIDO_CONCESSO"
|
||||
:myrecparam="myaccount"
|
||||
:admin="admin"
|
||||
@save="save"
|
||||
>
|
||||
</CCurrencyV2>
|
||||
</div>
|
||||
<div class="sezioni">
|
||||
<CCurrencyV2
|
||||
:symbol="tools.getSymbolByCircuit(circuit)"
|
||||
:color="tools.getColorByCircuit(circuit)"
|
||||
color_border="green"
|
||||
v-model="myaccount.qta_maxConcessa"
|
||||
icon="fas fa-battery-quarter"
|
||||
:label="t('circuit.qta_max_default')"
|
||||
:tips="t('circuit.qta_max_default_tips')"
|
||||
:paramTypeAccount="costanti.ParamTypeAccount.QTA_MAXCONCESSA"
|
||||
:myrecparam="myaccount"
|
||||
:admin="admin"
|
||||
@save="save"
|
||||
>
|
||||
</CCurrencyV2>
|
||||
</div>
|
||||
<div v-if="myaccount.totTransato" class="sezioni">
|
||||
<CCurrencyValue
|
||||
:symbol="tools.getSymbolByCircuit(circuit)"
|
||||
:color="tools.getColorByCircuit(circuit)"
|
||||
color_border="blue"
|
||||
v-model="myaccount.totTransato"
|
||||
icon="fas fa-battery-quarter"
|
||||
:label="t('circuit.totTransato')"
|
||||
:tips="t('circuit.totTransato_tips')"
|
||||
>
|
||||
</CCurrencyValue>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CUserInfoAccount.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CUserInfoAccount.scss';
|
||||
</style>
|
||||
1
src/components/CUserInfoAccount/index.ts
Executable file
1
src/components/CUserInfoAccount/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export { default as CUserInfoAccount } from './CUserInfoAccount.vue'
|
||||
@@ -168,6 +168,8 @@ export interface IUserFields {
|
||||
cart?: ICart
|
||||
ordercart?: IOrderCart
|
||||
calcstat?: ICalcStat|null
|
||||
|
||||
account?: IAccount
|
||||
}
|
||||
|
||||
export interface IUserExport {
|
||||
|
||||
@@ -7689,6 +7689,10 @@ export const tools = {
|
||||
return myrec ? myrec.field : ''
|
||||
},
|
||||
|
||||
getNomeUtenteByRecUser(user: IUserFields) {
|
||||
return user.name ? user.name + ' ' + (user.surname ? user.surname : '') : user.username
|
||||
},
|
||||
|
||||
// FINE !
|
||||
|
||||
// getLocale() {
|
||||
|
||||
@@ -328,7 +328,11 @@ export default defineComponent({
|
||||
'profile.img': 1,
|
||||
'profile.mycircuits': 1,
|
||||
'profile.qualifica': 1,
|
||||
'account._id': 1,
|
||||
'account.saldo': 1,
|
||||
'account.fidoConcesso': 1,
|
||||
'account.qta_maxConcessa': 1,
|
||||
'account.totTransato': 1,
|
||||
reported: 1,
|
||||
date_report: 1,
|
||||
username_who_report: 1,
|
||||
|
||||
Reference in New Issue
Block a user