2022-02-03 00:33:05 +01:00
|
|
|
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
|
|
|
|
import { useUserStore } from '@store/UserStore'
|
2023-01-03 16:51:45 +01:00
|
|
|
import { IMyGroup, IImgGallery, IUserFields, IUserProfile, IFriends, ICircuit, IAccount } from 'model'
|
2022-02-03 00:33:05 +01:00
|
|
|
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'
|
2022-02-14 10:25:09 +01:00
|
|
|
import { CUserNonVerif } from '@/components/CUserNonVerif'
|
2022-02-22 15:24:16 +01:00
|
|
|
import { toolsext } from '@store/Modules/toolsext'
|
2023-01-03 16:51:45 +01:00
|
|
|
import { CSaldo } from '@/components/CSaldo'
|
2023-02-23 16:07:52 +01:00
|
|
|
import { CInfoAccount } from '@/components/CInfoAccount'
|
2023-01-03 16:51:45 +01:00
|
|
|
import { CSendCoins } from '@/components/CSendCoins'
|
2023-02-20 02:20:00 +01:00
|
|
|
import { CCurrencyValue } from '@/components/CCurrencyValue'
|
2023-01-03 16:51:45 +01:00
|
|
|
import { useCircuitStore } from '@store/CircuitStore'
|
2022-02-03 00:33:05 +01:00
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
name: 'CMyGroup',
|
|
|
|
|
emits: ['setCmd'],
|
2023-02-23 16:07:52 +01:00
|
|
|
components: {CInfoAccount, CUserNonVerif, CSaldo, CSendCoins, CCurrencyValue },
|
2022-02-03 00:33:05 +01:00
|
|
|
props: {
|
|
|
|
|
mygrp: {
|
|
|
|
|
type: Object as PropType<IMyGroup | null>,
|
|
|
|
|
required: false,
|
|
|
|
|
default: null,
|
|
|
|
|
},
|
|
|
|
|
mygroupname: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: false,
|
|
|
|
|
default: null,
|
|
|
|
|
},
|
|
|
|
|
visu: {
|
|
|
|
|
type: Number,
|
|
|
|
|
required: true,
|
2023-01-03 16:51:45 +01:00
|
|
|
},
|
|
|
|
|
circuitname: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: false,
|
|
|
|
|
default: '',
|
|
|
|
|
},
|
2023-01-04 02:09:51 +01:00
|
|
|
noaut: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
required: false,
|
|
|
|
|
default: false,
|
|
|
|
|
},
|
2023-01-12 01:03:19 +01:00
|
|
|
|
2022-02-03 00:33:05 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
setup(props, { emit }) {
|
|
|
|
|
|
|
|
|
|
const userStore = useUserStore()
|
|
|
|
|
const $q = useQuasar()
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
const $router = useRouter()
|
|
|
|
|
const $route = useRoute()
|
|
|
|
|
|
|
|
|
|
const groupname = ref('')
|
2023-01-03 16:51:45 +01:00
|
|
|
const circuitStore = useCircuitStore()
|
|
|
|
|
|
|
|
|
|
const showsendCoinTo = ref(false)
|
2023-02-20 02:20:00 +01:00
|
|
|
const showAccountInfo = ref(false)
|
2022-02-03 00:33:05 +01:00
|
|
|
|
|
|
|
|
const grp = ref(<IMyGroup | null>null)
|
|
|
|
|
|
2022-02-22 15:24:16 +01:00
|
|
|
const table = ref(toolsext.TABMYGROUPS)
|
|
|
|
|
|
2023-01-03 16:51:45 +01:00
|
|
|
const circuit = ref(<ICircuit | null | undefined>null)
|
|
|
|
|
|
2022-02-03 00:33:05 +01:00
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-01-03 16:51:45 +01:00
|
|
|
circuit.value = circuitStore.getCircuitByName(props.circuitname)
|
2022-02-03 00:33:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-16 20:34:17 +02:00
|
|
|
function myusername() {
|
|
|
|
|
return userStore.my.username
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-03 00:33:05 +01:00
|
|
|
onMounted(mounted)
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
grp,
|
|
|
|
|
costanti,
|
|
|
|
|
getImgGroup,
|
|
|
|
|
naviga,
|
|
|
|
|
setCmd,
|
|
|
|
|
shared_consts,
|
|
|
|
|
userStore,
|
2022-02-14 10:25:09 +01:00
|
|
|
tools,
|
2022-02-28 03:33:21 +01:00
|
|
|
table,
|
2022-06-16 20:34:17 +02:00
|
|
|
myusername,
|
2023-01-03 16:51:45 +01:00
|
|
|
circuit,
|
2023-02-20 02:20:00 +01:00
|
|
|
circuitStore,
|
2023-01-03 16:51:45 +01:00
|
|
|
showsendCoinTo,
|
2023-02-20 02:20:00 +01:00
|
|
|
showAccountInfo,
|
|
|
|
|
t,
|
2022-02-03 00:33:05 +01:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
})
|