ver 0.5.71:

- Info Conto
- Admin: poter modificare Fido e QtaMax.
This commit is contained in:
Surya Paolo
2023-02-23 16:07:52 +01:00
parent 19860aa438
commit c8e0f7922f
39 changed files with 617 additions and 187 deletions

View File

@@ -19,7 +19,7 @@
text-color="white"
></q-btn>
<div v-else>
<div v-if="$q.platform.is.ios && $q.platform.is.safari">
<div v-if="$q.platform.is.ios && $q.platform.is.safari && !tools.isDevelop()">
<q-btn
glossy
size="xl"
@@ -56,6 +56,7 @@
</div>
<div v-if="$q.platform.is.android">
<q-btn
v-if="!tools.isDevelop()"
glossy
size="lg"
label="Installa App"

View File

View File

@@ -0,0 +1,122 @@
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
import { tools } from '@src/store/Modules/tools'
import { date, useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n'
import { CCurrencyValue } from '@/components/CCurrencyValue'
import { CMyFieldDb } from '@/components/CMyFieldDb'
import { costanti } from '@costanti'
export default defineComponent({
name: 'CCurrencyV2',
components: { CCurrencyValue, CMyFieldDb },
emits: ['save'],
props: {
small: {
type: Boolean,
default: false,
},
label: {
type: String,
required: false,
default: '',
},
tips: {
type: String,
required: false,
default: '',
},
readonly: {
type: Boolean,
required: false,
default: false,
},
symbol: {
type: String,
required: true,
},
color: {
type: String,
required: false,
default: '',
},
color_border: {
type: String,
required: false,
default: '',
},
icon: {
type: String,
required: false,
default: '',
},
modelValue: {
type: [String, Number],
required: true,
default: '',
},
valueextra: {
type: String,
required: false,
default: '',
},
paramTypeAccount: {
type: Number,
required: false,
default: 0,
},
myrecparam: {
type: Object,
required: false,
default: null,
},
admin: {
type: Boolean,
required: false,
default: false,
},
},
setup(props, { emit }) {
const $q = useQuasar()
const { t } = useI18n()
const changeParamValue = ref(false)
const showingtooltip = ref(false)
const myvalue = ref(<any>null)
function created() {
// created
myvalue.value = props.modelValue
}
function changedParamValue(value: boolean) {
changeParamValue.value = value
}
function save(value: any) {
// ricarico
emit('save', value)
myvalue.value = value
}
onMounted(created)
return {
showingtooltip,
t,
tools,
changeParamValue,
changedParamValue,
costanti,
save,
myvalue,
}
},
})

View File

@@ -0,0 +1,47 @@
<template>
<div v-if="myrecparam">
<CCurrencyValue
:symbol="symbol"
:color="color"
:color_border="color_border"
v-model="myvalue"
:icon="icon"
:label="label"
:tips="tips"
:paramTypeAccount="paramTypeAccount"
:myrecparam="myrecparam"
@changedParamValue="changedParamValue"
:admin="admin"
>
</CCurrencyValue>
</div>
<q-dialog v-model="changeParamValue">
<q-card class="dialog_card">
<q-toolbar class="bg-primary text-white">
<q-toolbar-title class="text-h7">
{{ $t('account.settings') }}
</q-toolbar-title>
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
</q-toolbar>
<q-card-section class="inset-shadow">
<CMyFieldDb
v-if="myrecparam"
table="accounts"
:title="tools.getStrByParamTypeAccount(paramTypeAccount)"
:id="myrecparam._id"
:rec="myrecparam"
:mykey="tools.getFieldByParamTypeAccount(paramTypeAccount)"
:type="tools.getTypeByParamTypeAccount(paramTypeAccount)"
@save="save"
/>
</q-card-section>
</q-card>
</q-dialog>
</template>
<script lang="ts" src="./CCurrencyV2.ts">
</script>
<style lang="scss" scoped>
@import './CCurrencyV2.scss';
</style>

View File

@@ -0,0 +1 @@
export {default as CCurrencyV2} from './CCurrencyV2.vue'

View File

@@ -4,9 +4,18 @@ import { tools } from '@src/store/Modules/tools'
import { date, useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n'
import { costanti } from '@costanti'
export default defineComponent({
name: 'CCurrencyValue',
components: { },
emits: ['changedParamValue' ],
props: {
modelValue: {
type: [String, Number],
required: false,
default: '',
},
small: {
type: Boolean,
default: false,
@@ -45,17 +54,27 @@ export default defineComponent({
required: false,
default: '',
},
value: {
type: Number,
required: true,
},
valueextra: {
type: String,
required: false,
default: '',
},
paramTypeAccount: {
type: Number,
required: false,
default: 0,
},
myrecparam: {
type: Object,
required: false,
default: null,
},
admin: {
type: Boolean,
required: false,
default: false,
},
},
components: {},
setup(props, { emit }) {
const $q = useQuasar()
const { t } = useI18n()
@@ -66,13 +85,13 @@ export default defineComponent({
// created
}
onMounted(created)
return {
showingtooltip,
t,
tools,
costanti,
}
},
})

View File

@@ -4,11 +4,11 @@
dense
class="cltexth4 chipbooked shadow-5 q-pa-sm2"
size="md"
:color="value > 0 ? `green` : value === 0 ? `gray` : `red`"
:color="modelValue > 0 ? `green` : modelValue === 0 ? `gray` : `red`"
text-color="white"
icon="fas fa-coins"
>
{{ tools.roundDec2(value) }}
{{ tools.roundDec2(modelValue) }}
<span class="text-currency"
>&nbsp;<em
class="q-pa-xxs text-white rounded-borders shadow-2"
@@ -20,7 +20,7 @@
</div>
<div v-else>
<div
v-if="value !== null"
v-if="modelValue !== null"
:class="
`text-h5 ` +
(small ? `bordo_stondato_small` : `bordo_stondato_stretto`) +
@@ -35,7 +35,12 @@
(color_border ? `border-color: ` + color_border + `!important;` : '')
"
>
<div :class="`text-center text-h7-dense text-italic ` + ($q.dark.isActive ? `text-grey-6`: `text-grey-14`)">
<div
:class="
`text-center text-h7-dense text-italic ` +
($q.dark.isActive ? `text-grey-6` : `text-grey-14`)
"
>
<span v-if="small">
<em
class="q-px-xs text-white rounded-borders"
@@ -53,7 +58,7 @@
type="number"
rounded
:class="!small ? `q-px-sm text-h5` : `q-px-xs text-h7`"
:color="value > 0 ? `green` : `red`"
:color="modelValue > 0 ? `green` : `red`"
>
<template v-slot:prepend>
<!--<img src="https://cdn.quasar.dev/logo-v2/svg/logo.svg">-->
@@ -71,7 +76,7 @@
</template>
<template v-slot:control>
<div :class="`align_elem_right ` + (small ? `text-h7` : ``)">
{{ valueextra }}{{ tools.roundDec2(value) }}
{{ valueextra }}{{ tools.roundDec2(modelValue) }}
<q-tooltip :offset="[10, 10]" v-model="showingtooltip">{{
tips
}}</q-tooltip>
@@ -85,6 +90,15 @@
>{{ symbol }}</em
>
</div>
<div v-if="paramTypeAccount && admin">
<q-btn
flat
round
icon="fas fa-pencil-alt"
size="sm"
@click="$emit('changedParamValue', true)"
></q-btn>
</div>
</template>
</q-field>
</div>

View File

@@ -20,7 +20,7 @@
}
.progress-base {
height: 3px;
height: 5px;
border-radius: 3px;
background-color: #e9ecef;
}

View File

@@ -42,34 +42,32 @@
<q-item-section>
<q-item-label
:class="
(!$q.dark.isActive ? 'text-grey-5' : 'text-white') +
(!$q.dark.isActive ? 'text-grey-9' : 'text-white') +
` title_view_shadow`
"
style="letter-spacing: 1px"
>
{{ rec.title }}
</q-item-label>
<q-item-label
<q-item-label lines="3" no-wrap
v-if="rec.subtitle"
:class="
(!$q.dark.isActive ? 'text-grey-5' : 'text-white') +
` title_view_subtitle_shadow`
(!$q.dark.isActive ? 'text-grey-8' : 'text-white') +
` title_view_subtitle`
"
>
<span v-html="rec.subtitle"></span>
</q-item-label>
<q-item-label class="text-h9" style="letter-spacing: 2px">
<!--{{ calcstat.numByTab[rec.table] }}-->
</q-item-label>
</q-item-section>
<q-item-section side>
<q-img v-if="rec.image" :src="rec.image" style="width: 35px;"></q-img>
<q-item-section side class="small_side" style="right: 4px; position: absolute; ">
<q-img v-if="rec.image" :src="rec.image" style="width: 27px;"></q-img>
<q-icon
v-else
:name="rec.icon"
:class="`text-` + rec.color"
size="35px"
size="27px"
></q-icon>
</q-item-section>
</q-item>
@@ -104,9 +102,9 @@
<q-card class="no-shadow q-pa-xxs">
<q-item class="q-pb-none q-pt-xs cursor-pointer" :to="rec.to">
<q-item-section>
<q-item-label
<q-item-label lines="3"
:class="
(!$q.dark.isActive ? 'text-grey-7' : 'text-white') +
(!$q.dark.isActive ? 'text-grey-9' : 'text-white') +
` title_view_small_shadow`
"
style="letter-spacing: 0.5px"
@@ -116,8 +114,8 @@
<q-item-label
v-if="rec.subtitle"
:class="
(!$q.dark.isActive ? 'text-grey-7' : 'text-white') +
` title_view_subtitle_shadow`
(!$q.dark.isActive ? 'text-grey-8' : 'text-white') +
` title_view_subtitle`
"
style="letter-spacing: 0.2px"
>
@@ -131,7 +129,7 @@
v-else
:name="rec.icon"
:class="`text-` + rec.color"
size="25px"
size="20px"
></q-icon>
</q-item-section>
</q-item>

View 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;
}

View 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,
}
},
})

View 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>

View File

@@ -0,0 +1 @@
export { default as CInfoAccount } from './CInfoAccount.vue'

View File

@@ -140,8 +140,9 @@ export default defineComponent({
function showandsel(row: any, col: any, newval: any, valinitial: any) {
console.log('showandsel CMyFieldDb', row, col, newval)
if (newval !== valinitial)
if (newval !== valinitial) {
setValDb($q, props.mykey, newval, props.type, props.serv, props.table, props.mysubkey, props.id, props.indrec, props.mysubsubkey, props.specialField)
}
}

View File

@@ -10,6 +10,7 @@ import { useRoute, useRouter } from 'vue-router'
import { CUserNonVerif } from '@/components/CUserNonVerif'
import { toolsext } from '@store/Modules/toolsext'
import { CSaldo } from '@/components/CSaldo'
import { CInfoAccount } from '@/components/CInfoAccount'
import { CSendCoins } from '@/components/CSendCoins'
import { CCurrencyValue } from '@/components/CCurrencyValue'
import { useCircuitStore } from '@store/CircuitStore'
@@ -17,7 +18,7 @@ import { useCircuitStore } from '@store/CircuitStore'
export default defineComponent({
name: 'CMyGroup',
emits: ['setCmd'],
components: {CUserNonVerif, CSaldo, CSendCoins, CCurrencyValue },
components: {CInfoAccount, CUserNonVerif, CSaldo, CSendCoins, CCurrencyValue },
props: {
mygrp: {
type: Object as PropType<IMyGroup | null>,

View File

@@ -562,95 +562,14 @@
</CSendCoins>
</div>
<q-dialog v-model="showAccountInfo" full-height full-width>
<q-card>
<q-card v-if="circuit">
<q-toolbar class="bg-primary text-white">
<q-toolbar-title>
{{ grp.title }}
</q-toolbar-title>
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
</q-toolbar>
<q-card-section>
<div class="text-h6">{{ t('groups.infoaccount') }}</div>
</q-card-section>
<q-separator />
<CSaldo
v-if="tools.isUserOk() && grp.account"
:account="grp.account"
:symbol="circuit.symbol"
:color="circuit.color"
:saldo="grp.account.saldo"
:qtarem="
grp.account ? circuitStore.getRemainingCoinsToSend(grp.account) : 0
"
>
</CSaldo>
<q-card-section>
<div v-if="grp.account.date_created" class="container">
<q-icon name="fas fa-lightbulb" class="iconcirc"></q-icon>
{{
$t('shared.createddate', {
date: tools.getstrDateYY(grp.account.date_created),
})
}}
</div>
<div
v-if="
!!grp.account.date_updated &&
tools.getstrDate(grp.account.date_updated) !==
tools.getstrDate(grp.account.date_created)
"
class="container"
>
<q-icon name="fas fa-pencil-alt" class="iconcirc"></q-icon>
<span class="element">{{
$t('shared.lastmodify', {
date: tools.getstrDateYY(grp.account.date_updated),
})
}}</span>
</div>
<div :class="$q.screen.lt.sm ? '' : 'row'">
<div class="sezioni">
<CCurrencyValue
:symbol="tools.getSymbolByCircuit(circuit)"
:color="tools.getColorByCircuit(circuit)"
color_border="red"
:value="grp.account.fidoConcesso"
icon="fas fa-battery-quarter"
:label="t('circuit.fido_scoperto_default')"
:tips="t('circuit.fido_scoperto_default_tips')"
>
</CCurrencyValue>
</div>
<div class="sezioni">
<CCurrencyValue
:symbol="tools.getSymbolByCircuit(circuit)"
:color="tools.getColorByCircuit(circuit)"
color_border="green"
:value="grp.account.qta_maxConcessa"
icon="fas fa-battery-quarter"
:label="t('circuit.qta_max_default')"
:tips="t('circuit.qta_max_default_tips')"
>
</CCurrencyValue>
</div>
<div v-if="grp.account.totTransato" class="sezioni">
<CCurrencyValue
:symbol="tools.getSymbolByCircuit(circuit)"
:color="tools.getColorByCircuit(circuit)"
color_border="blue"
:value="grp.account.totTransato"
icon="fas fa-battery-quarter"
:label="t('circuit.totTransato')"
:tips="t('circuit.totTransato_tips')"
>
</CCurrencyValue>
</div>
</div>
</q-card-section>
<CInfoAccount :grp="grp" :circuitname="circuitname" :admin="tools.iAmAdminCircuit(circuitname)" />
</q-card>
</q-dialog>
</template>

View File

@@ -3,8 +3,10 @@
<div v-if="mypathin && !!rec">
<q-toggle
v-if="tools.isManager()"
style=" position:absolute;"
v-model="editOn"
color="green"
size="sm"
@update:model-value="changeVisuDrawer(mypathin, editOn)"
icon="fas fa-pencil-alt"
>

View File

@@ -309,7 +309,7 @@
<CCurrencyValue
:symbol="tools.getSymbolByCircuit(row)"
:color="tools.getColorByCircuit(row)"
:value="myvalue"
v-model="myvalue"
:label="$t(col.label_trans)"
>
</CCurrencyValue>
@@ -1099,7 +1099,7 @@
<CCurrencyValue
:symbol="tools.getSymbolByCircuit(row)"
:color="tools.getColorByCircuit(row)"
:value="scope.value"
v-model="scope.value"
:label="$t(col.label_trans)"
>
</CCurrencyValue>

View File

@@ -41,6 +41,11 @@ export default defineComponent({
required: false,
default: '',
},
paramTypeAccount: {
type: Number,
required: false,
default: 0,
},
},
components: { CCurrencyValue, CMyFieldRec },
setup(props, { emit }) {

View File

@@ -5,17 +5,23 @@
:symbol="symbol"
:color_border="saldo > 0 ? `green` : `red`"
:color="color"
:value="saldo"
:label="t('account.saldo')">
v-model="saldo"
:label="t('account.saldo')"
:paramTypeAccount="paramTypeAccount"
:myrecparam="account"
>
</CCurrencyValue>
<CCurrencyValue
v-else
:symbol="symbol"
:tips="t('account.saldo_tips', {fido: qtarem, symbol})"
:color="color"
:value="saldo"
v-model="saldo"
:valueextra="account && account.notifspending && account.notifspending.length > 0 ? `* `: ''"
:label="t('account.saldo') + ` (` + t('account.dispon') + `: ` + qtarem + `)`">
:label="t('account.saldo') + ` (` + t('account.dispon') + `: ` + qtarem + `)`"
:paramTypeAccount="paramTypeAccount"
:myrecparam="account"
>
</CCurrencyValue>