scinote-web/app/javascript/packs/vue/repository_print_modal.js

41 lines
1.3 KiB
JavaScript
Raw Normal View History

2023-10-24 18:54:58 +08:00
import { createApp } from 'vue/dist/vue.esm-bundler.js';
import PrintModalContainer from '../../vue/repository_print_modal/container.vue';
2023-11-10 02:17:51 +08:00
import { mountWithTurbolinks } from './helpers/turbolinks.js';
function initPrintModalComponent() {
const container = $('.print-label-modal-container');
if (container.length) {
2023-10-24 18:54:58 +08:00
const app = createApp({
data() {
return {
showModal: false,
row_ids: [],
urls: {
print: container.data('print-url'),
zebraProgress: container.data('zebra-progress-url'),
printers: container.data('printers-url'),
labelTemplates: container.data('label-templates-url'),
rows: container.data('rows-url'),
fluicsInfo: container.data('fluics-info-url'),
printValidation: container.data('print-validation-url'),
labelPreview: container.data('label-preview-url')
}
};
},
methods: {
closeModal() {
this.showModal = false;
2023-11-21 20:39:21 +08:00
},
openModal() {
this.showModal = true;
}
}
});
2023-10-24 18:54:58 +08:00
app.component('PrintModalContainer', PrintModalContainer);
app.config.globalProperties.i18n = window.I18n;
2023-11-21 20:39:21 +08:00
window.PrintModalComponent = mountWithTurbolinks(app, '.print-label-modal-container');
}
}
initPrintModalComponent();