2024-10-11 02:29:29 +02:00
|
|
|
import {
|
|
|
|
|
computed,
|
|
|
|
|
provide, defineComponent, onBeforeMount, onBeforeUnmount, onMounted, ref, toRef, toRefs, watch, reactive
|
|
|
|
|
} from 'vue'
|
|
|
|
|
|
2025-03-01 14:14:43 +01:00
|
|
|
import { tools } from '@tools'
|
2024-10-11 02:29:29 +02:00
|
|
|
import { costanti } from '@costanti'
|
|
|
|
|
import { useGlobalStore } from '@store/globalStore'
|
|
|
|
|
import { useUserStore } from '@store/UserStore'
|
|
|
|
|
|
2025-03-01 14:14:43 +01:00
|
|
|
import { shared_consts } from '@src/common/shared_vuejs'
|
|
|
|
|
import { useI18n } from 'vue-i18n'
|
2024-10-11 02:29:29 +02:00
|
|
|
import { toolsext } from '@store/Modules/toolsext'
|
|
|
|
|
import { useQuasar } from 'quasar'
|
|
|
|
|
|
|
|
|
|
import { QrStream, QrCapture, QrDropzone } from 'vue3-qr-reader'
|
|
|
|
|
import { useRouter } from 'vue-router'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
name: 'CQRCode',
|
|
|
|
|
emits: [''],
|
|
|
|
|
props: {
|
|
|
|
|
link: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: false,
|
|
|
|
|
default: '',
|
|
|
|
|
},
|
|
|
|
|
textlink: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: false,
|
|
|
|
|
default: '',
|
|
|
|
|
},
|
2024-10-26 17:12:05 +02:00
|
|
|
imglogo: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: false,
|
|
|
|
|
default: '',
|
|
|
|
|
},
|
2024-10-11 02:29:29 +02:00
|
|
|
read: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
required: false,
|
|
|
|
|
default: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
components: {
|
2025-05-15 18:22:37 +02:00
|
|
|
QrStream,
|
2024-10-11 02:29:29 +02:00
|
|
|
QrCapture,
|
|
|
|
|
QrDropzone
|
|
|
|
|
},
|
|
|
|
|
setup(props, { attrs, slots, emit }) {
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
const $q = useQuasar()
|
|
|
|
|
const globalStore = useGlobalStore()
|
|
|
|
|
const userStore = useUserStore()
|
|
|
|
|
const $router = useRouter()
|
|
|
|
|
|
|
|
|
|
const state = reactive({
|
|
|
|
|
data: null
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
function onDecode(data: any) {
|
|
|
|
|
if (data)
|
|
|
|
|
state.data = data
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const text = ref('');
|
|
|
|
|
|
|
|
|
|
function naviga(path: string) {
|
|
|
|
|
$router.push(path)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(mounted)
|
|
|
|
|
|
|
|
|
|
function mounted() {
|
|
|
|
|
// ...
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
t,
|
|
|
|
|
tools,
|
|
|
|
|
costanti,
|
|
|
|
|
toolsext,
|
|
|
|
|
text,
|
|
|
|
|
userStore,
|
|
|
|
|
...toRefs(state),
|
|
|
|
|
onDecode,
|
|
|
|
|
naviga,
|
2024-10-26 17:12:05 +02:00
|
|
|
globalStore,
|
2024-10-11 02:29:29 +02:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
})
|