feat(pos): add exploded diagrams feature (#9) with interactive SVG viewer
- Blueprint with API endpoints: list, detail, SVG serve, vehicle-linked diagrams - Interactive SVG viewer with zoom/pan (mouse wheel, drag, touch, keyboard) - Clickable hotspots that highlight on hover and show part detail panel - Parts sidebar listing all callout numbers with catalog search integration - 3 placeholder SVG diagrams: braking system, suspension, engine components - Seeded diagrams, hotspots, and vehicle_diagrams in DB - Added to sidebar nav, i18n (ES/EN), and "Ver diagramas" link in catalog Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -122,7 +122,7 @@
|
||||
}
|
||||
|
||||
// ─── UI helpers ───
|
||||
function showLoading() { loading.classList.add('is-visible'); navGrid.innerHTML = ''; partsGrid.style.display = 'none'; partsGrid.innerHTML = ''; emptyState.classList.remove('is-visible'); paginationNav.innerHTML = ''; }
|
||||
function showLoading() { loading.classList.add('is-visible'); navGrid.innerHTML = ''; partsGrid.style.display = 'none'; partsGrid.innerHTML = ''; emptyState.classList.remove('is-visible'); paginationNav.innerHTML = ''; var dl = document.getElementById('diagLink'); if (dl && nav.level !== 'categories') dl.style.display = 'none'; }
|
||||
function hideLoading() { loading.classList.remove('is-visible'); }
|
||||
|
||||
function showEmpty(title, subtitle) {
|
||||
@@ -345,6 +345,19 @@
|
||||
updateBreadcrumb();
|
||||
levelTitle.textContent = 'Categorias de partes';
|
||||
setupLevelFilter(true);
|
||||
// Add "Ver diagramas" link
|
||||
var diagLink = document.getElementById('diagLink');
|
||||
if (!diagLink) {
|
||||
diagLink = document.createElement('a');
|
||||
diagLink.id = 'diagLink';
|
||||
diagLink.href = '/pos/diagrams';
|
||||
diagLink.className = 'btn-diagram-link';
|
||||
diagLink.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14.7 6.3a1 1 0 000 1.4l1.6 1.6a1 1 0 001.4 0l3.77-3.77a6 6 0 01-7.94 7.94l-6.91 6.91a2.12 2.12 0 01-3-3l6.91-6.91a6 6 0 017.94-7.94l-3.76 3.76z"/></svg> Ver diagramas';
|
||||
diagLink.style.cssText = 'display:inline-flex;align-items:center;gap:6px;padding:6px 14px;background:var(--color-primary-muted);color:var(--color-primary);border:1px solid var(--color-primary);border-radius:var(--radius-md);font-size:var(--text-body-sm);font-weight:600;text-decoration:none;cursor:pointer;transition:var(--transition-fast);margin-left:auto;';
|
||||
var titleContainer = levelTitle.parentElement;
|
||||
if (titleContainer) titleContainer.appendChild(diagLink);
|
||||
}
|
||||
diagLink.style.display = 'inline-flex';
|
||||
showLoading();
|
||||
|
||||
apiFetch(API + '/categories?mye_id=' + nav.engine.id_mye).then(function (data) {
|
||||
|
||||
Reference in New Issue
Block a user