mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-06 07:33:04 +08:00
Fix vue print modal component initialization [SCI-7469] (#4616)
This commit is contained in:
parent
e4673f67ba
commit
4e77174e52
2 changed files with 37 additions and 33 deletions
|
@ -59,12 +59,14 @@
|
|||
|
||||
$(document).on('click', '.print-label-button', function() {
|
||||
var selectedRows = $(this).data('rows');
|
||||
PrintModalComponent.showModal = true;
|
||||
if (selectedRows.length) {
|
||||
$('#modal-info-repository-row').modal('hide');
|
||||
PrintModalComponent.row_ids = selectedRows;
|
||||
} else {
|
||||
PrintModalComponent.row_ids = RepositoryDatatable.selectedRows();
|
||||
if (typeof PrintModalComponent !== 'undefined') {
|
||||
PrintModalComponent.showModal = true;
|
||||
if (selectedRows.length) {
|
||||
$('#modal-info-repository-row').modal('hide');
|
||||
PrintModalComponent.row_ids = selectedRows;
|
||||
} else {
|
||||
PrintModalComponent.row_ids = RepositoryDatatable.selectedRows();
|
||||
}
|
||||
}
|
||||
});
|
||||
}());
|
||||
|
|
|
@ -7,35 +7,37 @@ Vue.prototype.i18n = window.I18n;
|
|||
|
||||
function initPrintModalComponent() {
|
||||
const container = $('.print-label-modal-container');
|
||||
window.PrintModalComponent = new Vue({
|
||||
el: '.print-label-modal-container',
|
||||
name: 'PrintModalComponent',
|
||||
components: {
|
||||
'print-modal-container': PrintModalContainer
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showModal: false,
|
||||
row_ids: [],
|
||||
zebraEnabled: container.data('zebra-enabled'),
|
||||
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')
|
||||
if (container.length) {
|
||||
window.PrintModalComponent = new Vue({
|
||||
el: '.print-label-modal-container',
|
||||
name: 'PrintModalComponent',
|
||||
components: {
|
||||
'print-modal-container': PrintModalContainer
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showModal: false,
|
||||
row_ids: [],
|
||||
zebraEnabled: container.data('zebra-enabled'),
|
||||
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;
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
closeModal() {
|
||||
this.showModal = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
initPrintModalComponent();
|
||||
|
|
Loading…
Reference in a new issue