mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Merge pull request #4621 from scinote-eln/release/1.26.2.1
Release/1.26.2.1
This commit is contained in:
commit
b7664ad70f
7 changed files with 44 additions and 36 deletions
|
@ -56,8 +56,6 @@
|
|||
//= require_directory ./access_permissions
|
||||
//= require sidebar
|
||||
//= require turbolinks
|
||||
//= require 'BrowserPrint-3.0.216.min'
|
||||
//= require 'BrowserPrint-Zebra-1.0.216.min'
|
||||
|
||||
// Initialize links for submitting forms. This is useful for submitting
|
||||
// forms with clicking on links outside form in cases when other than
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -20,7 +20,7 @@ class LabelPrinter < ApplicationRecord
|
|||
validates :language_type, presence: true
|
||||
|
||||
def self.zebra_print_enabled?
|
||||
RepositoryBase.stock_management_enabled?
|
||||
RepositoryBase.stock_management_enabled?.present?
|
||||
end
|
||||
|
||||
def done?
|
||||
|
|
|
@ -18,4 +18,5 @@
|
|||
></print-modal-container>
|
||||
</div>
|
||||
|
||||
<%= render partial: 'label_printers/zebra_printer_library' %>
|
||||
<%= javascript_pack_tag 'vue/repository_print_modal' %>
|
||||
|
|
4
app/views/label_printers/_zebra_printer_library.html.erb
Normal file
4
app/views/label_printers/_zebra_printer_library.html.erb
Normal file
|
@ -0,0 +1,4 @@
|
|||
<% if LabelPrinter.zebra_print_enabled? %>
|
||||
<%= javascript_include_tag 'BrowserPrint-3.0.216.min' %>
|
||||
<%= javascript_include_tag 'BrowserPrint-Zebra-1.0.216.min' %>
|
||||
<% end %>
|
|
@ -77,4 +77,5 @@
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<%= render partial: 'label_printers/zebra_printer_library' %>
|
||||
<%= javascript_include_tag "label_printers/zebra_settings" %>
|
||||
|
|
Loading…
Reference in a new issue