ver 0.5.71:
- Info Conto - Admin: poter modificare Fido e QtaMax.
This commit is contained in:
25
src/components/CInfoAccount/CInfoAccount.scss
Executable file
25
src/components/CInfoAccount/CInfoAccount.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/CInfoAccount/CInfoAccount.ts
Executable file
117
src/components/CInfoAccount/CInfoAccount.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: 'CInfoAccount',
|
||||
emits: ['setCmd'],
|
||||
components: {CUserNonVerif, CSaldo, CSendCoins, CCurrencyValue, CCurrencyV2 },
|
||||
props: {
|
||||
grp: {
|
||||
type: Object as PropType<IMyGroup>,
|
||||
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.grp, (newval, oldval) => {
|
||||
mounted()
|
||||
})
|
||||
|
||||
function mounted() {
|
||||
circuit.value = circuitStore.getCircuitByName(props.circuitname)
|
||||
|
||||
if (props.account) {
|
||||
myaccount.value = props.account
|
||||
} else {
|
||||
myaccount.value = props.grp.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/CInfoAccount/CInfoAccount.vue
Executable file
99
src/components/CInfoAccount/CInfoAccount.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="./CInfoAccount.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CInfoAccount.scss';
|
||||
</style>
|
||||
1
src/components/CInfoAccount/index.ts
Executable file
1
src/components/CInfoAccount/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export { default as CInfoAccount } from './CInfoAccount.vue'
|
||||
Reference in New Issue
Block a user