<script lang="ts" setup>
|
import { onMounted, onUnmounted } from 'vue';
|
|
import { useModal } from '@jnpf/ui/modal';
|
|
import CustomPrintModal from '#/components/CustomPrint/CustomPrintModal.vue';
|
import { onlineUtils } from '#/utils/jnpf';
|
|
const emitter = onlineUtils.getEmitter();
|
|
const [registerCustomPrintModal, { openModal: openCustomPrintModal }] = useModal();
|
|
function handleOpenPrintModal(config: any) {
|
setTimeout(() => {
|
openCustomPrintModal(true, config);
|
}, 100);
|
}
|
|
onMounted(() => {
|
emitter.on('OPEN_PRINT_MODAL', handleOpenPrintModal);
|
});
|
|
onUnmounted(() => {
|
emitter.off('OPEN_PRINT_MODAL', handleOpenPrintModal);
|
});
|
</script>
|
|
<template>
|
<CustomPrintModal @register="registerCustomPrintModal" />
|
</template>
|