刘光辉
10 小时以前 0dfe84494048ce27ba8449831782128412d3eb13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<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>