Members, Circuits
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
||||
import { useCircuitStore } from '@store/CircuitStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { IImgGallery, IUserFields, IUserProfile } from 'model'
|
||||
import { costanti } from '@costanti'
|
||||
@@ -31,11 +33,15 @@ export default defineComponent({
|
||||
setup(props, { emit }) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const circuitStore = useCircuitStore()
|
||||
const globalStore = useGlobalStore()
|
||||
// const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
// const $router = useRouter()
|
||||
|
||||
const myrec = ref(<any | null>null)
|
||||
const circuit = ref(<any | null>null)
|
||||
|
||||
const showingtooltip = ref(false)
|
||||
|
||||
watch(() => props.prop_myrec, (newval, oldval) => {
|
||||
|
||||
@@ -44,7 +50,7 @@ export default defineComponent({
|
||||
|
||||
function mounted() {
|
||||
if (props.prop_myrec) {
|
||||
myrec.value = props.prop_myrec
|
||||
circuit.value = props.prop_myrec
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +66,7 @@ export default defineComponent({
|
||||
|
||||
return {
|
||||
t,
|
||||
myrec,
|
||||
circuit,
|
||||
costanti,
|
||||
// naviga,
|
||||
setCmd,
|
||||
@@ -70,6 +76,9 @@ export default defineComponent({
|
||||
toolsext,
|
||||
fieldsTable,
|
||||
cmdExt,
|
||||
globalStore,
|
||||
circuitStore,
|
||||
showingtooltip,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -2,45 +2,64 @@
|
||||
<div class="q-py-xs centermydiv cardrec"
|
||||
:style="`max-width: `+ (tools.getwidth($q) - 20) +`px; ` + ($q.screen.lt.sm ? (`min-width: `+ (tools.getwidth($q) - 20) +`px;`) : ``)">
|
||||
|
||||
<q-item v-if="myrec" clickable v-ripple class="shadow-2 q-btn--rounded bg-teal-1">
|
||||
<q-item v-if="circuit" clickable v-ripple class="shadow-2 q-btn--rounded bg-teal-1">
|
||||
|
||||
<q-item-section v-if="myrec.photo" avatar
|
||||
@click="cmdExt(costanti.CMD_SHOW_PAGE, myrec)">
|
||||
<q-item-section v-if="circuit.photos" avatar
|
||||
@click="cmdExt(costanti.CMD_OPEN_PAGE, circuit)">
|
||||
<q-avatar size="60px">
|
||||
<q-img :src="userStore.getImgByCircuit(myrec)" :alt="myrec.descr"
|
||||
<q-img :src="userStore.getImgByCircuit(circuit)" :alt="circuit.descr"
|
||||
img-class="imgprofile" height="60px"/>
|
||||
</q-avatar>
|
||||
<q-chip class="glossy" icon-right="fas fa-users" text-color="blue"><span style="font-size: 1rem;" class="q-mr-xs">{{circuit.numMembers}}</span></q-chip>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section @click="cmdExt(costanti.CMD_SHOW_PAGE, myrec)">
|
||||
<q-item-label v-if="myrec.name" lines="1" class="text_title">
|
||||
<span class="text-weight-bold">{{ myrec.name }}</span>
|
||||
</q-item-label>
|
||||
<q-item-label v-if="myrec.subname" lines="1" class="text_title">
|
||||
<span>{{ myrec.subname }}</span>
|
||||
<span v-if="!myrec.transactionsEnabled"><q-icon name="fas fa-lock"></q-icon></span>
|
||||
</q-item-label>
|
||||
<q-item-label lines="3" v-if="myrec.longdescr">{{ myrec.longdescr }}<br>
|
||||
</q-item-label>
|
||||
<!--
|
||||
<CCurrencyValue
|
||||
:symbol="myrec.symbol"
|
||||
:tips="t('account.saldo_tips')"
|
||||
:color="myrec.color"
|
||||
:value="myrec.account.saldo"
|
||||
label="Saldo">
|
||||
<q-item-section @click="cmdExt(costanti.CMD_OPEN_PAGE, circuit)">
|
||||
|
||||
</CCurrencyValue>
|
||||
<q-item-label @click="naviga(tools.getPathByTableAndRec(table, circuit))"><strong>{{ circuit.name }}</strong> <span v-if="circuit.subname"> ({{ circuit.subname }})</span>
|
||||
</q-item-label>
|
||||
<q-item-label @click="naviga(tools.getPathByTableAndRec(table, circuit))" v-if="circuit.longdescr" caption lines="3"><em>{{ circuit.longdescr }}</em></q-item-label>
|
||||
<q-item-label caption lines="1">
|
||||
<q-chip
|
||||
v-if="circuit.status !== undefined && circuit.status !== 0" :color="circuitStore.getColorCircuitClass(circuit)"
|
||||
text-color="white"
|
||||
size="md"
|
||||
:icon="globalStore.getValueByTableSingle('statuscircuit', circuit.status, 'icon')">{{ globalStore.getValueByTableSingle('statuscircuit', circuit.status) }}
|
||||
<q-btn
|
||||
class="q-ml-sm"
|
||||
icon="fas fa-info" color="primary" text-color="white"
|
||||
size="xs"
|
||||
round
|
||||
@click="showingtooltip = !showingtooltip">
|
||||
<q-tooltip :offset="[10, 10]" v-model="showingtooltip">{{globalStore.getValueByTableSingle('statuscircuit', circuit.status, 'hint')}}</q-tooltip>
|
||||
</q-btn>
|
||||
</q-chip>
|
||||
</q-item-label>
|
||||
<q-item-label v-if="(!circuit.transactionsEnabled) && (circuit.status === shared_consts.CIRCUIT_STATUS.FASE3_MONETA_ABILITATA)" caption lines="1">
|
||||
<q-icon v-if="!circuit.transactionsEnabled" name="fas fa-lock">
|
||||
</q-icon>
|
||||
<span class="text-red text-weight-bold">{{ $t('circuit.transaction_suspended') }}</span>
|
||||
</q-item-label>
|
||||
|
||||
<!--
|
||||
<q-item-label v-if="circuit.name" lines="1" class="text_title">
|
||||
<span class="text-weight-bold">{{ circuit.name }}</span>
|
||||
</q-item-label>
|
||||
<q-item-label v-if="circuit.subname" lines="1" class="text_title">
|
||||
<span>{{ circuit.subname }}</span>
|
||||
<span v-if="!circuit.transactionsEnabled"><q-icon name="fas fa-lock"></q-icon></span>
|
||||
</q-item-label>
|
||||
<q-item-label lines="3" v-if="circuit.longdescr">{{ circuit.longdescr }}<br>
|
||||
</q-item-label>
|
||||
-->
|
||||
|
||||
</q-item-section>
|
||||
<q-item-section side v-if="tools.canModifyThisRec(myrec, table)">
|
||||
<q-item-section side v-if="tools.canModifyThisRec(circuit, table)">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-pencil-alt">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable v-close-popup
|
||||
@click="cmdExt(costanti.CMD_MODIFY, myrec._id)">
|
||||
@click="cmdExt(costanti.CMD_MODIFY, circuit._id)">
|
||||
<q-item-section side>
|
||||
<q-icon name="fas fa-pencil-alt"/>
|
||||
</q-item-section>
|
||||
@@ -48,7 +67,7 @@
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable v-close-popup @click="cmdExt(costanti.CMD_DELETE, myrec._id)">
|
||||
<q-item clickable v-close-popup @click="cmdExt(costanti.CMD_DELETE, circuit._id)">
|
||||
<q-item-section side>
|
||||
<q-icon name="fas fa-trash-alt"/>
|
||||
</q-item-section>
|
||||
|
||||
Reference in New Issue
Block a user