61 lines
1.7 KiB
TypeScript
Executable File
61 lines
1.7 KiB
TypeScript
Executable File
import { defineComponent, ref, computed, PropType, toRef, onMounted } from 'vue'
|
|
import { useUserStore } from '@store/UserStore'
|
|
import { useCircuitStore } from '@store/CircuitStore'
|
|
import { useRouter } from 'vue-router'
|
|
import { useGlobalStore } from '@store/globalStore'
|
|
import { useI18n } from '@/boot/i18n'
|
|
import { tools } from '@store/Modules/tools'
|
|
import { IAccount, ICircuit, IMyGroup, IOperators, ISendCoin, ISpecialField, IUserFields } from '../../model'
|
|
import { useQuasar } from 'quasar'
|
|
|
|
export default defineComponent({
|
|
name: 'CCheckCircuitsEnabled',
|
|
components: {},
|
|
props: {
|
|
to_user: {
|
|
type: Object as PropType<IUserFields>,
|
|
required: false,
|
|
default: null
|
|
},
|
|
to_group: {
|
|
type: Object as PropType<IMyGroup>,
|
|
required: false,
|
|
default: null,
|
|
},
|
|
to_contocom: {
|
|
type: String,
|
|
required: false,
|
|
default: '',
|
|
},
|
|
},
|
|
setup(props, { emit }) {
|
|
const $q = useQuasar()
|
|
const { t } = useI18n()
|
|
const userStore = useUserStore()
|
|
const circuitStore = useCircuitStore()
|
|
const $router = useRouter()
|
|
const globalStore = useGlobalStore()
|
|
|
|
const non_hai_circuito_nazionale = ref(false)
|
|
const destin_non_ha_circuito_naz = ref(false)
|
|
|
|
function load() {
|
|
non_hai_circuito_nazionale.value = !circuitStore.sonoDentroAlCircuitoNazionale()
|
|
destin_non_ha_circuito_naz.value = !circuitStore.EDentroAlCircuitoNazionale(props.to_user)
|
|
if (userStore.getMyCircuitsInCommonByUser(props.to_user).length > 0) {
|
|
destin_non_ha_circuito_naz.value = false
|
|
}
|
|
}
|
|
|
|
onMounted(load)
|
|
|
|
return {
|
|
userStore,
|
|
tools,
|
|
non_hai_circuito_nazionale,
|
|
destin_non_ha_circuito_naz,
|
|
$q,
|
|
}
|
|
}
|
|
})
|