Conto Comunitario...
This commit is contained in:
4
src/components/CMyGroupOnlyView/CMyGroupOnlyView.scss
Executable file
4
src/components/CMyGroupOnlyView/CMyGroupOnlyView.scss
Executable file
@@ -0,0 +1,4 @@
|
||||
.myflex{
|
||||
display: flex;
|
||||
flex: 1;
|
||||
}
|
||||
122
src/components/CMyGroupOnlyView/CMyGroupOnlyView.ts
Executable file
122
src/components/CMyGroupOnlyView/CMyGroupOnlyView.ts
Executable file
@@ -0,0 +1,122 @@
|
||||
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 { toolsext } from '@store/Modules/toolsext'
|
||||
import { useCircuitStore } from '@store/CircuitStore'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyGroupOnlyView',
|
||||
emits: ['setCmd'],
|
||||
components: {},
|
||||
props: {
|
||||
mygrp: {
|
||||
type: Object as PropType<IMyGroup | null>,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
mygroupname: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
visu: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
circuitname: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
noaut: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
labelextra: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
setup(props, { emit }) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const $router = useRouter()
|
||||
const $route = useRoute()
|
||||
|
||||
const groupname = ref('')
|
||||
const circuitStore = useCircuitStore()
|
||||
|
||||
const showsendCoinTo = ref(false)
|
||||
|
||||
const grp = ref(<IMyGroup | null>null)
|
||||
|
||||
const table = ref(toolsext.TABMYGROUPS)
|
||||
|
||||
const circuit = ref(<ICircuit | null | undefined>null)
|
||||
|
||||
watch(() => props.mygrp, (newval, oldval) => {
|
||||
mounted()
|
||||
})
|
||||
|
||||
function mounted() {
|
||||
if (!props.mygrp) {
|
||||
if (props.mygroupname) {
|
||||
groupname.value = props.mygroupname
|
||||
//++Todo: carica contact
|
||||
grp.value = null
|
||||
}
|
||||
} else {
|
||||
if (props.mygrp) {
|
||||
grp.value = props.mygrp
|
||||
groupname.value = props.mygrp.groupname
|
||||
}
|
||||
}
|
||||
circuit.value = circuitStore.getCircuitByName(props.circuitname)
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
grp,
|
||||
costanti,
|
||||
getImgGroup,
|
||||
naviga,
|
||||
setCmd,
|
||||
shared_consts,
|
||||
userStore,
|
||||
tools,
|
||||
table,
|
||||
myusername,
|
||||
circuit,
|
||||
showsendCoinTo,
|
||||
}
|
||||
},
|
||||
})
|
||||
41
src/components/CMyGroupOnlyView/CMyGroupOnlyView.vue
Executable file
41
src/components/CMyGroupOnlyView/CMyGroupOnlyView.vue
Executable file
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<div v-if="tools.isUserOk()">
|
||||
<div v-if="grp">
|
||||
<q-item class="q-my-sm" clickable>
|
||||
<q-item-section
|
||||
avatar
|
||||
@click="naviga(tools.getPathByGroup(grp, table))"
|
||||
>
|
||||
<q-item-label v-if="labelextra"
|
||||
><strong>{{ labelextra }}</strong></q-item-label
|
||||
>
|
||||
<q-avatar size="60px">
|
||||
<q-img
|
||||
:src="getImgGroup(grp)"
|
||||
:alt="grp.groupname"
|
||||
img-class="imgprofile"
|
||||
height="60px"
|
||||
/>
|
||||
</q-avatar>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section @click="naviga(tools.getPathByGroup(grp, table))">
|
||||
<q-item-label
|
||||
><strong>{{ grp.title }}</strong> ({{ grp.groupname }})
|
||||
</q-item-label>
|
||||
<q-item-label v-if="grp.descr" caption lines="3"
|
||||
><em>{{ grp.descr }}</em></q-item-label
|
||||
>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else></div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CMyGroupOnlyView.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CMyGroupOnlyView.scss';
|
||||
</style>
|
||||
1
src/components/CMyGroupOnlyView/index.ts
Executable file
1
src/components/CMyGroupOnlyView/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export { default as CMyGroupOnlyView } from './CMyGroupOnlyView.vue'
|
||||
Reference in New Issue
Block a user