2023-10-24 18:54:58 +08:00
|
|
|
import { createApp } from 'vue/dist/vue.esm-bundler.js';
|
2022-09-22 17:07:08 +08:00
|
|
|
import PrintModalContainer from '../../vue/repository_print_modal/container.vue';
|
2023-11-09 02:32:43 +08:00
|
|
|
import { handleTurbolinks } from './helpers/turbolinks.js';
|
2022-09-22 17:07:08 +08:00
|
|
|
|
|
|
|
function initPrintModalComponent() {
|
|
|
|
const container = $('.print-label-modal-container');
|
2022-11-14 17:42:51 +08:00
|
|
|
if (container.length) {
|
2023-10-24 18:54:58 +08:00
|
|
|
const app = createApp({
|
2022-11-14 17:42:51 +08:00
|
|
|
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;
|
2022-09-22 17:07:08 +08:00
|
|
|
}
|
|
|
|
}
|
2022-11-14 17:42:51 +08:00
|
|
|
});
|
2023-10-24 18:54:58 +08:00
|
|
|
app.component('PrintModalContainer', PrintModalContainer);
|
|
|
|
app.config.globalProperties.i18n = window.I18n;
|
|
|
|
app.mount('.print-label-modal-container');
|
2023-11-09 02:32:43 +08:00
|
|
|
handleTurbolinks(app);
|
2023-10-24 18:54:58 +08:00
|
|
|
window.PrintModalComponent = app;
|
2022-11-14 17:42:51 +08:00
|
|
|
}
|
2022-09-22 17:07:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
initPrintModalComponent();
|