310 lines
11 KiB
PHP
310 lines
11 KiB
PHP
<!-- Modal modificato con pulsante per riconoscimento vocale, download e selezione matrici -->
|
|
<div class="modal fade" id="partsModal" tabindex="-1" aria-labelledby="partsModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-xl" style="max-width: 80% !important; width: 80% !important;">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="partsModalLabel">Parti per TRF: <span id="trfHeader"></span></h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; min-width: 0;">
|
|
<h6 style="margin: 0; white-space: nowrap;">Elenco Parti</h6>
|
|
<div style="display: flex; align-items: center; min-width: 0;">
|
|
<select id="global-matrice" class="ms-2" style="width: 250px !important; min-width: 250px !important;">
|
|
</select>
|
|
<input type="checkbox" id="showMixParts" name="showMixParts" style="margin-right: 5px; margin-left: 10px;">
|
|
<label for="showMixParts" style="font-size: 0.9rem; margin-right: 10px;">Mix</label>
|
|
<button type="button" class="btn btn-info btn-sm" id="renumberPartsBtn" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;">Rinumera Parti</button>
|
|
<button type="button" class="btn btn-secondary btn-sm ms-2" id="toggleVoiceBtn" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;"><i class="fas fa-microphone"></i> Voce</button>
|
|
</div>
|
|
</div>
|
|
<ul id="partsList" class="list-group"></ul>
|
|
<table class="table table-striped table-sm mt-3" id="partsTable">
|
|
<thead>
|
|
<tr>
|
|
<th>Num. Parte</th>
|
|
<th>Descrizione Parte</th>
|
|
<th>Azioni</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="partsTableBody">
|
|
<tr data-part-id="new">
|
|
<td><input type="number" class="form-control form-control-sm part-number" value="1" style="width: 80px;"></td>
|
|
<td><input type="text" class="form-control form-control-sm part-description" placeholder="Inserisci descrizione" style="width: 100%;"></td>
|
|
<td>
|
|
<button type="button" class="btn btn-success btn-sm add-row" style="padding: 0.1rem 0.3rem; font-size: 0.8rem;"><i class="fas fa-plus fa-xs"></i></button>
|
|
<button type="button" class="btn btn-primary btn-sm add-mix-row" style="padding: 0.1rem 0.3rem; font-size: 0.8rem;">M</button>
|
|
<button type="button" class="btn btn-danger btn-sm remove-row" style="padding: 0.1rem 0.3rem; font-size: 0.8rem; display: none;"><i class="fas fa-trash fa-xs"></i></button>
|
|
<span class="save-status text-success" style="display: none; margin-left: 5px;"><i class="fas fa-check fa-xs"></i></span>
|
|
<span class="save-loading text-warning" style="display: none; margin-left: 5px;"><i class="fas fa-spinner fa-spin fa-xs"></i></span>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<h6>Foto del Campione</h6>
|
|
<div style="display: flex; align-items: center; margin-bottom: 10px;">
|
|
<button type="button" class="btn btn-primary btn-sm" id="downloadPhotoBtn" style="padding: 0.1rem 0.5rem; font-size: 0.8rem; margin-right: 10px;"><i class="fas fa-download"></i></button>
|
|
<div id="photoSelectorContainer" style="display: none;"></div>
|
|
</div>
|
|
<div style="position: relative; width: 100%; min-height: 400px;">
|
|
<img id="samplePhoto" src="" alt="Foto del campione" style="max-width: 100%; max-height: 100%; object-fit: contain; position: absolute; top: 0; left: 0;">
|
|
<canvas id="photoCanvas" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></canvas>
|
|
<canvas id="overlayCanvas" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000;"></canvas>
|
|
<div id="descriptionList" class="draggable-description" style="display: none;"></div>
|
|
<div id="markerContainer"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-primary btn-sm" id="addDescriptionsBtn" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;">Aggiungi Lista Descrizioni</button>
|
|
<button type="button" class="btn btn-danger btn-sm" id="removeAnnotationsBtn" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;">Rimuovi Descrizioni</button>
|
|
<button type="button" class="btn btn-warning btn-sm" id="undoMarkerBtn" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;">Undo Marker</button>
|
|
<button type="button" class="btn btn-success btn-sm" id="savePhotoBtn" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;">Salva Foto con Nome</button>
|
|
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;">Chiudi</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
#partsTable tr {
|
|
display: table-row !important;
|
|
}
|
|
|
|
#partsTable tr:hover {
|
|
background-color: #f5f5f5;
|
|
display: table-row !important;
|
|
}
|
|
|
|
#partsTable td,
|
|
#partsTable th {
|
|
padding: 0.2rem;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
#partsTable input {
|
|
height: 24px;
|
|
padding: 0.1rem 0.3rem;
|
|
}
|
|
|
|
#partsTable button {
|
|
padding: 0.1rem 0.3rem;
|
|
margin: 0 2px;
|
|
}
|
|
|
|
#partsTable i {
|
|
font-size: 0.6rem !important;
|
|
}
|
|
|
|
#partsModal {
|
|
z-index: 1060 !important;
|
|
}
|
|
|
|
#partsModal .modal-backdrop {
|
|
z-index: 1055 !important;
|
|
}
|
|
|
|
#partsModal .modal-content {
|
|
width: 100% !important;
|
|
max-width: 100% !important;
|
|
}
|
|
|
|
#partsList .list-group-item {
|
|
cursor: pointer;
|
|
transition: background-color 0.2s;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 5px 10px;
|
|
}
|
|
|
|
#partsList .list-group-item:hover {
|
|
background-color: #f5f5f5;
|
|
}
|
|
|
|
#partsList input[type="color"] {
|
|
width: 30px;
|
|
height: 24px;
|
|
padding: 0;
|
|
margin-left: 5px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.draggable-description {
|
|
position: absolute;
|
|
background: rgba(255, 255, 255, 0.8);
|
|
padding: 5px;
|
|
font-family: Arial, sans-serif;
|
|
color: #000000;
|
|
cursor: move;
|
|
user-select: none;
|
|
z-index: 1000;
|
|
min-width: 100px;
|
|
min-height: 50px;
|
|
overflow: visible;
|
|
border: 1px solid #ccc;
|
|
}
|
|
|
|
.draggable-description.active-interaction {
|
|
border: 2px dashed #000;
|
|
}
|
|
|
|
.draggable-description div {
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.resize-handle {
|
|
position: absolute;
|
|
bottom: 0;
|
|
right: 0;
|
|
width: 10px;
|
|
height: 10px;
|
|
background: #888;
|
|
cursor: se-resize;
|
|
}
|
|
|
|
.draggable-marker {
|
|
position: absolute;
|
|
width: 24px;
|
|
height: 24px;
|
|
border-radius: 50%;
|
|
color: #ffffff;
|
|
text-align: center;
|
|
line-height: 24px;
|
|
font-size: 12px;
|
|
cursor: move;
|
|
user-select: none;
|
|
z-index: 1000;
|
|
}
|
|
|
|
#markerContainer {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
.add-to-mix-btn {
|
|
padding: 0.1rem 0.3rem;
|
|
font-size: 0.8rem;
|
|
}
|
|
|
|
#savePhotoBtn {
|
|
transition: all 0.3s ease-in-out;
|
|
}
|
|
|
|
#savePhotoBtn.unsaved {
|
|
background-color: #dc3545 !important;
|
|
border-color: #dc3545 !important;
|
|
color: white !important;
|
|
animation: pulse 1.2s infinite;
|
|
}
|
|
|
|
@keyframes pulse {
|
|
0% {
|
|
box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
|
|
}
|
|
|
|
70% {
|
|
box-shadow: 0 0 10px 15px rgba(220, 53, 69, 0);
|
|
}
|
|
|
|
100% {
|
|
box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
|
|
}
|
|
}
|
|
|
|
.color-picker-container {
|
|
position: relative;
|
|
display: inline-block;
|
|
}
|
|
|
|
.color-picker {
|
|
display: none;
|
|
position: absolute;
|
|
top: 25px;
|
|
left: 0;
|
|
background: #fff;
|
|
border: 1px solid #ccc;
|
|
padding: 5px;
|
|
z-index: 1002;
|
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
|
flex-wrap: wrap;
|
|
width: 120px;
|
|
}
|
|
|
|
.color-option {
|
|
width: 24px;
|
|
height: 24px;
|
|
margin: 3px;
|
|
border: 1px solid #000;
|
|
cursor: pointer;
|
|
display: inline-block;
|
|
}
|
|
|
|
.color-option:hover {
|
|
border: 2px solid #000;
|
|
margin: 2px;
|
|
}
|
|
|
|
/* Stili per Select2 in #partsList e #global-matrice */
|
|
#partsList .select2-container,
|
|
.select2-container--default #global-matrice {
|
|
width: 250px !important;
|
|
min-width: 250px !important;
|
|
margin-left: 10px;
|
|
}
|
|
|
|
#partsList .select2-selection--single,
|
|
.select2-container--default #global-matrice .select2-selection--single {
|
|
height: 26px !important;
|
|
padding: 0.2rem 0.5rem !important;
|
|
font-size: 0.9rem !important;
|
|
border: 1px solid #ced4da !important;
|
|
background-color: #fff !important;
|
|
}
|
|
|
|
#partsList .select2-selection__rendered,
|
|
.select2-container--default #global-matrice .select2-selection__rendered {
|
|
line-height: 24px !important;
|
|
overflow: hidden !important;
|
|
text-overflow: ellipsis !important;
|
|
white-space: nowrap !important;
|
|
}
|
|
|
|
#partsList .select2-selection__arrow,
|
|
.select2-container--default #global-matrice .select2-selection__arrow {
|
|
height: 26px !important;
|
|
}
|
|
|
|
#partsList .save-status,
|
|
#partsList .save-loading {
|
|
margin-left: 5px;
|
|
}
|
|
|
|
.select2-container--open .select2-dropdown {
|
|
z-index: 1051 !important;
|
|
border: 1px solid #aaa !important;
|
|
border-radius: 4px !important;
|
|
background: white !important;
|
|
overflow-y: auto !important;
|
|
max-height: 200px !important;
|
|
}
|
|
|
|
.select2-container--default .select2-search--dropdown .select2-search__field {
|
|
width: 100% !important;
|
|
padding: 0.2rem !important;
|
|
}
|
|
|
|
.select2-container--default .part-matrice,
|
|
.select2-container--default #global-matrice {
|
|
width: 250px !important;
|
|
min-width: 250px !important;
|
|
}
|
|
</style> |